Skip to content

New/renamed files not part of TS project #50329

@tushar-singh

Description

@tushar-singh

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)

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from postertypescriptTypescript support issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions