Code Monkey home page Code Monkey logo

vscode-nim's Introduction

Nim Extension

This extension adds language support for the Nim language to VS Code, including:

  • Syntax Highlight (nim, nimble, nim.cfg)
  • Code Completion
  • Signature Help
  • Goto Definition
  • Find References
  • File outline
  • Build-on-save
  • Workspace symbol search
  • Quick info
  • Problem Matchers for nim compiler and test output
  • Nim check result reported in Nim output channel (great for macro development) output channel demo

Using

First, you will need to install Visual Studio Code 1.27.0 or higher. In the command palette (cmd-shift-p) select Install Extension and choose nim-lang.org.

The following tools are required for the extension:

Note: It is recommended to turn Auto Save on in Visual Studio Code (File -> Auto Save) when using this extension.

Options

The following Visual Studio Code settings are available for the Nim extension. These can be set in user preferences (cmd+,) or workspace settings (.vscode/settings.json).

  • nim.buildOnSave - perform build task from tasks.json file, to use this options you need declare build task according to Tasks Documentation, for example:

    {
        "taskName": "Run module.nim",
        "command": "nim",
        "args": ["c", "-o:bin/${fileBasenameNoExtension}", "-r", "${fileBasename}"],
        "options": {
            "cwd": "${workspaceRoot}"
        },
        "type": "shell",
        "group": {
            "kind": "build",
            "isDefault": true
        }
    }
  • nim.lintOnSave - perform the project check for errors on save

  • nim.project - optional array of projects file, if nim.project is not defined then all nim files will be used as separate project

  • nim.licenseString - optional license text that will be inserted on nim file creation

Example

{
    "nim.buildOnSave": false,
    "nim.buildCommand": "c",
    "nim.lintOnSave": true,
    "nim.project": ["project.nim", "project2.nim"],
    "nim.licenseString": "# Copyright 2020.\n\n"
}

Commands

The following commands are provided by the extension:

  • Nim: Run selected file - compile and run selected file, it uses c compiler by default, but you can specify cpp in nim.buildCommand config parameter. This command available from file context menu or by F6 keyboard shortcut.

  • Nim: Restart nimsuggest - restart nimsuggest process when using nimsuggest.


Debugging

Visual Studio Code includes a powerful debugging system, and the Nim tooling can take advantage of that. However, in order to do so, some setup is required.

Setting up

First, install a debugging extension, such as CodeLLDB, and any native packages the extension may require (such as clang and LLDB).

Next, you need to create a tasks.json file for your project, under the .vscode directory of your project root. Here is an example for CodeLLDB:

// .vscode/tasks.json
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "nim: build current file (for debugging)",
            "command": "nim",
            "args": [
                "compile",
                "-g",
                "--debugger:native",
                "-o:${workspaceRoot}/bin/${fileBasenameNoExtension}",
                "${relativeFile}"
            ],
            "options": {
                "cwd": "${workspaceRoot}"
            },
            "type": "shell",
        }
    ]
}

Then, you need to create a launch configuration in the project's launch.json file. Again, this example works with CodeLLDB:

// .vscode/launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "name": "nim: debug current file",
            "preLaunchTask": "nim: build current file (for debugging)",
            "program": "${workspaceFolder}/bin/${fileBasenameNoExtension}",
            "args": [],
            "cwd": "${workspaceFolder}",
        }
    ]
}

You should be set up now to be able to debug from a given file in the native VS Code(ium) debugger.

Debugger preview screenshot


Code Completion

This extension relies on the Nim Language Server for code completion. You can read more about it here


Developing the Extension

  • If this is the first time you're building the extension on your machine, do an npm install to get the dependencies
  • You should also copy (or create a symlink to) the nimsuggest directory from the Nim compiler sources into src/nimsuggest
  • Press F5 or whatever your Run -> Start Debugging command short cut is
  • If prompted choose launch Extension
  • This launches a new VS Code Window which is running your patched extension
  • You can open a Nim code base to try it out
    • If you want to try it out on the extension source itself, create a new workspace and add the source as a folder to the workspace so VS Code doesn't take you back to the development window

Alternatively, feel free to give side-loading a shot.

Side-loading the Extension

  • Run nimble vsix to build the extension package to out/nimvscode-<version>.vsix
  • Run nimble install_vsix if you have VS Code on PATH, otherwise select Install from VSIX from the command palette (cmd-shift-p) and choose out/nimvscode-<version>.vsix.

Acknowledgments

This extension started out as a fork of the @saem extension vscode-nim which was a port of an extension written in TypeScript for the Nim language.

Thank you Saem for your work and letting us build on top of it.

Roadmap

The roadmap is located here

ChangeLog

ChangeLog is located here

vscode-nim's People

Contributors

saem avatar kosz78 avatar jmgomez avatar rsduck avatar morganholly avatar nickysn avatar yardanico avatar onelivesleft avatar gulpf avatar quantimnot avatar oderwat avatar dependabot[bot] avatar yyoncho avatar wolf99 avatar technicallyagd avatar ringabout avatar dscottboggs avatar tronic avatar elijahr avatar shunf4 avatar nimon-2ac avatar mrsekut avatar konradmb avatar geekrelief avatar exelotl avatar dpuyosa avatar aguspiza avatar yglukhov avatar vfcp avatar stromberg90 avatar

Stargazers

 avatar dh avatar Hamid Bluri avatar  avatar Teroy Goph avatar Cletus Igwe avatar Firas Khalil Khana avatar tiramisu-feliz avatar  avatar Bjorn Madsen avatar  avatar Huy Doan avatar Felix F Xu avatar Alvaro Revuelta avatar  avatar José Paulo avatar kcvinu avatar CaKrome avatar Yeyo avatar Nahuel Piguillem avatar Sultan Al Isaiee avatar Daniel Sokil avatar  avatar kaiuri avatar Kevin Matthes avatar  avatar  avatar Jazz avatar Hoang Phan avatar  avatar Miqueas avatar Fila avatar Nico avatar Firegem avatar Adam M avatar Mamy Ratsimbazafy avatar  avatar Zack Guard avatar RickBarretto avatar Pradeep Gowda avatar Volodymyr Melnychuk avatar Cristian Camilo Ruiz avatar Alessandro avatar Jaremy Creechley avatar Christopher Arndt avatar Angel Ezquerra avatar Gabben avatar  avatar  avatar David Krause avatar kunitoki avatar Regis Caillaud avatar  avatar  avatar

Watchers

 avatar Andreas Rumpf avatar James Cloos avatar Jacek Sieka avatar  avatar  avatar

vscode-nim's Issues

Binary named 'nim' not found in PATH environment variable, even when nim exists in PATH

This extension suffers from the same problem as saem/vscode-nim#136.

I have nim and nimlangserver downloaded and placed somewhere in ~/Documents. Symlinks to those executables are then placed in ~/.local/share/bin, which exists in PATH.

/home/mikolaj/.local/share/bin/ is added to the path in $HOME/.zshrc; which would normally not be visible to programs launched from a DE. However, VS Code sources .zshrc so this should not be a problem. Other extensions happily work which this configuration - my .zshrc also sets GOPATH, which is automatically picked up by the official Go extension.

Some part of this extension must incorrectly inherit the environment from VS Code.

Plugin stops detecting compiler flags after changing source files

Here's a small example

include prelude

type GraphNode[T] = ref object
  value: T
  neighbors: seq[GraphNode[T]]

iterator items[T](graphNode: GraphNode[T]): GraphNode[T] =
  var
    s = @[graphNode]
    seen = initHashSet[GraphNode[T]]()
    curr: GraphNode[T]
  while s.len > 0:
    curr = s.pop
    yield curr
    seen.incl curr
    for e in curr.neighbors:
      if e notin seen:
        s.add e

let nodes = GraphNode[int](value: 1, neighbors: @[GraphNode[int](value: 2, neighbors: @[])])

for i in nodes:
  echo i.value

compile with -d:nimPreviewHashRef

Restarting vscode and building on save. The code compiles and runs, there are no problems highlighted:
Screenshot 2024-03-22 at 8 56 27 AM

Add a few newlines to the end and build & run again. The code compiles and runs fine, but the plugin shows problems:

Screenshot 2024-03-22 at 8 57 01 AM

This greatly limits the plugin's usefulness.


extension: v0.9.0
vscode: 1.87.2
nim: 2.0.2

Starting the extension is a hit-and-miss operation

Sometime when I launch my project in VS Code I receive no language support. If I stop it and start it again, it sometimes works. It even seems like letting VS Code rest for a while helps. Cannot really figure out what is wrong, so any assistance is appreciated.

This is for the latest version of VS Code, running with the latest version of this plugin on Debian Bullseye (AMD64).

Have this in my exthost.log:

2024-02-26 12:36:45.923 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2024-02-26 12:36:45.926 [info] ExtensionService#_doActivateExtension NimLang.nimlang, startup: false, activationEvent: 'onLanguage:nim'
2024-02-26 12:36:46.038 [error] Activating extension NimLang.nimlang failed due to an error:
2024-02-26 12:36:46.038 [error] TypeError: Cannot read properties of undefined (reading 'has')
	at isSome_2063598084 (/home/janf/.vscode/extensions/nimlang.nimlang-0.9.0/out/nimvscode.js:15418:41)
	at getLatestReleasedLspVersion_2063597794 (/home/janf/.vscode/extensions/nimlang.nimlang-0.9.0/out/nimvscode.js:15565:21)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async startLanguageServer_2063598370 (/home/janf/.vscode/extensions/nimlang.nimlang-0.9.0/out/nimvscode.js:15893:39)
	at async activate_536871932 (/home/janf/.vscode/extensions/nimlang.nimlang-0.9.0/out/nimvscode.js:17433:6)
	at async c.n (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:140:6256)
	at async c.m (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:140:6219)
	at async c.l (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:140:5676)

Autocomplete is wrong

Autocomplete suggest bottom enum value, which is wrong, the function argument has different type.

Screen Shot 2024-05-24 at 8 34 51 pm

The code

type
  Align = enum top, right, bottom, left
  Direction = enum up, right, down, left

proc move(d: Direction) =
  echo d

move(b)

Bundle or improve the nimlangserver installation

Currently, the VS Code extension searches for nimlangserver in the PATH and if it doesn't find it, it attempts to install it via nimble install nimlangserver --accept. There are two potential problems with this:

  1. if nimble install fails, the feedback to the user is not very helpful. We should probably provide some troubleshooting info, so the user can resolve the problem.
  2. once installed this way, nimlangserver is never updated. There needs to be a way to check if there's a new version available and either autoupdate it, or inform the user about the new version.

An alternative approach that we could try is to bundle a nimlangserver binary with the VS Code extension itself. This way, when a new version of nimlangserver is released, we can issue an updated VS Code extension in the marketplace. The downside to this approach is that we need to bundle a binary for each supported platform (i.e. at least Linux, Windows, macOS for x86_64/aarch64, maybe also i386 and arm?) This will make it difficult to build the VSIX installer package on a single platform, because it would require setting up a crosscompiler environment, or manual work (e.g. building the binaries on different computers/operating systems and collecting the binaries).

Add a setting to select the amount of notifications that the extension shows

At the moment the extension is a bit "chatty", i.e. it shows a lot notifications (e.g. to indicate that it started parsing a file, that there was an error and it restarted the LSP, etc). It would be nice to have a way to select either the level of notifications or alternatively to enable of disable certain notifications.

Server process exited with signal SIGSEGV

vscode-nim behaves strangely, gives errors, nimsuggest does not terminate after exit.

