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

New/renamed files not part of TS project #50329

Closed
tushar-singh opened this issue May 23, 2018 · 4 comments
Closed

New/renamed files not part of TS project #50329

tushar-singh opened this issue May 23, 2018 · 4 comments
Assignees
Labels
info-needed Issue requires more information from poster typescript Typescript support issues

Comments

@tushar-singh
Copy link

tushar-singh commented May 23, 2018

Every time I rename a file or create a new one, I have to restart TS server because my tsconfig.json doesn't apply on that file.
VScode (or typescript, i'm not sure) does not consider the file as part of project

Vscode Version 1.23.0
MacOS 10.13.4
Typescript 2.8.3

Steps to reproduce

  1. Open TS project with tsconfig.json in project root (TS module resolution and custom config working on all files)
  2. create new file/rename existing file
  3. exec "Typescript: Go to project configuration" and you I see the error below

screen shot 2018-05-23 at 1 28 26 pm

If I click "configure tsconfig.json" it opens up my tsconfig.json just fine


I checked TS server log, and this is part relates

Info 1388 [13:25:35.879] -----------------------------------------------
Info 1388 [13:25:35.879] Open files: 
Info 1388 [13:25:35.879] 	FileName: /Volumes/projects/myproject/app/index.ts ProjectRootPath: /Volumes/projects/myproject
Info 1388 [13:25:35.879] 		Projects: /Volumes/projects/myproject/tsconfig.json
Info 1388 [13:25:35.879] 	FileName: /Volumes/projects/myproject/app/renamed.tsx ProjectRootPath: /Volumes/projects/myproject
Info 1388 [13:25:35.879] 		Projects: /dev/null/inferredProject3*

My tsconfig:

{
    "compilerOptions": {
        "target": "esnext",
        "module": "esnext",
        "lib": [
            "es2017",
            "dom"
        ],
        "moduleResolution": "node",
        "jsx": "preserve",
        "baseUrl": "./app",
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "sourceMap": true,
        "noUnusedLocals": true,
        "allowSyntheticDefaultImports": true,
        "noErrorTruncation": true,
        "paths": {
            "*": ["*", "app/*"]
        }
    },
    "typeAcquisition": {
        "enable": true
    },
}

Tried with extensions disabled. Issue persists

Reloading window or restarting ts server fixes this issue. I'm hoping someone has an idea how to fix this or what causes this? I've seen some other issues about this issue but they seem to have been fix and some fixes mentioned in comments don't apply to me (e.g. I do not have a "files" key in mytsconfig)

@vscodebot vscodebot bot added the typescript Typescript support issues label May 23, 2018
@tushar-singh
Copy link
Author

P.S. I tried reducing my config to just this, still getting the issue

{
    "compilerOptions": {
        "target": "esnext",
        "module": "esnext",
        "moduleResolution": "node",
        "baseUrl": ".",
        "paths": {
            "*": ["app/*"]
        }
    },
}

@tushar-singh
Copy link
Author

Telling VSCode to use workspace TS instead of inbuilt apparently fixes this.

screen shot 2018-05-23 at 5 00 02 pm

@mjbvz
Copy link
Collaborator

mjbvz commented May 23, 2018

Do you see this in vscode insiders using TypeScript 2.9?

@mjbvz mjbvz added the info-needed Issue requires more information from poster label May 23, 2018
@tushar-singh
Copy link
Author

Working correctly in 2.9.1-insiders. So looks like this has been fixed
Closing this. Thanks :)

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

2 participants