pragmagic / vscode-nim

An extension for VS Code which provides support for the Nim language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nim extension in Nim

saem opened this issue · comments

Wasn't quite sure where else to put it, I'm seeing if I can port the TypeScript code this extension is written in into Nim -- you can follow that branch here.

It's a fun way for me to learn a bit of Nim (read: the code is ugly and a straight port). If I complete it, well that might make community contributions a whole lot easier and allow for leveraging a lot more pure Nim facilities. My intentions are:

  1. finish porting
  2. clean-up the code (make it more Nim like)
  3. maybe add some small quality of life enhancements (track defines and feed that into nimsuggest)

If there is interesting in discussing integration just wondering how, if at all, that might proceed?

Just a quick update, I believe I'm about 1/3rd of the way through conversion. That's feelings more than math, I'll check later how many files/features/functions/whatever I have left to convert. But almost through all the nimSuggest items.

Finished porring all the providers etc... Now it's into a whole lot of the backend like the indexer. I also need to learn more Nim because I'm still writing typescript/haxe with a different syntax.

Going through this part, looking at nimSuggest integration etc, I think one of the things to do after a bit of house keeping is working to integrate the language server protocol. It should help consolidate efforts and help move the focus of the extension on user experience, UI, and services, while keeping much of the heavy lifting and enabling work in a shared place to help everyone.

Quick update, down to one last file, nimMain.ts.

Highlights:

  • Fixed a few bugs along the way -- nimSignature and nimSuggest had one or two each
  • Have to use nim 1.3.5 (devel) in order to use nimsuggest/sexp
  • Ported to and am using nimsuggest/sexp
  • It's not that slow even though I know there are lots of copies everywhere

My current "minimal" todo list:

  • Finish nimMain.ts port
  • Clean-up vscodeApi.nim, remove redundant type and JsObject usage
  • Reduce some of excessive promise abuse and associated casting

OK, all the typescript code has been ported over. 🎉

Next up:

  1. clean-up the infrastructure and build part so it's a published extension
  2. catch-up on 5 commits against this repo, only one of those seems to impact the code I ported
  3. make it better

The first point is because I'm presuming folks in this project don't want to rush towards it just yet.

Switched to your version @saem

I'll report any issue I find. Cheers!

Thanks, @kraptor.

My version is probably pre-alpha, at best. I just published a test version to learn. Nonetheless, I'm grateful for the support and I'll keep an eye out.

Finished porting https://marketplace.visualstudio.com/items?itemName=nimsaem.nimvscode. I created a new repo that's no longer a fork of this one, so it has its own issue tracker. Now comes the fun of refactoring and maybe some other contributors.

Closing this issue for now.