Hello, I’m having some trouble with sublimetext recognizing global javascript functions. .split() and .join() are not being recognized as functions, while .reverse() is. Can anyone help? I was under the impression that these were standard functions built into javascript. Do i need to download something else to access these functions? Thanks for the help.
Question regarding javascript built in functions
kingkeith
#2
split and join are indeed built in methods on the string prototype in JavaScript, and how ST highlights them won’t affect their actual usage in your JS interpreter (browser / node.js etc.)
In this case, reverse is scoped by ST as support.function.mutator, and split and join are simply variable.function, and your color scheme doesn’t color variable.function but it does color support.function scopes. So you could customize your color scheme to make them look the same if you desire.
1 Like
math2001
#3
As @kingkeith said, it’s your color scheme which doesn’t highlight variable.function the way you expect it to. You can tweak your color scheme as follow:
- Install ColorSchemeEditor
- In the command palette, choose
ColorSchemeEditor: Edit Current Current Color Schemeor something like that. - click on
reverse - add
variable.functionto the list of scopes (comma separated).
Done.
0 Likes
