Skip to content

Commit b970fd7

Browse files
committed
[clangd-vscode] Do not customize uri converters in vscode
Summary: Clangd is already resolving symlinks on the server side, therefore there is no more need to handle it in client side. This was also resulting in breakages whenever index contained a symbol coming from a non-existent file(like a generated file), e.g. during workspace symbols whole response was dropped since stat had failed. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62288 llvm-svn: 361475
1 parent 7f7d2b2 commit b970fd7

File tree

1 file changed

+0
-12
lines changed
  • clang-tools-extra/clangd/clients/clangd-vscode/src

1 file changed

+0
-12
lines changed

clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as vscode from 'vscode';
22
import * as vscodelc from 'vscode-languageclient';
3-
import { realpathSync } from 'fs';
43

54
/**
65
* Method to get workspace configuration option
@@ -87,17 +86,6 @@ export function activate(context: vscode.ExtensionContext) {
8786
fileEvents: vscode.workspace.createFileSystemWatcher(filePattern)
8887
},
8988
initializationOptions: { clangdFileStatus: true },
90-
// Resolve symlinks for all files provided by clangd.
91-
// This is a workaround for a bazel + clangd issue - bazel produces a symlink tree to build in,
92-
// and when navigating to the included file, clangd passes its path inside the symlink tree
93-
// rather than its filesystem path.
94-
// FIXME: remove this once clangd knows enough about bazel to resolve the
95-
// symlinks where needed (or if this causes problems for other workflows).
96-
uriConverters: {
97-
code2Protocol: (value: vscode.Uri) => value.toString(),
98-
protocol2Code: (value: string) =>
99-
vscode.Uri.file(realpathSync(vscode.Uri.parse(value).fsPath))
100-
},
10189
// Do not switch to output window when clangd returns output
10290
revealOutputChannelOn: vscodelc.RevealOutputChannelOn.Never
10391
};

0 commit comments

Comments
 (0)