-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Support AMD modules in Salsa #6942
Comments
From @dresoy on February 4, 2016 1:17 I agree, it should search it for JavaScript. |
Please give Salsa our new JS infrastructure a try. Here is how: |
From @justin-romano on February 5, 2016 20:53 Thanks egamma but i could not see it make a difference. Is there some think like lucene indexing the code when you load a folder? |
@justin-romano Then I assume your code isn't using the |
From @justin-romano on February 6, 2016 16:50 No actually anguar and requirejs. On Sun, Feb 7, 2016 at 4:52 AM, Erich Gamma [email protected]
Justin Romaine |
Thanks, got it. Salsa doesn't support AMD yet. I'll move it as a feature request to Salsa component. |
When we looked into this, AMD seemed to be fairly complicated to get right statically, at least compared to CommonJS modules. |
@egamma can you weigh in on the priority of AMD module support? given that ES6 is now ubiquitous, as well as other bundling technologies like browserify and webpack that use CommonJS. |
Why dont you just have a grab everything from everywhere mode. So you don't On Sun, Feb 7, 2016 at 9:57 AM, Mohamed Hegazy [email protected]
Justin Romaine |
@mhegazy I fully agree that this is correct for more recent JS code bases, but there are also code bases with more mileage. I'll try to find out whether there is some data on this. |
Syntax yes, but there is yet to be any real loader or agreement on module resolution! 😄 Which is largely what is holding a lot of things back in my opinion. There are significant issues with CommonJS in the browser, which is exactly why AMD came about to deal with those challenges (and had to split from CommonJS because there couldn't be agreement), to allow asynchronous lazy loading, two pass instantiation, etc. etc. and those advantages and AMD builders like r.js are heavily used by many real life projects in lieu alternatives like Browserify and WebPack. In face, though popularity contests aren't always an indicator, RequireJS out strips Browserify and WebPack and only recently has WebPack overtaken RequireJS. I do agree though, static analysis is challenging for AMD modules, as there are several valid scenarios and because AMD by its nature is two pass instantiation, with circular references and potentially complex configuration information being available to the loader that makes mapping of the MID to the actual file challenging, it wouldn't be a trivial task to accomplish. |
The lack of AMD support makes me unable to use VSCode, unfortunately, since I work on a codebase that is a couple of years old and still uses AMD/RequireJS. I don't really want to use IntelliJ, but it's able to do analysis of my code far more trivially than VSCode is able to... |
I'd like to add that AMD support would be super helpful in VSCode. I'm a Netsuite developer, and it uses AMD syntax. It makes it harder when I can't easily click a definition and go to it when other IDEs like WebStorm can. Instead, I have to do a search all manually. |
I would definitely love to have to this feature. I think there are several legacy codebases out there which would benefit from this feature. |
If you are looking for the support of AMD/CJS JavaScript modules for the "Go to Definition" command (custom definition provider), you can have a look at the VS Code extension "Require Module Support":
It supports RequireJS configuration (paths) to look up and jump to the original location of the selected identifier's definition. |
I'm closing this since the JS ecosystem has largely moved on writing AMD. This is not an area we plan to invest engineering effort in supporting |
From @justin-romano on February 3, 2016 21:56
It just does nothing unless its a local variable.
I would have suspected this would present a list of all possible matching items in the source.
Its almost as if its not even indexing the code. I am working in a source base of millions of lines of JS so it would be nice.
Products like resharper and visual assist do this better.
Copied from original issue: microsoft/vscode#2683
The text was updated successfully, but these errors were encountered: