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

C++ code highlighting fails for large files #11597

Closed
ArashPartow opened this issue Sep 6, 2016 · 14 comments · Fixed by #17933
Closed

C++ code highlighting fails for large files #11597

ArashPartow opened this issue Sep 6, 2016 · 14 comments · Fixed by #17933
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@ArashPartow
Copy link

ArashPartow commented Sep 6, 2016

  • VSCode Version: 1.4.0 date: 2016-08-04
  • OS Version: Windows 7/10

Upgraded vscode installation, the C++ code highlighting now starts to fail at around line 4000

The following file was used: https://raw.githubusercontent.com/ArashPartow/exprtk/master/exprtk.hpp

The following screenshot demonstrates the problem: http://pasteboard.co/hJ6RUAZtU.png

The following is from the start of the file: http://pasteboard.co/hJ7kaH2X7.png

The following is from the end of the file: http://pasteboard.co/hJ7Gp4nLR.png


Tried other files with the same results:

@ramya-rao-a
Copy link
Contributor

@ArashPartow Are you using any extensions for C++ or just VS Code out of the box?

@ArashPartow
Copy link
Author

ArashPartow commented Sep 7, 2016

@ramya-rao-a I'm using the C/C++ for Visual Studio Code extension.

http://pasteboard.co/3A56demY.png

I have tried with the extension being active and disabled and still get the same results. Though I did notice that when the extension is disabled the whitening seems to happen a couple of thousand lines later than when it is enabled.

@aeschli
Copy link
Contributor

aeschli commented Sep 7, 2016

@alexandrudima The textmate tokenizer seems to return tokens, but we don't show them.

@aeschli aeschli assigned alexdima and unassigned aeschli Sep 7, 2016
@alexdima
Copy link
Member

alexdima commented Sep 9, 2016

@aeschli I have improved vscode-textmate's npm run inspect to allow for loading multiple grammars. When both the C++ and C grammar are loaded, at line 17916 for this file, the rule stack grows to 101 and tokenization stops. ( the commit is microsoft/vscode-textmate@5aadb4e ). The relevant command line is:

C:\Alex\src\vscode-textmate>npm run inspect "..\vscode\extensions\cpp\syntaxes\c++.json" "..\vscode\extensions\cpp\syntaxes\c.json" ..\..\working_dir\11597\exprtk.hpp >out.txt

I will spend some time to isolate the constructs that lead to rules being pushed without being popped by the grammar. Once I do so, where can I file the bug (where do these grammars come from?)

@aeschli
Copy link
Contributor

aeschli commented Sep 9, 2016

The grammars are from https://github.com/atom/language-c. You can see this by checking the OSSREADME in the corresponding extension.

@alexdima
Copy link
Member

alexdima commented Sep 9, 2016

Thank you, I asked because I saw two entries. Is the textmate/c.tmbundle still used?

@aeschli
Copy link
Contributor

aeschli commented Sep 9, 2016

We still have /extensions/cpp/syntaxes/Platform.tmLanguage in there from the original https://github.com/textmate/c.tmbundle as it is included by other languages (Objective-C)

@ArashPartow
Copy link
Author

Update: I've recently updated to version 1.6.1 and am still seeing the above described problem.

@ArashPartow
Copy link
Author

Update: I've recently updated to version 1.7.0 and am still seeing the above described problem.

http://imgur.com/a/tCSKk

@ArashPartow
Copy link
Author

Update: I've recently updated to version 1.7.1 and am still seeing the above described problem.

@ArashPartow
Copy link
Author

Update: I've recently updated to version 1.7.2 and am still seeing the above described problem.

@chrmarti chrmarti added the bug Issue identified by VS Code Team member as probable bug label Nov 29, 2016
@ArashPartow
Copy link
Author

Update: I've recently updated to version 1.8.0 and am still seeing the above described problem.

@ArashPartow
Copy link
Author

Update: I've recently updated to version 1.8.1 and am still seeing the above described problem.

@alexdima alexdima added this to the January 2017 milestone Jan 9, 2017
@joaomoreno joaomoreno added the verified Verification succeeded label Jan 27, 2017
@ArashPartow
Copy link
Author

@alexandrudima @joaomoreno Just tried out the fix using version 1.9.0 and it's all working great.

Thank-you!

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants