Skip to content

[typescript-language-features] Fix autoImportFileExcludePatterns format to work on Windows - #202762

Merged
Matt Bierner (mjbvz) merged 3 commits into
microsoft:mainfrom
andrewbranch:bug/ts55781
Mar 13, 2024
Merged

Matt Bierner (mjbvz) merged 3 commits into
microsoft:mainfrom
andrewbranch:bug/ts55781

Conversation

@andrewbranch

@andrewbranch Andrew Branch (andrewbranch) commented Jan 18, 2024 •

Copy link
Copy Markdown
Member

Fixes microsoft/TypeScript#56415
Fixes microsoft/TypeScript#55781

Counterpart to microsoft/TypeScript#57090. The TypeScript change mostly fixes things on its own, but this change provides a 99% fix even when using an older TS Server version.

@andrewbranch Andrew Branch (andrewbranch) changed the title Bug/ts55781 [typescript-language-features] Fix autoImportFileExcludePatterns format to work on Windows Jan 18, 2024
// it with a path root (e.g. `/` or `c:\`)
const wildcardPrefix = this.client.apiVersion.gte(API.v540)
? ''
: path.parse(this.client.toTsFilePath(workspaceFolder)!).root;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matt Bierner (@mjbvz) can you help confirm that this non-null assertion is safe here? I looked at the implementation and the only way it can return undefined is

if (fileSchemes.disabledSchemes.has(resource.scheme)) {
  return undefined;
}

I feel like we wouldn’t make it this far if that were the case for the workspace folder, but I’m not confident.

@andrewbranch

Copy link
Copy Markdown
Member Author

Matt Bierner (@mjbvz) I just noticed this is still open. Could you take a look? Thanks!

@mjbvz
Matt Bierner (mjbvz) enabled auto-merge (squash) March 12, 2024 18:49
@vscodenpa VS Code Bot (vscodenpa) added this to the March 2024 milestone Mar 12, 2024
@mjbvz
Matt Bierner (mjbvz) merged commit d1498b3 into microsoft:main Mar 13, 2024
@andrewbranch
Andrew Branch (andrewbranch) deleted the bug/ts55781 branch March 13, 2024 15:43
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

4 participants