Sublime Forum

Question regarding javascript built in functions

#1

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.

0 Likes

#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

#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 Scheme or something like that.
  • click on reverse
  • add variable.function to the list of scopes (comma separated).

Done.

0 Likes

#4

Thanks So much!

1 Like