Skip to content

Wrong code highlighting #2116

Open
Open
@FloBab73

Description

@FloBab73

Describe the problem

Marking a word should highlight the same word in other places in the code. Sometimes the behaviour isn't as expected and not consistent, when the words don't match exactly. Some points might be up for discussion what the intended behaviour is, but some behaviours are wrong imo.

To reproduce

Copy the following code in the Arduino IDE:

requestCredentials
helloworld

void loop() {
  requestCredentials()
  helloworld
  hello
}

void requestCredetials(){
}

(notice the last requestCredentials has a missing n)

Following things are noticable and at least the first one should be fixed:

  1. highlighting requestCredentials (line 5) also highlights requestCredetials (line 10), notice the missing n. This also works the other way round
    • thats very evil because you don't notice the typo and wonder why the compiler throws an error
  2. highlighting requestCredentials (line 1) also highlights helloworld (line 2) , even though the words are completely different
  3. highlighting helloworld (line 6) shows different results when you delete helloworld in line 2, hello in line 7 only gets highlighted after deletion

Expected behavior

Different words shouldn't be highlighted when highlighting another word, especially when it is recognised as functions or variables.

Arduino IDE version

Version: 2.1.0 Date: 2023-04-19T15:31:10.185Z CLI Version: 0.32.2

Operating system

Windows

Operating system version

Windows 10 Enterprise 22H2

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions