Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
ExtensionContext,
IndentAction,
languages,
RelativePattern,
TextEditor,
Uri,
window,
Expand Down Expand Up @@ -193,14 +192,10 @@ class ClientWorkspace {
return this.makeRlsProcess();
};

// FIXME: vscode-languageserver-node internally uses `pattern` here as
// `vscode.GlobPattern` but only types it out as `string` type. We use
// `RelativePattern` to reliably match files relative to a workspace folder
// in a way that's supported in a cross-platform fashion.
const pattern = (new RelativePattern(
this.folder,
'**',
) as unknown) as string;
// This accepts `vscode.GlobPattern` under the hood, which requires only
// forward slashes. It's worth mentioning that RelativePattern does *NOT*
// work in remote scenarios (?), so rely on normalized fs path from VSCode URIs.
const pattern = `${this.folder.uri.fsPath.replace(path.sep, '/')}/**`;

const clientOptions: LanguageClientOptions = {
// Register the server for Rust files
Expand Down