mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 03:38:29 +00:00
Merge #7194
7194: Don't update the server if managed by the user r=matklad a=lnicola Fixes #7187 CC @figsoda Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
commit
aa9bef0797
@ -167,6 +167,7 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
if (serverPath(config) !== null) return;
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
if (config.package.releaseTag === NIGHTLY_TAG) {
|
if (config.package.releaseTag === NIGHTLY_TAG) {
|
||||||
@ -278,7 +279,7 @@ async function patchelf(dest: PathLike): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getServer(config: Config, state: PersistentState): Promise<string | undefined> {
|
async function getServer(config: Config, state: PersistentState): Promise<string | undefined> {
|
||||||
const explicitPath = process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath;
|
const explicitPath = serverPath(config);
|
||||||
if (explicitPath) {
|
if (explicitPath) {
|
||||||
if (explicitPath.startsWith("~/")) {
|
if (explicitPath.startsWith("~/")) {
|
||||||
return os.homedir() + explicitPath.slice("~".length);
|
return os.homedir() + explicitPath.slice("~".length);
|
||||||
@ -351,6 +352,10 @@ async function getServer(config: Config, state: PersistentState): Promise<string
|
|||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serverPath(config: Config): string | null {
|
||||||
|
return process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath;
|
||||||
|
}
|
||||||
|
|
||||||
async function isNixOs(): Promise<boolean> {
|
async function isNixOs(): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
const contents = await fs.readFile("/etc/os-release");
|
const contents = await fs.readFile("/etc/os-release");
|
||||||
|
Loading…
Reference in New Issue
Block a user