-
Notifications
You must be signed in to change notification settings - Fork 202
feat/allowjs-in-project #1261
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
feat/allowjs-in-project #1261
Conversation
Also please note this is just for the autocomplete/intellisense. |
lib/main/atom/utils/atom.ts
Outdated
@@ -119,7 +119,7 @@ export function getRangeForTextSpan(editor: AtomCore.IEditor, ts: { start: numbe | |||
export function getTypeScriptEditorsWithPaths() { | |||
return atom.workspace.getTextEditors() | |||
.filter(editor=> !!editor.getPath()) | |||
.filter(editor=> (path.extname(editor.getPath()) === '.ts')); | |||
.filter(editor=> (path.extname(editor.getPath()) === '.ts' || '.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean path.extname(editor.getPath()) in {'.ts': 1, '.js': 1}
?
Now this is interesting. With minor changes (pushed here in I'd like to release this behind a feature flag in the settings to let people play with it and get us some feedback since this is clearly experimental. @rwatts3, do you mind doing the work? |
Yes i'd be happy to see what I can do. I will start with cloning the I would also like to say that this is probably the single most important addition to Atom that could potentially win over a lot of people, especially those who enjoy Atom, and are constantly forced to use Webstorm and/or VSC for intellisense purposes. |
You can just merge the To break it down, we need:
For the P.S. Forgot to add the link - https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/ |
@guncha I may need some help with the other items, I'm still fairly new to atom packaging. |
Yeah, I have some ideas how to update the helpers to take into account the allowJs setting. As for supporting HTML files, that's a whole another can of worms that Typescript doesn't support out of the box, but it can be implemented using the plugin support they recently added. The short version is that you have to trick |
just wanted to follow-up, I won't be able to get to the other pieces, for this in case someone else want's to chime in and help wrap this up. |
Thanks, you guys, this PR will help me a lot. |
@guncha are you guys going to be able to finish this out and complete the PR ? |
Please, please, support allowJs !! Lots of us, must keep plain-old-javascript and thanks to typescript - jsdoc and google closure now we are able to do type-checking in plain-old javascript :) This adds lots of value currently I'm (and my users) are forced to switch to visual-code-studio or webstorm that do support this. |
There are millions of people waiting for this to be rebased and land. No pressure. :-) |
First attempt/iteration to get typescript support in js files.
With these updates, you would have to switch the grammar of a js file to ts.
ctrl+shift+l