@@ -5,30 +5,6 @@ import { Config } from './config';
55import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed' ;
66import { SemanticTokensFeature , DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed' ;
77
8- export function configToServerOptions ( config : Config ) {
9- return {
10- lruCapacity : config . lruCapacity ,
11-
12- inlayHintsType : config . inlayHints . typeHints ,
13- inlayHintsParameter : config . inlayHints . parameterHints ,
14- inlayHintsChaining : config . inlayHints . chainingHints ,
15- inlayHintsMaxLength : config . inlayHints . maxLength ,
16-
17- cargoWatchEnable : config . cargoWatchOptions . enable ,
18- cargoWatchArgs : config . cargoWatchOptions . arguments ,
19- cargoWatchCommand : config . cargoWatchOptions . command ,
20- cargoWatchAllTargets : config . cargoWatchOptions . allTargets ,
21-
22- excludeGlobs : config . excludeGlobs ,
23- useClientWatching : config . useClientWatching ,
24- featureFlags : config . featureFlags ,
25- withSysroot : config . withSysroot ,
26- cargoFeatures : config . cargoFeatures ,
27- rustfmtArgs : config . rustfmtArgs ,
28- vscodeLldb : vscode . extensions . getExtension ( "vadimcn.vscode-lldb" ) != null ,
29- } ;
30- }
31-
328export async function createClient ( config : Config , serverPath : string , cwd : string ) : Promise < lc . LanguageClient > {
339 // '.' Is the fallback if no folder is open
3410 // TODO?: Workspace folders support Uri's (eg: file://test.txt).
@@ -48,7 +24,7 @@ export async function createClient(config: Config, serverPath: string, cwd: stri
4824
4925 const clientOptions : lc . LanguageClientOptions = {
5026 documentSelector : [ { scheme : 'file' , language : 'rust' } ] ,
51- initializationOptions : configToServerOptions ( config ) ,
27+ initializationOptions : vscode . workspace . getConfiguration ( "rust-analyzer" ) ,
5228 traceOutputChannel,
5329 middleware : {
5430 // Workaround for https://github.com/microsoft/vscode-languageserver-node/issues/576
0 commit comments