DBG Router: dispatching                        method=initialize id=0
DBG Initialize received...                    
DBG Router: sending response                   method=initialize id=0
DBG Router: dispatching                        method=initialized id=null
DBG Client initialized.                       
DBG Requesting configuration from the client  
DBG Router: dispatching                        method=textDocument/didOpen id=null
DBG New document opened for URI:               uri=file:///home/doaxan/Projects/Nim/main.nim
DBG Received the following configuration       configuration="[{\"project\":[],\"projectMapping\":[],\"test-project\":\"\",\"buildOnSave\":false,\"buildCommand\":\"c\",\"runOutputDirectory\":\"\",\"lintOnSave\":true,\"enableNimsuggest\":false,\"provider\":\"lsp\",\"useNimsuggestCheck\":false,\"logNimsuggest\":false,\"licenseString\":\"\",\"nimsuggestRestartTimeout\":60,\"nimprettyIndent\":0,\"nimprettyMaxLineLen\":80}]"
DBG getProjectFile                             project=/home/doaxan/Projects/Nim/main.nim
DBG Document associated with the following projectFile uri=file:///home/doaxan/Projects/Nim/main.nim projectFile=/home/doaxan/Projects/Nim/main.nim
INF Starting nimsuggest                        root=/home/doaxan/Projects/Nim/main.nim timeout=120000 path=nimsuggest fullPath=/home/doaxan/.nimble/bin/nimsuggest workingDir=/home/doaxan/Projects/Nim
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
[Error - 1:03:23 AM] Server process exited with signal SIGSEGV.
[Info  - 1:03:23 AM] Connection to server got closed. Server will restart.
true
DBG Router: dispatching                        method=initialize id=0
DBG Initialize received...                    
DBG Router: sending response                   method=initialize id=0
DBG Router: dispatching                        method=initialized id=null
DBG Client initialized.                       
DBG Requesting configuration from the client  
DBG Router: dispatching                        method=textDocument/didOpen id=null
DBG New document opened for URI:               uri=file:///home/doaxan/Projects/Nim/main.nim
DBG Received the following configuration       configuration="[{\"project\":[],\"projectMapping\":[],\"test-project\":\"\",\"buildOnSave\":false,\"buildCommand\":\"c\",\"runOutputDirectory\":\"\",\"lintOnSave\":true,\"enableNimsuggest\":false,\"provider\":\"lsp\",\"useNimsuggestCheck\":false,\"logNimsuggest\":false,\"licenseString\":\"\",\"nimsuggestRestartTimeout\":60,\"nimprettyIndent\":0,\"nimprettyMaxLineLen\":80}]"
DBG getProjectFile                             project=/home/doaxan/Projects/Nim/main.nim
DBG Document associated with the following projectFile uri=file:///home/doaxan/Projects/Nim/main.nim projectFile=/home/doaxan/Projects/Nim/main.nim
INF Starting nimsuggest                        root=/home/doaxan/Projects/Nim/main.nim timeout=120000 path=nimsuggest fullPath=/home/doaxan/.nimble/bin/nimsuggest workingDir=/home/doaxan/Projects/Nim
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
[Error - 1:03:23 AM] Server process exited with signal SIGSEGV.
[Info  - 1:03:23 AM] Connection to server got closed. Server will restart.
true
DBG Router: dispatching                        method=initialize id=0
DBG Initialize received...                    
DBG Router: sending response                   method=initialize id=0
DBG Router: dispatching                        method=initialized id=null
DBG Client initialized.                       
DBG Requesting configuration from the client  
DBG Router: dispatching                        method=textDocument/didOpen id=null
DBG New document opened for URI:               uri=file:///home/doaxan/Projects/Nim/main.nim
DBG Received the following configuration       configuration="[{\"project\":[],\"projectMapping\":[],\"test-project\":\"\",\"buildOnSave\":false,\"buildCommand\":\"c\",\"runOutputDirectory\":\"\",\"lintOnSave\":true,\"enableNimsuggest\":false,\"provider\":\"lsp\",\"useNimsuggestCheck\":false,\"logNimsuggest\":false,\"licenseString\":\"\",\"nimsuggestRestartTimeout\":60,\"nimprettyIndent\":0,\"nimprettyMaxLineLen\":80}]"
DBG getProjectFile                             project=/home/doaxan/Projects/Nim/main.nim
DBG Document associated with the following projectFile uri=file:///home/doaxan/Projects/Nim/main.nim projectFile=/home/doaxan/Projects/Nim/main.nim
INF Starting nimsuggest                        root=/home/doaxan/Projects/Nim/main.nim timeout=120000 path=nimsuggest fullPath=/home/doaxan/.nimble/bin/nimsuggest workingDir=/home/doaxan/Projects/Nim
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
[Error - 1:03:24 AM] Server process exited with signal SIGSEGV.
[Info  - 1:03:24 AM] Connection to server got closed. Server will restart.
true
DBG Router: dispatching                        method=initialize id=0
DBG Initialize received...                    
DBG Router: sending response                   method=initialize id=0
DBG Router: dispatching                        method=initialized id=null
DBG Client initialized.                       
DBG Requesting configuration from the client  
DBG Router: dispatching                        method=textDocument/didOpen id=null
DBG New document opened for URI:               uri=file:///home/doaxan/Projects/Nim/main.nim
DBG Received the following configuration       configuration="[{\"project\":[],\"projectMapping\":[],\"test-project\":\"\",\"buildOnSave\":false,\"buildCommand\":\"c\",\"runOutputDirectory\":\"\",\"lintOnSave\":true,\"enableNimsuggest\":false,\"provider\":\"lsp\",\"useNimsuggestCheck\":false,\"logNimsuggest\":false,\"licenseString\":\"\",\"nimsuggestRestartTimeout\":60,\"nimprettyIndent\":0,\"nimprettyMaxLineLen\":80}]"
DBG getProjectFile                             project=/home/doaxan/Projects/Nim/main.nim
DBG Document associated with the following projectFile uri=file:///home/doaxan/Projects/Nim/main.nim projectFile=/home/doaxan/Projects/Nim/main.nim
INF Starting nimsuggest                        root=/home/doaxan/Projects/Nim/main.nim timeout=120000 path=nimsuggest fullPath=/home/doaxan/.nimble/bin/nimsuggest workingDir=/home/doaxan/Projects/Nim
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
[Error - 1:03:24 AM] Server process exited with signal SIGSEGV.
[Info  - 1:03:24 AM] Connection to server got closed. Server will restart.
true
DBG Router: dispatching                        method=initialize id=0
DBG Initialize received...                    
DBG Router: sending response                   method=initialize id=0
DBG Router: dispatching                        method=initialized id=null
DBG Client initialized.                       
DBG Requesting configuration from the client  
DBG Router: dispatching                        method=textDocument/didOpen id=null
DBG New document opened for URI:               uri=file:///home/doaxan/Projects/Nim/main.nim
DBG Received the following configuration       configuration="[{\"project\":[],\"projectMapping\":[],\"test-project\":\"\",\"buildOnSave\":false,\"buildCommand\":\"c\",\"runOutputDirectory\":\"\",\"lintOnSave\":true,\"enableNimsuggest\":false,\"provider\":\"lsp\",\"useNimsuggestCheck\":false,\"logNimsuggest\":false,\"licenseString\":\"\",\"nimsuggestRestartTimeout\":60,\"nimprettyIndent\":0,\"nimprettyMaxLineLen\":80}]"
DBG getProjectFile                             project=/home/doaxan/Projects/Nim/main.nim
DBG Document associated with the following projectFile uri=file:///home/doaxan/Projects/Nim/main.nim projectFile=/home/doaxan/Projects/Nim/main.nim
INF Starting nimsuggest                        root=/home/doaxan/Projects/Nim/main.nim timeout=120000 path=nimsuggest fullPath=/home/doaxan/.nimble/bin/nimsuggest workingDir=/home/doaxan/Projects/Nim
DBG Router: dispatching                        method=textDocument/documentSymbol id=1
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
[Error - 1:03:25 AM] Server process exited with signal SIGSEGV.
[Error - 1:03:25 AM] The Nim Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

