Skip to content

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

Closed

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

Activity

  1. added
    VS Code Tracked
    on Jul 6, 2017
  2. mjbvz commented on Jul 6, 2017

    @mjbvz
    ContributorAuthor

    We'll also need a way to configure each of these inferred projects independently using the compilerOptionsForInferredProjects command

  3. locked and limited conversation to collaborators on Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    VS Code Tracked

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions