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

Add support for nim-lang #3117

Closed
Zaplae opened this issue Jul 20, 2022 · 11 comments
Closed

Add support for nim-lang #3117

Zaplae opened this issue Jul 20, 2022 · 11 comments
Labels
A-language-support Area: Support for programming/text languages E-help-wanted Call for participation: Extra attention is needed

Comments

@Zaplae
Copy link

Zaplae commented Jul 20, 2022

Nim is a statically typed compiled systems programming language.
It combines successful concepts from mature languages like Python, Ada and Modula.

lsp: https://github.com/nim-lang/langserver
treesitter: https://github.com/aMOPel/tree-sitter-nim

@sudormrfbin sudormrfbin added E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Extra attention is needed labels Jul 20, 2022
@YesDrX
Copy link

YesDrX commented Jul 30, 2022

[[language]]
name = "nim"
scope = "source.nim"
injection-regex = "nim"
file-types = ["nim","nims"]
shebangs = ["nim"]
roots = []
comment-token = "#"
language-server = { command = "nimlsp" }
indent = { tab-width = 4, unit = " " }

[[grammar]]
name = "nim"
source = { git = "https://github.com/aMOPel/tree-sitter-nim", rev = "3727117e9a793610138ab0eabd75bef04c86299f" }

theherk added a commit to theherk/helix that referenced this issue Aug 2, 2022
@theherk
Copy link

theherk commented Aug 2, 2022

Since one of the goals of the author of the grammar is to write the queries for nvim-treesitter, I'm just going to watch closely until then. The queries written by the author of the grammar will probably better than my attempt. So we should crib those, then modify as required.

watch for progress:

That is of course in lieu of somebody else writing the queries in the meantime, which would be awesome.

@theHamsta
Copy link

theHamsta commented Aug 18, 2022

I just tried to add the nim parser to nvim-treesitter, but it SEGFAULTED during my editing session which in probably a no-go for editor integration. Also is probably requires a bit more work to support most language construct..

@theHamsta
Copy link

The SEGFAULT has been fixed. WIP for highlighting here nvim-treesitter/nvim-treesitter#3320 , Please note that the parser is not intended for usage yet, but it will probably be some day.

@geohuz
Copy link

geohuz commented Nov 23, 2022

wondering when nim support will be ready for helix?

@ghost
Copy link

ghost commented Nov 30, 2022

Same here, but it looks like the pr for nvim-treesitter was closed a while back

@mitjafelicijan
Copy link

Any news about this?

@theHamsta
Copy link

https://github.com/aMOPel/tree-sitter-nim still claims to be "not ready for use" but is also "welcome to contributions". Maybe interested people could have a look at the parser to see what is still missing to make it ready to use.

Also highlights at nvim-treesitter/nvim-treesitter#3320 are incomplete, but maybe a good start for alpha testers to see what's missing in the queries and the parser.

@pascalkuthe pascalkuthe added A-language-support Area: Support for programming/text languages and removed E-easy Call for participation: Experience needed to fix: Easy / not much labels Aug 4, 2023
@aMOPel
Copy link

aMOPel commented Oct 1, 2023

Update on this:

https://github.com/alaviss/tree-sitter-nim

Is now in a very usable state and does far better than my parser.
I have written a bunch of queries for nvim already.

Feel free to adapt them to helix.

@bdjnk
Copy link

bdjnk commented Nov 23, 2023

To keep this issue up to date, note that initial language support was added in #6123.

Support could be improved, as aMOPel says, along the lines of this Neovim PR from last month.

@omentic
Copy link
Contributor

omentic commented Dec 18, 2023

This issue can be closed. There are some issues with the language server, but they're on the Nim side of things.

I'll be updating the queries to be based on alaviss's (more complete) grammar shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages E-help-wanted Call for participation: Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.