image

`nimsuggest` executed on files not declared into `nim.project` or `nim.projectMapping`

TL;DR; These two functions are fighting each other
https://github.com/nim-lang/langserver/blob/3eb83dabfba18f079fca72f1b72199f01beb13b5/nimlangserver.nim#L139

proc processConfig*(conf: VscodeWorkspaceConfiguration): void =


I have foo.nimble with line bin = @["bar"]
Both src/foo.nim and src/bar.nim exist
.vscode/settings.json is:

{
    "nim.project": [
        "src/bar.nim"
    ]
}

When vscode is launched, nimsuggest is executed only on src/foo.nim and warning is raised for src/bar.nim:

/home/arkanoid/nim/example/src/bar.nim is not compiled as part of project /home/arkanoid/nim/example/src/foo.nim. In orde to get the IDE features working you must either configure nim.projectMapping or import the module.

I can clearly see that the settings.json file is read into the DBG Received the following configuration debug terminal.

basically getProjectFileAutoGuess overwrites user preference in settings.json

syntax highlighting fails on an emit pragma after a nim symbol

I'm using this emit pragma and syntax colorization is failing. It loses track of what is enclosed in quotes and renders everything after the pragma colorized as if it is a string (in the quotes).

proc foo(fieldVal: int, bitOffset: int, bitWidth: int) =
  {.emit: ["asm (\"bfi %0, %1, %2, %3\"\n\t: \"+r\" (", result, ")\n\t: \"r\" (", fieldVal, "), \"n\" (", bitOffset, "), \"n\" (", bitWidth, "));\n"].}

Nim VS code attach to process

