From af1390c4e492133a1cb3d73587e178fb18fbede9 Mon Sep 17 00:00:00 2001 From: elijahr Date: Fri, 2 Jun 2023 11:33:22 -0500 Subject: [PATCH 1/3] Fix: find nimsuggest in nim installation directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running `nimble vsix` I was getting this error: > vscode-nim/src/tools/elrpc.nim(6, 18) Error: cannot open file: nimsuggest/sexp This is because nimsuggest is not in the nim installation’s lib directory. These changes explicitly add the nim installation’s root directory to the search path so that nimsuggest can be found when compiling. --- config.nims | 14 ++++++++++++++ nim.cfg | 9 --------- 2 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 config.nims delete mode 100644 nim.cfg diff --git a/config.nims b/config.nims new file mode 100644 index 0000000..d62171e --- /dev/null +++ b/config.nims @@ -0,0 +1,14 @@ +import os + +switch("backend", "js") +switch("outdir", "out") +switch("sourceMap", "on") +switch("path", "src") +switch("define", "nimsuggest") +switch("define", "nodejs") +switch("define", "js") + +# Add nim's installation path to the search paths so that nimsuggest can be found +let nimInstallationDir = absolutePath(splitPath(getCurrentCompilerExe()).head / "..") +if dirExists(nimInstallationDir / "nimsuggest"): + switch("path", nimInstallationDir) diff --git a/nim.cfg b/nim.cfg deleted file mode 100644 index 57e4444..0000000 --- a/nim.cfg +++ /dev/null @@ -1,9 +0,0 @@ ---backend:js ---outdir:out ---sourceMap - ---path:"src/" - -define:nimsuggest -define:nodejs -define:js \ No newline at end of file From 7f1c658682d8c33e17e6f9d86ee628a5e1ace1a3 Mon Sep 17 00:00:00 2001 From: elijahr Date: Fri, 2 Jun 2023 11:42:24 -0500 Subject: [PATCH 2/3] Fix: configuration parse error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I was seeing errors like this in the Nim Language Server output: > DBG Failed to parse the configuration. And symbol lookup wasn’t working well. This seems to have fixed it. --- package.json | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index fc59bc0..3a121f2 100644 --- a/package.json +++ b/package.json @@ -202,15 +202,19 @@ "nim.projectMapping": { "type": "array", "default": [], - "description": "For non project mode list of per file project mapping using regex, for example ```{\"fileRegex\": \"(.*).inim\", \"projectFile\": \"$1.nim\"}```", - "properties": { - "fileRegex": { - "type": "string", - "description": "Source file regex" - }, - "projectFile": { - "type": "string", - "description": "Project file path" + "description": "For non project mode list of per file project mapping using regex, for example ```[{\"fileRegex\": \"(.*).inim\", \"projectFile\": \"$1.nim\"}]```", + "items": { + "type": "object", + "title": "mapping", + "properties": { + "fileRegex": { + "type": "string", + "description": "Source file regex" + }, + "projectFile": { + "type": "string", + "description": "Project file path" + } } }, "scope": "resource" From 5ee624d9ba49c926827300c29007588b31836467 Mon Sep 17 00:00:00 2001 From: elijahr Date: Fri, 2 Jun 2023 11:42:38 -0500 Subject: [PATCH 3/3] Bump: v0.1.27 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3a121f2..700c6f6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nimvscode", "displayName": "Nim", "description": "Nim language support for Visual Studio Code written in Nim", - "version": "0.1.26", + "version": "0.1.27", "publisher": "nimsaem", "author": { "name": "Saem"