JS array with lots of data doesnt get highlighted


#1

Hi!

I dont know if this is a atom error or im just stupid but my problem is:

things to know: i am in a html file with script tag as first line of code, array is just numbers and i have no theme installed (i hope).

Code = var data = [4,1,3,2,4,5,1,3,5,4,3,2,4,1,3,4,5,2,3,4,5,1,3,5,4,2,3,2,1,4,5,2,3,4,3,4,3,4,2,3,1,3,2,5,4,3,1,2,4,5,4,3,4,5,1,3,4,3,2,4,3,4,2,1,3,5,4,2,3,5,4,2,1,3,5,4,1,2,3,5,4,2,3,4,5,1,2,3,4,2,3,5,4,3,5,4,3,1,4,5,3,2,4,1,3,2,5,3,4,5,1,2,3,4,2,3,1,4,5,3,2,3,2,4,3,1,4,3,2,5,3,1,4,2,3,2,4,5,3,2,4,3,2,1,4,3,5,3,4,1,3,5,4,2,3,2,1,4,3,2,4,5,3,2,4,5,3,2,4,3,2,1,5,4,3,2,1,4,5,3,2,4,3,5,4,1,3,4,5,2,3,3,2,5,4,3,1,2,4,5,3,2,1,5,2,1,3,5,4,3,2,1,5,2,4,3,1,2,5,4,3,5,1,2,3];

result in color =

as you can see only the first part is in orange. Is this a bug?


#2

Intentionally done for performance. The new grammar system doesn’t have that problem, but is still experimental right now. You can try it by going to Settings ➔ Core ➔ Enable tree sitter parsers


#3

I did that but the problem still happens. I restarted atom and reopened the file. :frowning:


#4

What language grammar is the file you open set to? See https://flight-manual.atom.io/using-atom/sections/grammar/


#5

It’s on autodetect. When i switch it to javascript the whole line is gray


#6

Does the issue happen in safe mode?


#7

Same result. Autodetect is 1/2 of the line orange. Javascript is the full line gray


#8

OK, I just reproduced what you describe. Seems like the tree-sitter parsing also needs a nudge to get going, so also open the language selection menu and choose JavaScript. This should apply it.

Interestingly, a bug in the current language selection menu means you can tell if the tree sitter version is being used: a green tick means the old type, no green tick (even after selecting it) means tree sitter.


#9

Yeah there are some issues with the grammar-selector and tree-sitter languages. The grammar-selector is only based on text mate grammars which might be the cause of this green tick issue. We are tracking this in https://github.com/atom/atom/issues/17029.