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 Nim language support #3492

Closed
wants to merge 0 commits into from
Closed

Add Nim language support #3492

wants to merge 0 commits into from

Conversation

omentic
Copy link
Contributor

@omentic omentic commented Aug 21, 2022

No description provided.

@omentic
Copy link
Contributor Author

omentic commented Aug 21, 2022

Ah, I now see that there have been quite a few previous PRs. Also looks like nvim-treesitter/nvim-treesitter#3320 is a WIP for nvim-treesitter.

@omentic omentic marked this pull request as draft August 21, 2022 07:03
@zetashift
Copy link
Contributor

There is also https://github.com/nim-lang/langserver which one might want to use instead of nimlsp

@kirawi kirawi added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 13, 2022
@kirawi kirawi added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 24, 2022
@mtoohey31
Copy link
Contributor

Would it be possible to merge these changes minus the grammar for now, so we at least have comment, indentation, and language server support out of the box?

@omentic
Copy link
Contributor Author

omentic commented Dec 11, 2022

Thanks for the bump. Rebased on master and switched to nimlangserver.

Currently playing around with writing basic highlight / indentation queries based on alaviss/tree-sitter-nim - I think eventually aMOPel/tree-sitter-nim will be better as it exposes much more of Nim, but it's also more complicated, and I don't want to mess around with it right now while the rule structure is in flux.

@mtoohey31
Copy link
Contributor

On nimlangserver vs nimlsp, it looks like the nimlsp project is more active, but that's just based on commits/issues/stars, so take that with a grain of salt. There's a comparison here: nim-lang/langserver#2, but it's not too in-depth. Also, I wrote my first line of nim today, so I'm not really qualified to comment on which works better. However, I was using nimlsp earlier today and it looks like it crashes if the file doesn't exist on disk yet...

@zetashift have you used both? Would you be able to offer your opinion on which we should include?

@omentic
Copy link
Contributor Author

omentic commented Dec 11, 2022

I switched to nimlangserver after getting fed up with nimlsp's constant crashes and have found it much more mature and stable (fewer crashes, better recovery after crashes, equivalent support via nimsuggest, no bug with orphan processes pegging your CPU at 100%)

@bfg-coding
Copy link

Is there anything that I can help with to get this moving forward? I'd like to have a good DX with helix and nim

@Desdaemon
Copy link

Desdaemon commented Jan 1, 2023

Been experimenting with this on my end, some small thoughts:

  • The grammar from aMOPel/tree-sitter-nim seems to work fine, however type annotations are a bit hard to write highlight queries for.
  • Agreed with nimlangserver working much better, but at least on my Mac M1 it has a bug where child processes are not cleaned up properly, though luckily was easy to fix/patch.

@omentic
Copy link
Contributor Author

omentic commented Jan 6, 2023

Hi, apologies, I've been pretty busy and will continue to be busy for at least another week or so. I ran into issues getting helix to recognize my .scm files whatsoever, that I still need to debug, and left off there.

If any of you would like to work on it in the meantime, feel free - I was modelling the .scm files off of the corresponding Rust and Python files, and adding in keywords taken from the manual as necessary - but getting this up and running is definitely on my todo list (just not a high priority right now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants