Skip to content

Commit

Permalink
Support use of file paths in uri field of custom configuration (#10470)
Browse files Browse the repository at this point in the history
  • Loading branch information
Colengms committed Feb 4, 2023
1 parent edb810a commit a6f535f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2739,9 +2739,16 @@ export class DefaultClient implements Client {
const sanitized: SourceFileConfigurationItemAdapter[] = [];
configs.forEach(item => {
if (this.isSourceFileConfigurationItem(item, providerVersion)) {
this.configurationLogging.set(item.uri.toString(), JSON.stringify(item.configuration, null, 4));
let uri: string;
if (util.isString(item.uri) && !item.uri.startsWith("file://")) {
// If the uri field is a string, it may actually contain an fsPath.
uri = vscode.Uri.file(item.uri).toString();
} else {
uri = item.uri.toString();
}
this.configurationLogging.set(uri, JSON.stringify(item.configuration, null, 4));
if (settings.loggingLevel === "Debug") {
out.appendLine(` uri: ${item.uri.toString()}`);
out.appendLine(` uri: ${uri}`);
out.appendLine(` config: ${JSON.stringify(item.configuration, null, 2)}`);
}
if (item.configuration.includePath.some(path => path.endsWith('**'))) {
Expand All @@ -2766,7 +2773,7 @@ export class DefaultClient implements Client {
}
}
sanitized.push({
uri: item.uri.toString(),
uri,
configuration: itemConfig
});
} else {
Expand Down

0 comments on commit a6f535f

Please sign in to comment.