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

Global Objects as function names will be not be highlighted #1192

Open
11 opened this issue Nov 11, 2019 · 4 comments
Open

Global Objects as function names will be not be highlighted #1192

11 opened this issue Nov 11, 2019 · 4 comments

Comments

@11
Copy link

11 commented Nov 11, 2019

Float32Array constructor method doesn't get highlighted

new Float32Array();

I played around with similar constructors to see what will and will not get highlighted - These also do not get highlighted.

new 1Array();        // Fails
new 11Array();       // Fails
new 111Array();      // Fails

new 1Float32Array();     // Fails
new 11Float32Array();    // Fails
new 111Float32Array();   // Fails

Update
It appears a Global Object used as a constructor will not be highlighted, (even if there are numbers coming before the reserved word)

syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set WeakSet RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat fetch

I'm more than happy to help and try to come up with a way to fix this

PS: sorry for all the name edits

@11 11 changed the title new Float32Array() funciton is not highlighting Functions that include the word Array are not hightlighted Nov 11, 2019
@11 11 changed the title Functions that include the word Array are not hightlighted Functions that include 2 numbers before the word Array are not hightlighted Nov 11, 2019
@11 11 changed the title Functions that include 2 numbers before the word Array are not hightlighted Functions that include the word Array randomly do not highlight Nov 11, 2019
@11 11 changed the title Functions that include the word Array randomly do not highlight Functions that include the word Array or Float randomly do not highlight Nov 11, 2019
@11 11 changed the title Functions that include the word Array or Float randomly do not highlight Float32Array construcor does not get highlighted Nov 11, 2019
@11 11 changed the title Float32Array construcor does not get highlighted Float32Array constructor does not get highlighted Nov 11, 2019
@11 11 changed the title Float32Array constructor does not get highlighted Float32Array constructor and Constructors that contain Array do not get highlighted Nov 11, 2019
@11 11 changed the title Float32Array constructor and Constructors that contain Array do not get highlighted Float32Array constructor and constructors that contain Array do not get highlighted Nov 11, 2019
@11 11 changed the title Float32Array constructor and constructors that contain Array do not get highlighted Global Objects as function names will be not be highlighted Nov 11, 2019
@amadeus
Copy link
Collaborator

amadeus commented Nov 11, 2019

I am not sure I can repro this issue (unless I am misunderstanding it):

image

Array and Float32Array appear to be highlighted properly. Example is how other non global classes would get highlighted, and technically 1Array is an invalid name for a class/function - the first character must always be a letter.

@11
Copy link
Author

11 commented Nov 12, 2019

Hi, you're right. I think the issue can be closed.

The issue that I'm running into has more to do with the Gruvbox theme than vim-javascrtipt. Here is an example of what I'm seeing:
image

@Prakhil-tp
Copy link

Prakhil-tp commented Oct 12, 2020

I'm running into the same issue with the Gruvbox. Please keep it posted if there is any quick fix for this.

@Prakhil-tp
Copy link

Find the file colors/gruvbox.vim and paste the following lines at the bottom of the PanglossJS section.

hi! link jsGlobalObjects GruvboxGreen
hi! link jsOperatorKeyword GruvboxRed

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants