Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nimsuggest instance for project ... stopped with exitcode: 1 #37

Open
aabbtree77 opened this issue Nov 16, 2020 · 5 comments
Open

nimsuggest instance for project ... stopped with exitcode: 1 #37

aabbtree77 opened this issue Nov 16, 2020 · 5 comments
Labels
nimsuggest bug This issue is caused by a bug in nimsuggest

Comments

@aabbtree77
Copy link

I have installed this plugin on my Ubuntu 20.04 machine by adding Plug 'alaviss/nim.nvim'
into ./config/nvim/init.vim file, followed by running nvim and :PlugInstall.

The Nim language code becomes now nicely highlighted, but gd, gD do not jump into function definitions.

When I open the file such as nvim gltf.nim inside the cloned repo guzba/gltfviewer, this shows up at the bottom of neovim:
nimsuggest instance for project /home/tokyo/gltfviewer/src stopped with exitcode: 1
and when pressing gd/gD:
nim.nvim: instance is not running

This is a similar issue reported before and closed (#16), yet it occurs with newer nim/nimsuggest versions, i.e.
nimsuggest --version Nim Compiler Version 1.4.0 [Linux: amd64] Compiled at 2020-10-18 Copyright (c) 2006-2020 by Andreas Rumpf

It seems that nimsuggest itself runs fine, i.e. running in the terminal nimsuggest gltf.nim produces the green-colored lines:
nimsuggest gltf.nim Hint: used config file '/home/tokyo/.choosenim/toolchains/nim-1.4.0/config/nim.cfg' [Conf] Hint: used config file '/home/tokyo/.choosenim/toolchains/nim-1.4.0/config/config.nims' [Conf] Hint: used config file '/home/tokyo/gltfviewer/config.nims' [Conf] ...
So nimsuggest is installed and is visible, yet nim.nvim stops it upon loading somehow.

@alaviss
Copy link
Owner

alaviss commented Nov 30, 2020

The message is emitted whenever nimsuggest crashes, which unfortunately happens a lot. A quick way to check is to run the highlighter by typing into nimsuggest:

highlight /path/to/file.nim

@alaviss alaviss added the nimsuggest bug This issue is caused by a bug in nimsuggest label Dec 12, 2020
@nnsee
Copy link

nnsee commented Dec 9, 2022

I'm having the same issue and I'm unsure what the problem is. Nimsuggest (including highlight) runs fine from the command line, but crashes repeatedly in nvim. The thing is, it's really inconsistent. Some days it doesn't work at all, other days it works fine (although there haven't been any updates, etc).

Is there a way to get nvim to instruct nimsuggest to emit more information?

@alaviss
Copy link
Owner

alaviss commented Dec 9, 2022

You can add '--log' to extraArgs here:

let s:config = {'nimsuggest': 'nimsuggest', 'extraArgs': []}

Then nimsuggest will write a nimsuggest.log in your home directory.

I'll add a logging function to nim.nvim once I have the time to do so, so you'll have to use this for now.

The thing is, it's really inconsistent. Some days it doesn't work at all, other days it works fine (although there haven't been any updates, etc).

One thing to note is that nimsuggest (or rather, the compiler) state changes as more queries are made against it, so I'm not surprised that there is a weird combination where it would only crash after a set number/combination of queries were made...

And also, the compiler is not very tolerant of broken (ie. incomplete) files and that might cause nimsuggest to crash too.

@firasuke
Copy link

I am also facing the same error whenever I open any .nim file:

nimsuggest instance for project stopped with exitcode: 1

@MrKleeblatt
Copy link

Had the same issue and solved it through choosenim.
Many package managers seem to scramble the nim installation and nim can't find its files anymore. So nim tries to find nimsuggest in the wrong directory and you can see that by calling nimble install nimlsp which should error in Error: cannot open file: /usr/nimsuggest/nimsuggest.nim or similar.

In order to solve this issue just install nim like this:

curl https://nim-lang.org/choosenim/init.sh -sSf | sh
choosenim stable

Then run

nimble install nimlsp

(could take a while)
And after that this plugin should work perfectly.

Sources: PMunch/nimlsp#67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nimsuggest bug This issue is caused by a bug in nimsuggest
Projects
None yet
Development

No branches or pull requests

5 participants