I am using vscode as an ide for NIM. How to attach to running process in vscode for NIM.

Here is my vscode configuration. Is this correct ..? I am not able to attach to running process
``

{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "attach",
"name": "Attach",
"pid": "${command:pickProcess}", // use ${command:pickProcess} to pick other users' processes
"program": "${workspaceFolder}/bin/${fileBasenameNoExtension}.exe",
"stopOnEntry" : true,
}
]
}
``

Publish Vscode-Nim on OpenVSX

Was asked to make an issue requesting this package to be listed on OpenVSX so it could be kept track of.

I want this since I use Code OSS instead of the official VSC program, and others may do the same.

Let's get rid of the direct nimsuggest integration (i.e. support only nimlangserver)

Rationale:

  1. Removing the direct nimsuggest integration makes the VS code extension easier to maintain. Its functionality is redundant and the code is very Visual Studio Code-specific, while nimlangserver implements the same features in a way that is standardized in the LSP protocol and easier to integrate with other IDEs. It makes no sense to continue maintaining the nimsuggest backend (which contains lots of code), when VS Code offers an LSP client as well.
  2. Using nimlangserver offers extra functionality (like inlay hints). The ability to use nimsuggest directly hides this functionality from the user.
  3. The direct nimsuggest integration makes compilation of the extension more difficult and dependant on a specific nimsuggest version (as it requires copying files from the nimsuggest directory from the Nim compiler sources). In comparison, nimlangserver is capable of using multiple nimsuggest versions (it has nimsuggest version detection now).

nim-lang.org extension v0.9.0 fails activation

nim-lang.org v0.9.0 fails activation

Under the "Runtime Status" tab of the extension I see the following errors:

Uncaught Errors (9)
Pending response rejected since connection got disposed
Client is not running and can't be stopped. It's current state is: starting
Client is not running and can't be stopped. It's current state is: startFailed
write EPIPE
Client is not running and can't be stopped. It's current state is: startFailed
Cannot call write after a stream was destroyed
Client is not running and can't be stopped. It's current state is: starting
write EPIPE
Client is not running and can't be stopped. It's current state is: starting

My system information:

% lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 23.10
Release:	23.10
Codename:	mantic

% uname -a
Linux smudge 6.5.0-17-generic #17-Ubuntu SMP PREEMPT_DYNAMIC Thu Jan 11 14:01:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

% nim -v 
Nim Compiler Version 2.0.2 [Linux: amd64]
Compiled at 2023-12-15
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: c4c44d10df8a14204a75c34e499def200589cb7c
active boot switches: -d:release

% nimble -v
nimble v0.14.2 compiled at 2023-12-15 01:05:41

% nimble install nimlangserver
Downloading https://github.com/nim-lang/langserver using git
 Installing [email protected]
  Warning:  A package "[email protected]" with checksum "95de85fae4485dcd850ada31e200d15671a00c4a" already exists the the cache.

Question: How should I tell the extension that my project uses the Javascript backend?

I have a JS project that I'd like to develop using the vscode-nim extension.

When I load the project, I get numerous errors when I import karax modules such as,

[{
	"resource": "/home/boisvert/.choosenim/toolchains/nim-2.0.2/lib/js/dom.nim",
	"owner": "nim",
	"severity": 8,
	"message": "This module only works on the JavaScript platform",
	"startLineNumber": 45,
	"startColumn": 10,
	"endLineNumber": 45,
	"endColumn": 10
}]

I tried setting nim.buildCommand' in my settings.json`:

    "nim.buildCommand": "js",

but that didn't help.

What's the right way to tell the extension that it should use the JS backend when compiling/linting?

Publish the extension in the VS Code marketplace

  1. We should register an official publisher (preferably verified owner of the domain nim-lang.org).
  2. Update the publisher ID, version and all URLs in package.json
  3. Maybe change the logo slightly, so it differs from Saem's and from the other Nim extensions in the marketplace
  4. Update the README
  5. Publish :)

Does not work on WSL

This module trying to run Windows PE binary instead of ELF on WSL

/redacted/.nimble/bin/nimlangserver: 1: /redacted/.nimble/bin\..\pkgs2\nimlangserver-1.2.0-95de85fae4485dcd850ada31e200d15671a00c4a\nimlangserver.exe: not found

WSL Info:

Default Distribution: kali-linux
Default Version: 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.