[clangd-vscode] Do not customize uri converters in vscode
authorKadir Cetinkaya <kadircet@google.com>
Thu, 23 May 2019 09:58:29 +0000 (09:58 +0000)
committerKadir Cetinkaya <kadircet@google.com>
Thu, 23 May 2019 09:58:29 +0000 (09:58 +0000)
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

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

index 2cb97d97ab70a672c7b84d9a55a3ac9349114893..7b80967151883f726c4e16cb2aa2057b2a5106a5 100644 (file)
@@ -1,6 +1,5 @@
 import * as vscode from 'vscode';
 import * as vscodelc from 'vscode-languageclient';
-import { realpathSync } from 'fs';
 
 /**
  * Method to get workspace configuration option
@@ -87,17 +86,6 @@ export function activate(context: vscode.ExtensionContext) {
             fileEvents: vscode.workspace.createFileSystemWatcher(filePattern)
         },
         initializationOptions: { clangdFileStatus: true },
-        // Resolve symlinks for all files provided by clangd.
-        // This is a workaround for a bazel + clangd issue - bazel produces a symlink tree to build in,
-        // and when navigating to the included file, clangd passes its path inside the symlink tree
-        // rather than its filesystem path.
-        // FIXME: remove this once clangd knows enough about bazel to resolve the
-        // symlinks where needed (or if this causes problems for other workflows).
-        uriConverters: {
-            code2Protocol: (value: vscode.Uri) => value.toString(),
-            protocol2Code: (value: string) =>
-                vscode.Uri.file(realpathSync(vscode.Uri.parse(value).fsPath))
-        },
         // Do not switch to output window when clangd returns output
         revealOutputChannelOn: vscodelc.RevealOutputChannelOn.Never
     };