mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Allow user to set path to ra_lsp_server in vscode settings
This commit is contained in:
parent
8d51b02362
commit
a6e04cfa7f
3 changed files with 13 additions and 1 deletions
|
@ -132,6 +132,13 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"description": "Highlight Rust code (overrides built-in syntax highlighting)"
|
"description": "Highlight Rust code (overrides built-in syntax highlighting)"
|
||||||
},
|
},
|
||||||
|
"ra-lsp.raLspServerPath": {
|
||||||
|
"type": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"default": "ra_lsp_server",
|
||||||
|
"description": "Path to ra_lsp_server executable"
|
||||||
|
},
|
||||||
"ra-lsp.trace.server": {
|
"ra-lsp.trace.server": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"scope": "window",
|
"scope": "window",
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { Server } from './server';
|
||||||
|
|
||||||
export class Config {
|
export class Config {
|
||||||
public highlightingOn = true;
|
public highlightingOn = true;
|
||||||
|
public raLspServerPath = 'ra_lsp_server';
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
vscode.workspace.onDidChangeConfiguration(_ =>
|
vscode.workspace.onDidChangeConfiguration(_ =>
|
||||||
|
@ -21,5 +22,9 @@ export class Config {
|
||||||
if (!this.highlightingOn && Server) {
|
if (!this.highlightingOn && Server) {
|
||||||
Server.highlighter.removeHighlights();
|
Server.highlighter.removeHighlights();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.has('raLspServerPath')) {
|
||||||
|
this.raLspServerPath = config.get('raLspServerPath') as string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ export class Server {
|
||||||
notificationHandlers: Iterable<[string, lc.GenericNotificationHandler]>
|
notificationHandlers: Iterable<[string, lc.GenericNotificationHandler]>
|
||||||
) {
|
) {
|
||||||
const run: lc.Executable = {
|
const run: lc.Executable = {
|
||||||
command: 'ra_lsp_server',
|
command: this.config.raLspServerPath,
|
||||||
options: { cwd: '.' }
|
options: { cwd: '.' }
|
||||||
};
|
};
|
||||||
const serverOptions: lc.ServerOptions = {
|
const serverOptions: lc.ServerOptions = {
|
||||||
|
|
Loading…
Reference in a new issue