Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tokenization is skipped for long lines for performance reasons. The length of a long line can be configured via `editor.maxTokenizationLineLength`

I'm at a loss here. I have a Node.js server built for my project and out of nowhere, I started getting this error when I try to run the server in VSCode:

Tokenization is skipped for long lines for performance reasons. The length of a long line can be configured via editor.maxTokenizationLineLength.

I had edited some of my functions in my controller before this started. I discarded all changes but the error still persists. I don't understand what has changed for this to happen. Any advice would be greatly appreciated.

My code is here if you want to take a look https://github.com/Kevinclane/timeclock

like image 865
Kevbo Avatar asked Nov 17 '25 03:11

Kevbo


2 Answers

I fixed this problem by increasing Max Tokenization Length in VSCode :

  1. Go to File--> Preferences--> Setting
  2. Search for Max Tokenization Length enter image description here
  3. Change the default value to 2000000

I hope this will help

like image 195
Ousama Avatar answered Nov 18 '25 20:11

Ousama


I found the hard way that besides increasing the Max Tokenization Length as suggested by @Ousama, in order to avoid VS Code from crashing or becoming entirely unresponsive you might also want to enable the Async Tokenization option in the settings. Otherwise files with really long lines will make VS Code unresponsive. I'm not sure why this was not made default.

"Async Tokenization" option in the settings checked

  • GitHub issue introducing Async Tokenization.
like image 21
TheMechanic Avatar answered Nov 18 '25 20:11

TheMechanic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!