aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/code/package.json10
-rw-r--r--editors/code/src/main.ts7
2 files changed, 15 insertions, 2 deletions
diff --git a/editors/code/package.json b/editors/code/package.json
index 63db87064..3e6ebd7ed 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -349,7 +349,7 @@
349 "default": {}, 349 "default": {},
350 "markdownDescription": "Optional settings passed to the debug engine. Example: `{ \"lldb\": { \"terminal\":\"external\"} }`" 350 "markdownDescription": "Optional settings passed to the debug engine. Example: `{ \"lldb\": { \"terminal\":\"external\"} }`"
351 }, 351 },
352 "rust-analyzer.assist.importMergeBehaviour": { 352 "rust-analyzer.assist.importMergeBehavior": {
353 "markdownDescription": "The strategy to use when inserting new imports or merging imports.", 353 "markdownDescription": "The strategy to use when inserting new imports or merging imports.",
354 "default": "full", 354 "default": "full",
355 "type": "string", 355 "type": "string",
@@ -663,6 +663,14 @@
663 "default": false, 663 "default": false,
664 "type": "boolean" 664 "type": "boolean"
665 }, 665 },
666 "rust-analyzer.procMacro.server": {
667 "markdownDescription": "Internal config, path to proc-macro server executable (typically, this is rust-analyzer itself, but we override this in tests).",
668 "default": null,
669 "type": [
670 "null",
671 "string"
672 ]
673 },
666 "rust-analyzer.runnables.overrideCargo": { 674 "rust-analyzer.runnables.overrideCargo": {
667 "markdownDescription": "Command to be executed instead of 'cargo' for runnables.", 675 "markdownDescription": "Command to be executed instead of 'cargo' for runnables.",
668 "default": null, 676 "default": null,
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 4c132cabe..694da9409 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -167,6 +167,7 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi
167 } 167 }
168 return; 168 return;
169 }; 169 };
170 if (serverPath(config) !== null) return;
170 171
171 const now = Date.now(); 172 const now = Date.now();
172 if (config.package.releaseTag === NIGHTLY_TAG) { 173 if (config.package.releaseTag === NIGHTLY_TAG) {
@@ -278,7 +279,7 @@ async function patchelf(dest: PathLike): Promise<void> {
278} 279}
279 280
280async function getServer(config: Config, state: PersistentState): Promise<string | undefined> { 281async function getServer(config: Config, state: PersistentState): Promise<string | undefined> {
281 const explicitPath = process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath; 282 const explicitPath = serverPath(config);
282 if (explicitPath) { 283 if (explicitPath) {
283 if (explicitPath.startsWith("~/")) { 284 if (explicitPath.startsWith("~/")) {
284 return os.homedir() + explicitPath.slice("~".length); 285 return os.homedir() + explicitPath.slice("~".length);
@@ -351,6 +352,10 @@ async function getServer(config: Config, state: PersistentState): Promise<string
351 return dest; 352 return dest;
352} 353}
353 354
355function serverPath(config: Config): string | null {
356 return process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath;
357}
358
354async function isNixOs(): Promise<boolean> { 359async function isNixOs(): Promise<boolean> {
355 try { 360 try {
356 const contents = await fs.readFile("/etc/os-release"); 361 const contents = await fs.readFile("/etc/os-release");