mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
parent
2bac1bdf17
commit
d07a85ed7e
1 changed files with 9 additions and 1 deletions
|
@ -1,9 +1,17 @@
|
||||||
|
import { homedir } from 'os';
|
||||||
import * as lc from 'vscode-languageclient';
|
import * as lc from 'vscode-languageclient';
|
||||||
|
|
||||||
import { window, workspace } from 'vscode';
|
import { window, workspace } from 'vscode';
|
||||||
import { Config } from './config';
|
import { Config } from './config';
|
||||||
import { Highlighter } from './highlighting';
|
import { Highlighter } from './highlighting';
|
||||||
|
|
||||||
|
function expandPathResolving(path: string) {
|
||||||
|
if (path.startsWith('~/')) {
|
||||||
|
return path.replace('~', homedir());
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
export class Server {
|
export class Server {
|
||||||
public static highlighter = new Highlighter();
|
public static highlighter = new Highlighter();
|
||||||
public static config = new Config();
|
public static config = new Config();
|
||||||
|
@ -20,7 +28,7 @@ export class Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
const run: lc.Executable = {
|
const run: lc.Executable = {
|
||||||
command: this.config.raLspServerPath,
|
command: expandPathResolving(this.config.raLspServerPath),
|
||||||
options: { cwd: folder }
|
options: { cwd: folder }
|
||||||
};
|
};
|
||||||
const serverOptions: lc.ServerOptions = {
|
const serverOptions: lc.ServerOptions = {
|
||||||
|
|
Loading…
Reference in a new issue