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-highlight will not be available when a long string #162291

Closed
Except10n opened this issue Sep 29, 2022 · 9 comments
Closed

syntax-highlight will not be available when a long string #162291

Except10n opened this issue Sep 29, 2022 · 9 comments
Assignees
Labels
*not-reproducible Issue cannot be reproduced by VS Code Team member as described triage-needed

Comments

@Except10n
Copy link

Except10n commented Sep 29, 2022

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version:1.71.2
  • OS Version:Darwin x64 21.6.0

Steps to Reproduce:

  1. When a line is longer than 1000 characters
  2. Comment this line of code, highlighting is not available, The code after this line also cannot be highlighted

WX20220929-123445@2x

@RedCMD
Copy link
Contributor

RedCMD commented Sep 29, 2022

You can increase editor.maxTokenizationLineLength in settings
at the cost of performance

tho the default value is 20000?
not 1000

@Except10n
Copy link
Author

Except10n commented Sep 29, 2022

@RedCMD

"editor.maxTokenizationLineLength": 50000

After setting, the problem still exists

@RedCMD
Copy link
Contributor

RedCMD commented Sep 29, 2022

what language are you using?
and can we have a copy of your file please

@Except10n
Copy link
Author

Except10n commented Sep 30, 2022

a.js.zip

use javascript
maxTokenizationLineLength It didn't seem to work

WX20220930-124634@2x

WX20220930-124705@2x

@RedCMD
Copy link
Contributor

RedCMD commented Sep 30, 2022

Found it

"[javascript]": {
"editor.maxTokenizationLineLength": 2500
}

Was changed in Oct last year
8358d0c

I was able to change it via settings

"[javascript]": {
   "editor.maxTokenizationLineLength": 25000
},

You do need to update the js file to see changes

Would have been nice if clicking Also modified elsewhere would show the other locations
image

@Except10n
Copy link
Author

I do see this parameter, and I set it (on [javascript]) but it doesn't work

"[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode",
        "editor.maxTokenizationLineLength": 25000
    },
"editor.maxTokenizationLineLength": 25000,

@alexr00
Copy link
Member

alexr00 commented Sep 30, 2022

@rzhao271 for #162291 (comment)

@Except10n I do see this work for a 5500 length line:

	"[javascript]": {
		"editor.maxTokenizationLineLength": 6000
	},

@Except10n
Copy link
Author

Except10n commented Oct 11, 2022

@alexr00 You can take a look at the screenshot and sample I provided. Note that one line (1001 characters) highlighting is not effective

WX20220929-123445@2x

@rzhao271
Copy link
Contributor

@RedCMD that UI element actually shows a hover. Hovering over it reveals other locations where the setting has been modified. Tracking issue for UX improvements: #159088

@alexr00 alexr00 closed this as completed Nov 21, 2022
@alexr00 alexr00 added the *not-reproducible Issue cannot be reproduced by VS Code Team member as described label Nov 21, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*not-reproducible Issue cannot be reproduced by VS Code Team member as described triage-needed
Projects
None yet
Development

No branches or pull requests

5 participants