Skip to content

TS Server: means to open files in different inferred projects #16961

@mjbvz

Description

@mjbvz

Problem
We are currently working on supporting multi-root workspaces in VSCode. For a multiroot project setup:

first_root
    oak.js
other_root
    willow.js

If a user opens oak.js and willow.js, they are currently put into the same inferred project. This results in globals being shared between the two root workspaces. We need a way to ensure files from each root workspace go into their own inferred projects

Proposal
When opening the files, we already send a projectRootPath property:

[Trace  - 5:08:02 PM] Sending request: open (2). Response expected: no. Current queue length: 6
Arguments: {
    "file": "/Users/matb/projects/first_root/oak.js",
    "fileContent": "var pest = 1;",
    "scriptKindName": "JS",
    "projectRootPath": "/Users/matb/projects/first_root"
}
[Trace  - 5:08:03 PM] Sending request: open (2). Response expected: no. Current queue length: 6
Arguments: {
    "file": "/Users/matb/projects/other_root/willow.js",
    "fileContent": "pest;",
    "scriptKindName": "JS",
    "projectRootPath": "/Users/matb/projects/other_root"
}

To support bucketing files into their own inferred project, we could either use the projectRootPath to differentiate which inferred project a file should go into, or we could add a new property on open to do the same

Metadata

Metadata

Assignees

No one assigned

    Labels

    VS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions