TypeScript: Intellisense does not pickup Typescript 3 references
From @tommedema on August 27, 2018 3:12
- VSCode Version: 1.26.1
- OS Version: OSX High Sierra
Steps to Reproduce:
git clone git@github.com:tommedema/serverless-mono-example.gitcd serverless-mono-example && yarn install && code .- if you change a typing in package
random, it is not picked up by intellisense in typescript packages that reference to it in the same workspace (e.g.sls-random); you’d have to compile first
for example, change fetchRandomNumber in random to return a Promise<string>, and sls-random still expects a Promise<number>
Note that sls-random is connected with random through Typescript 3 references:
{
"extends": "../../tsconfig.settings.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
},
"references": [
{ "path": "../random" }
]
}
And therefore intellisense should pickup the referenced typings dynamically.
Does this issue occur when all extensions are disabled?: Yes
Copied from original issue: Microsoft/vscode#57242
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 33
- Comments: 19 (3 by maintainers)
I would like to bump this issue. We are running into this problem in our monorepo and it’s making development more difficult in particular for newcomers.
I see. But I still have to compile (and re-compile) to get working jump-to-reference in VSCode across project boundaries. Unfortunately, that’s a huge UX problem.
Just poking to ask if there is any progress on this. 🤓
I see it’s labeled as
Awaiting More Feedbackand I’m wondering what kind of feedback would help here? 🤔@wmira That’s the current workaround, at least what my team uses. Ideally vscode would understand types as you change them without the watch running or having to run tsc build (which I believe is the issue outlined by mjvbz).
Is this fixed? Seems like it isn’t and this is the current behaviour:
I’m not quite sure what the proposed fix actually is. Ended up using
pnpmas package manger and its workspaces which helps resolve this issue pretty easily as it symlinks referenced projects to the importing application’s node_modules folder.@wmira I’m confused about your setup. Why are these properties directories that do not exist? Also, this still means that you have to compile the typscript to get references to work. As I understand the issue, this is the main problem, not that references do not work at all.
@mjbvz Any updates? Or a pointer to progress on the behind-the-scenes .d.ts generation process @ajafff? Thanks.
Anything I can do to help this get fixed?
Correct me if I’m wrong, but since vscode relys on TSServer for providing information for intellesence, and the new References feature uses the output .d.ts for each project for typing; the TSServer would have to have a way to bypass the .d.ts files and directly go to the source to determine typings. I would think that this is a TS issue and not only VSCode.
I have a similar problem. Is this a duplicate or is my example different? https://github.com/donaldpipowitch/typescript-refactoring-references