From 81deb91ee04a74c19ba95762b46867f5ca8d1fff Mon Sep 17 00:00:00 2001 From: jmgomez Date: Tue, 28 May 2024 11:49:08 +0100 Subject: [PATCH] uses nimble dump for nimdir --- nimlangserver.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nimlangserver.nim b/nimlangserver.nim index 9d0c4d9..4dbcd74 100644 --- a/nimlangserver.nim +++ b/nimlangserver.nim @@ -677,12 +677,12 @@ proc getNimVersion(nimDir: string): string = proc getNimSuggestPath(ls: LanguageServer, conf: NlsConfig, workingDir: string): string = #Attempting to see if the project is using a custom Nim version, if it's the case this will be slower than usual - let info: string = execProcess("nimble --nimdir ", workingDir) + let info: string = execProcess("nimble dump ", workingDir) var nimDir = "" - const NimDirSplit = "nimdir:" + const NimDirSplit = "nimDir:" for line in info.splitLines: - if NimDirSplit in line: - nimDir = line.split(NimDirSplit)[1].strip() + if line.startsWith(NimDirSplit): + nimDir = line.split(NimDirSplit)[1].strip.strip(chars = {'"', ' '}) result = expandTilde(conf.nimsuggestPath.get("")) var nimVersion = ""