Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Jan 18, 2024

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 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
Member Author

Choose a reason for hiding this comment

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

@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
Member Author

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

@mjbvz mjbvz enabled auto-merge (squash) March 12, 2024 18:49
@VSCodeTriageBot VSCodeTriageBot added this to the March 2024 milestone Mar 12, 2024
@mjbvz mjbvz merged commit d1498b3 into microsoft:main Mar 13, 2024
6 checks passed
@andrewbranch andrewbranch deleted the bug/ts55781 branch March 13, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants