Skip to content

Renaming a file results in mis-identifying the right sconfig file #2133

@lukpsaxo

Description

@lukpsaxo

Extension Version

0.20251119.1

VS Code Version

1.106.0

Operating system Version

Windows 11

Steps to reproduce

I have a folder with a tsconfig file in it
/src/path/integration/tsconfig.json
this just extends /src/path/tsconfig.cypress.json....

{
    // VSCode doesn't support multiple config files at the same level so we need a file
    // like this in every integration folder https://github.com/microsoft/vscode/issues/12463
    "extends": "../../../tsconfig.cypress.json"
}

the tsconfig.cypress.json looks like this:

    "extends": "../../tools/ts-configs/tsconfig.cypress.json",
    "compilerOptions": {},
    "include": [
        "./**/integration/**/*",
        "../../cypress/support/global.d.ts",
        "../../cypress/support/shared.d.ts",
        "../../node_modules/cypress/types/"
    ],
    "exclude": ["./**/*.play.ts", "./**/*.play.extended.ts"]
  1. I open /src/path/integration/file.spec.ts
  2. I rename in vscode it to /src/path/integration/file2.spec.ts

Issue

lots of errors appear. These errors happen when the file is using the tsconfig from the base folder, instead of the tsconfig file in the folder of the renamed file (the extra include in the tsconfig provides globals used in the file).

When I close the file and re-open it, I thought it fixed it but I just retsted and the errors persisted, Restarting tsgo extension definitely does . Will add logs separately

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: EditorRelated to the LSP server, editor experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions