Repository navigation
[rush] Rush's node_modules structure is not resolved in vscode correctly #955
Description
Activity
I'm not able to repro this issue.
Which folder do you open using VS Code? The libraries/ts-command-line folder? Or the root of the repository?
When I type
Colorsit doesn't work, but I think that's expected. Whereas if I typeimport * as colors from 'colors';and thencolors., the IntelliSense works fine.- addedneeds designThe next step is for someone to propose the details of an approach for solving the problemThe next step is for someone to propose the details of an approach for solving the problemneeds more infoWe can't proceed because we need a better repro or an answer to a questionWe can't proceed because we need a better repro or an answer to a questionand removedneeds designThe next step is for someone to propose the details of an approach for solving the problemThe next step is for someone to propose the details of an approach for solving the problem
on Nov 22, 2018 Pete Gonzalez (OLD ALIAS) (@pgonzal)
Seems like you reproduced it nicely! Expected behaviour is that typing
Coloshould prompt an auto-import autocomplete, or an autofix bubble to add the import statement.Colorsis one of the exported types from that library and it shouldn't matter what directory you're in.I mean like so:
const foo: Colors = {}; export { CommandLineAction, ICommandLineActionOptions } from './CommandLineAction';
The issue of crashing I corrected in the OP. Intermittently the TS server appears to crash and restart within the editor, but it's not clear how to reproduce that issue.
Sam J (@nfour) did you try looking at the TS Server log to see if any errors are being reported?
BTW I was able to repro this using
const foo: Color = {};(notColors).Corresponding issue in vscode. https://github.com/Microsoft/vscode/issues/63620#issue-383403610
Great, thanks!
- addedexternal issueThe root cause is with an external component that needs a fix or workaroundThe root cause is with an external component that needs a fix or workaroundand removedneeds more infoWe can't proceed because we need a better repro or an answer to a questionWe can't proceed because we need a better repro or an answer to a question
on Nov 27, 2018 I marked this as external for now, since it appears to be a problem with VS Code (or TypeScript?). But we'll keep this issue open to track it.
Sam J (@nfour) did you try to collect a TS Server log? That might be helpful...
Pete Gonzalez (OLD ALIAS) (@pgonzal) I recall not seeing anything in VSCode's TS Server output panel whenever I had these issues but of course I haven't had it set to
verbose. The developer tools console also didn't show anything out of wack. Nor did trying to profile vscode.I'll check again with
verboseand update if that changes though.Great to see this is reproducible and it's getting some attention!
Reacted by Pete GonzalezI want to give an update:
- [email protected]+ no longer spins noticeable CPU cycles with rush
5.5andpnpm - Auto-import of arbitrary dependencies still does not work - however - those that are rush linked do indeed show up in import suggestions
- [email protected]+ no longer spins noticeable CPU cycles with rush
halfnibble commented
on Jun 21, 2019 ContributorMore actionsBased off of the last comment here, I think we may need to work with the VSCode team.
microsoft/TypeScript#28689 (comment)Any update for this ?
Quick update: Webstorm solve correctly import :)
This issue is stale at this point and microsoft/TypeScript#28689 (comment) is closed. If this is still a problem, please consider opening a new issue
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsClosed
First up, I'm not sure if this is the right place for this report, but it's likely going to be relevant to the contributers here.
Problem
My team has run into a curious issue with rush's node module structure and vscode.
When trying to auto-import node modules within a project, intellisense will not locate dependencies.
This also results in the editor's TS server crashing intermittently.
Reproduction
Rush setups tested:
You can replicate this issue within
web-build-toolsitself.Open https://github.com/Microsoft/web-build-tools/blob/master/libraries/ts-command-line/src/index.ts
And type
Colorsin the top level (from thecolorsmodule). You shouldn't be able to resolve the symbol.eg.
Workaround
If you execute the below script to replace symlinks with real files:
Everything should work as expected.