Skip to content

Commit

Permalink
uses nimble dump for nimdir
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgomez committed May 28, 2024
1 parent 8cc9e61 commit 81deb91
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nimlangserver.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down

0 comments on commit 81deb91

Please sign in to comment.