My own NEd editor works really bad when many generics are used, so I wrote the rtree module with plain gedit without any special Nim support. Unfortunately my editor has the same problems when I only import rtree module -- for a file with only 700 lines of code and gtk3 and rtree import it blocks often for more than 10 seconds.
Generally nimsuggest works great for me, nearly no crashes any more. But these blocking is really not that nice, for example when I press CTRL E to check for errors, or sometimes also when I only move the cursor and nimsuggest tries to show information about proc under cursor.
I just tried to remember how nimsuggest can be used from console and tried
$ nimsuggest --stdin test.nim
> chk test.nim:0:0
with file
https://github.com/StefanSalewski/RTree/blob/master/tests/test.nim
which of course compiles and works fine, nim ckeck test.nim is also fine.
That also blocks for at least 10 seconds with output finally
> chk test.nim:0:0
chk skUnknown Hint ??? 0 -1 "test [Processing]" 0
chk skUnknown Hint /home/stefan/.nimble/pkgs/rtree-0.2.0/rtree.nim 460 15 "condition is always true: \'t of RTree[8, 2, RT, LT]\' [CondTrue]" 0
chk skUnknown Error /tmp/test.nim 31 8 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 134 20 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 110 66 "type mismatch" 0
chk skUnknown Error /tmp/test.nim 31 8 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 134 20 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 117 12 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4315 17 "type mismatch" 0
chk skUnknown Error /tmp/test.nim 31 8 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 134 20 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 117 12 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 86 68 "type mismatch" 0
chk skUnknown Error /tmp/test.nim 31 8 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 134 20 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 117 12 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 85 18 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 86 68 "type mismatch" 0
chk skUnknown Error /tmp/test.nim 31 8 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 134 20 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 117 12 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 85 18 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 86 68 "type mismatch" 0
chk skUnknown Error /tmp/test.nim 31 8 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 134 20 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 117 12 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 85 18 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 86 68 "type mismatch" 0
chk skUnknown Error /tmp/test.nim 31 8 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 134 20 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 117 12 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 86 68 "type mismatch" 0
chk skUnknown Error /tmp/test.nim 31 8 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 134 20 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 117 12 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 90 14 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4315 17 "type mismatch" 0
chk skUnknown Error /tmp/test.nim 31 8 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 134 20 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 117 12 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 90 14 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 86 68 "type mismatch" 0
chk skUnknown Error /tmp/test.nim 31 8 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 134 20 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 117 12 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 90 14 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 86 68 "type mismatch" 0
chk skUnknown Error /tmp/test.nim 31 8 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 134 20 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 117 12 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 90 14 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system.nim 4318 10 "template/generic instantiation from here" 0
chk skUnknown Error /home/stefan/Nim/lib/system/dollars.nim 86 68 "type mismatch" 0
chk skUnknown Hint /home/stefan/.nimble/pkgs/rtree-0.2.0/rtree.nim 615 9 "condition is always true: \'t of RTree[8, 2, RT, LT]\' [CondTrue]" 0
chk skUnknown Hint /tmp/test.nim 53 6 "\'bt\' is declared but not used [XDeclaredButNotUsed]" 0
>
I think there are some editors available which support PMunch LanguageServerProtocol, like neoVim. May these work better with generics?
Apparently your file managed to cause extreme slowdown for nimsuggest. While using editors with nimlsp or my nim.nvim plugin won't cause any lag due to asynchronous communications, the time it took for nimsuggest to return the results is extremely long.
It took about 8-9 seconds on my machine for nim check to finish, and 22-30 seconds for nim.nvim to finish populating the highlighting in the file. Any queries to nimsuggest also took a decent amount of time before a reply could be seen. This renders nimsuggest useless against files like yours.
But thanks to your file, I now have living proof that nim.nvim functions well even if nimsuggest stalls \o/.
Thanks for testing.
So I think I will consider using your neovim. I have used GVim some years ago, so I know at least the most basic vim commands. My gentoo box has to install a lot of additional packages for neovin, that is the reason why I have not tested neovim for Nim already. Other reason was, that I was satisfied with my NEd editor.
I think language server protocoll is not available for plain GtkSourceView, maybe it is available for Gnome-Builder-Editor. So maybe eventually I will modify NEd at some time in far future...
Is there any chance that this nimsuggest problem get fixes eventually, or is it not fixable?
It is the most serious nimsuggest problem, besides some templates which are displayed in editor as errors and some very rare crashes resulting from typing errors.
With generic modules like rtree a check takes 30 seconds and while editing the CPU load is really high unfortunately.