Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Highlighting in Editor Stops working partway through file #1857

Closed
3 tasks done
BrianAtDocumentedDesigns opened this issue Feb 2, 2023 · 5 comments
Closed
3 tasks done
Assignees
Labels
conclusion: off topic Off topic for this repository topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@BrianAtDocumentedDesigns

Describe the problem

I made a change to my file and syntax highlighting stopped. I tried closing the IDE, renaming the file, even installing and using a fresh copy of the nightly and nothing seems to work. It looks like the editor treats everything after a particular line (Line 268) as a comment.

The file compiles with no problem, however.
Tacometer_V0.zip

To reproduce

I can't reproduce it - it just happens to the file and stays that way

Expected behavior

I would expect syntax highlighting to not stop working

Arduino IDE version

IDE 2.03 or Feb 2 2023 nightly

Operating system

Windows

Operating system version

11

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
@BrianAtDocumentedDesigns BrianAtDocumentedDesigns added the type: imperfection Perceived defect in any part of project label Feb 2, 2023
@BrianAtDocumentedDesigns
Copy link
Author

Just discovered that if I comment out the whole switch case statement, syntax highlight reappears after

@kittaakos kittaakos added the topic: code Related to content of the project itself label Feb 3, 2023
@kittaakos kittaakos self-assigned this Feb 3, 2023
@kittaakos
Copy link
Contributor

Hi, thanks for reporting it and attaching the source; I could reproduce the defect. I looked into this mysterious issue, and I can confirm the syntax highlight of your code is also broken with the built-in extension from VS Code. This is what IDE2 uses under the hood:

"vscode-builtin-cpp": "https://open-vsx.org/api/vscode/cpp/1.52.1/file/vscode.cpp-1.52.1.vsix",

The highlighting of the sketch from VS Code with the built-in C++ extension is also broken:

Screen Shot 2023-02-03 at 09 30 46

But I have good news: formatting your code in IDE2 fixes the syntax highlighting. It works if you insert a space after the case keyword. Or you can format the entire document, and the syntax coloring will be correct in the sketch. I hope this helps for the time being.

1857.mp4

So that you know, we are aware of a few issues regarding the syntax coloring: #380.

@per1234 per1234 added the conclusion: off topic Off topic for this repository label Feb 3, 2023
@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2023
@BrianAtDocumentedDesigns
Copy link
Author

Thanks for the reply. I don't know why this is flagged as "off topic" though. As a general rule, software which doesn't work as expected should be reported.

It is clearly a bug. Telling somebody a bug report is "off topic" discourages bug reports.

@per1234
Copy link
Contributor

per1234 commented Feb 3, 2023

@BrianAtDocumentedDesigns it is marked "off topic" because it is not our bug. Arduino IDE 2.x is built on many other software projects. You may experience faults in Arduino IDE that are caused by a bug in one of those other software projects. In that case, the bug must be reported to the issue tracker of the codebase that contains the bug.

Of course, we don't expect the casual users will always be able to differentiate a fault originating from a bug in a dependency from a fault originating from a bug in Arduino's own codebase, so it is completely fine to report faults you experience when using Arduino IDE here, but if we determine the bug is not in our codebase, then we will close the issue because it is off topic here.

In extreme cases where a bug in a dependency is seriously impacting the usability of Arduino IDE and the upstream fix might take some time, we might try to make a patch here in this codebase. But this is not such a case. The cosmetic defect is specific to your non-standard code formatting (I was quite surprised this is even valid code), so this is not considered a critical defect that requires action on our part.

You are welcome to report the bug to the upstream project:

https://github.com/jeff-hykin/better-cpp-syntax

Please make sure to do the following first:

  • Verify the fault still occurs when using the development version of that project
  • Verify that there isn't an existing report in their issue tracker

Make sure to include the following in your report:

  • A minimal, reproducible, verifiable example (MCVE) of the fault (the sketch you shared here contains a huge amount of irrelevant code)
  • A reference to the section of the C++ specification that supports this odd omission of a space after the case statement as specification compliant

@JustTryingToGetSomeWorkDone

I think that if it's marked off topic the person marking it off topic should be responsible for, at the very least, reporting it to the upstream project. Users who report bugs here clearly do not know the bug belongs to another project. However the people choosing to use other projects in their own projects (VSCode code in Arduino IDE for example), do know and should feel responsible for reporting bugs in the projects whose source they're using that become apparent to them through bug reporting in their own projects. You have recognized this bug belongs to VSCode, you should report it. If we stop reporting bugs because it's annoying, open source software falls apart. Do you want people to stop reporting bugs to you because it's annoying for them to go through the effort? Imagine how few people would use Arduino if it was a HUGE buggy mess that no one ever reported bugs on. No one would use it and the project would die. Report your bugs Per1234.

@arduino arduino locked as too heated and limited conversation to collaborators Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
conclusion: off topic Off topic for this repository topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

4 participants