Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd language support for JavaScript #570
Conversation
| return (view.match_selector(location, 'source.ts') or | ||
| view.match_selector(location, 'source.tsx')) | ||
| is_ts_file = view.match_selector(location, 'source.ts') or view.match_selector(location, 'source.tsx') | ||
| is_js_file = view.match_selector(location, 'source.jsx') and cli.enable_language_service_for_js |
This comment has been minimized.
This comment has been minimized.
DanielRosenwasser
Jan 2, 2017
Member
Does Sublime consider the entire region of a .js file to be a source.jsx scope? Or is this from supplying our own tmLanguage? Can you add a comment explaining, since it's not obvious why you're not checking for scope.js.
This comment has been minimized.
This comment has been minimized.
hoest
Jun 7, 2017
I think adding the selector for source.js beside source.jsx would be better. Like mentioned in my other comment.
This comment has been minimized.
This comment has been minimized.
idiotWu
Sep 16, 2017
Contributor
I am using view.match_selector(location, 'source.ts, source.tsx, source.js, source.jsx') here and it works perfectly.
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "auto_complete_triggers" : [ {"selector": "source.ts", "characters": "."} ], | |||
| "auto_complete_triggers" : [ {"selector": "source.ts", "characters": "."}, {"selector": "source.jsx", "characters": "."} ], | |||
This comment has been minimized.
This comment has been minimized.
hoest
Jun 7, 2017
Better change this to source.js and add this selector to the TypeScriptReact.sublime-settings file.
hoest left a comment
|
I don't think |
This comment has been minimized.
This comment has been minimized.
batusai513
commented
Sep 13, 2017
|
Any updates on this one? |
This comment has been minimized.
This comment has been minimized.
|
I think some key trigger bindings should also be adjusted for JavaScript files, eg: {
"keys": ["("],
"command": "typescript_signature_popup",
"context": [
- { "key": "selector", "operator": "equal", "operand": "source.ts, source.tsx" },
+ { "key": "selector", "operator": "equal", "operand": "source.ts, source.tsx, source.js, source.jsx" },
{ "key": "paren_pressed" }
]
}Besides, I'm just wondering if this PR will be merged soon |
This comment has been minimized.
This comment has been minimized.
james2doyle
commented
Jul 5, 2018
|
Since the issue seems to have gone stale, I had to turn to the Sublime LSP plugin and a different language server to get plain You can read more about how I got this working on the LSP Plugin repo. |
This comment has been minimized.
This comment has been minimized.
ryanolsonx
commented
Sep 21, 2018
|
Ping |
This comment has been minimized.
This comment has been minimized.
james2doyle
commented
Dec 17, 2018
|
I think this is closed now due to #620 |
zhengbli commentedDec 9, 2016
Until now this plugin only handles .ts files and .tsx files. This PR adds supports for .js files and .jsx files as well.