-
Notifications
You must be signed in to change notification settings - Fork 48
Most features do not work in JS files with non-standard extensions #42
Comments
Just checking, you added the extensions in your config.cson? http://flight-manual.atom.io/using-atom/sections/basic-customization/#customizing-language-recognition |
It's worth a try although given the typescript server is going to chose typescript for .ts and javascript for .js I have no idea what it's going to make of .es files |
I understand this is likely a problem in the language server itself, however if someone more knowledgeable were to try to dig deeper into this I have managed to capture an error which seems to indicate that the language server is refusing to "locate" the currently-worked-on file when triggering datatips with the following error:
which seems to further indicate that the language server is not considering non-.js files at all. I know not where to go next to troubleshoot this - any advice is much appreciated! The whole error object caught: {
"message":"Unknown text document file:///Users/BeBe/Dropbox/Repositories/strv/iooi-api/src/actions/emails/index.mjs",
"code":-32001,
"data":{}
} |
Does that file exist on disk? What language is it written in? |
Yes, the file definitely exists - it is the current file opened in the editor - I double-checked the path and it's a match. The extension is |
We're at the mercy of the Typescript server here. Unless microsoft/TypeScript#15416 changes position ide-typescript is only ever going to work with .js files. The only other option would be to create an ide-javascript package based on a pure Javascript language server. Alas no such thing exists right now and it is a large undertaking even basing it on esprima or babel's babylon ast parser. |
I'm going to close this issue as there's nothing we can do unless Microsoft's position on this changes or somebody makes a javascript language server. |
Good find on that issue! Thanks for pointing that out - I'll go bash on Microsoft's door 😡. |
In my project, I use a different file extension (
.es
) than the standard.js
for JavaScript files (these files are compiled with Babel into the same folder to.js
files).In these
.es
files, none of the IDE functionality seems to work except for the diagnostics:When opening the compiled
.js
file, all of these features work as expected, therefore I have come to conclusion that the cause must be related to the non-stnandard file extension.I have also checked that the scope of the file is either
source.js
orsource.js.jsx
.I should note that I am experiencing the same problem with the
.mjs
file extension which the Node.js community has decided to use for JavaScript ES Module files. Now that Node.js 8.5 includes experimental ES modules loader we can expect more and more people experiencing this problem.Thank you for looking in this issue! Let me know if I can provide further information for troubleshooting/testing or help in other ways.
The text was updated successfully, but these errors were encountered: