Skip to content
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

Project references are not picked up (2) #80438

Closed
OliverJAsh opened this issue Sep 5, 2019 · 1 comment
Closed

Project references are not picked up (2) #80438

OliverJAsh opened this issue Sep 5, 2019 · 1 comment
Assignees
Labels
typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@OliverJAsh
Copy link
Contributor

OliverJAsh commented Sep 5, 2019

  • VSCode Version: 1.38.0
  • OS Version: 10.14.6
  • TypeScript version: tested with both 3.5.2 and 3.6.2

Steps to Reproduce:

./tsconfig.json:

{
    "references": [
        { "path": "./src/tsconfig.json" },
        { "path": "./shared/tsconfig.json" }
    ],
    "files": []
}

./shared/tsconfig.json:

{
    "compilerOptions": {
        "composite": true,
        "declarationMap": true,
        "outDir": "../target-shared/"
    }
}

./shared/main.ts:

export const foo = 1;

./src/tsconfig.json:

{
    "compilerOptions": {
        "composite": true,
        "declarationMap": true,
        "outDir": "../target-src/"
    },
    "references": [
        { "path": "../shared/tsconfig.json" }
    ]
}

./src/main.ts:

import { foo } from "../shared/main";

foo;
  1. Run tsc --build (observe no errors)
  2. Open VS Code
  3. Navigate immediately to ./shared/main.ts
  4. Find references for foo

Repo including the above test case: https://github.com/OliverJAsh/unsplash-ts-project-references/tree/orthogonal-folders

Expected: reference in ./src/main.ts appears
Actual: reference in ./src/main.ts does not appear

Also, renaming foo in ./shared/main.ts does not propagate the change into ./src/main.ts.

If I'm careful enough to navigate to ./src/main.ts first, and then open ./shared/main.ts afterwards, VS Code is aware that foo is used in both files. However, I don't believe this should be necessary.

When I open ./shared/main.ts, I assume VS Code is stopping at ./shared/tsconfig.json and looking no further. If it looked one level higher, it would find ./tsconfig.json, which references ./src/tsconfig.json, which in turn references ./shared/tsconfig.json.

Does this issue occur when all extensions are disabled?: Yes

Potentially related:

@mjbvz
Copy link
Collaborator

mjbvz commented Sep 9, 2019

This is an upstream TypeScript issue. I believe that microsoft/TypeScript#30823 may track this problem. If you don't feel that covers your case, please open a new issue against TypeScript

@mjbvz mjbvz closed this as completed Sep 9, 2019
@mjbvz mjbvz added typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Sep 9, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants