Nim/compiler
Ivan Yonchovski b41226001c
Initial implementation of nimsuggest v3 (#19826)
* Initial implementation of nimsuggest v3

Rework `nimsuggest` to use caching to make usage of ide commands more efficient.
Previously, all commands no matter what the state of the process is were causing
clean build. In the context of Language Server Protocol(LSP) and lsp clients
this was causing perf issues and overall instability. Overall, the goal of v3 is
to fit to LSP Server needs

- added two new commands:
  - `recompile` to do clean compilation
  - `changed` which can be used by the IDEs to notify that a particular file has been changed.
The later can be utilized when using LSP file watches.
  - `globalSymbols` - searching global references

- added `segfaults` dependency to allow fallback to clean build when incremental
fails. I wish the error to be propagated to the client so we can work on fixing
the incremental build failures (typically hitting pointer)

- more efficient rebuild flow. ATM incremental rebuild is triggered when the
command needs that(i. e. it is global) while the commands that work on the
current source rebuild only it

Things missing in this PR:

- Documentation
- Extensive unit testing.

Although functional I still see this more as a POC that this approach can work.

Next steps:
- Implement `sug` request.
- Rework/extend the protocol to allow better client/server communication.
Ideally we will need push events, diagnostics should be restructored to allow
per file notifications, etc.
- implement v3 test suite.
- better logging

* Add tests for v3 and implement ideSug

* Remove typeInstCache/procInstCache cleanup

* Add ideChkFile command

* Avoid contains call when adding symbol info

* Remove log

* Remove segfaults
2022-06-13 11:33:44 +02:00
..
ic Refactor and doc package handling, module name mangling (#19821) 2022-05-30 18:52:19 +02:00
nimfix [backport] use old style hints in .cfg files (#18917) 2021-09-29 11:14:47 +02:00
plugins IC: next steps (#16550) 2021-01-07 20:26:40 +01:00
aliases.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
ast.nim Stop type aliases from inheriting sfUsed (#19861) 2022-06-04 06:25:21 +02:00
astalgo.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
astmsgs.nim properly fix #10053 ; FieldDefect msg now shows discriminant value + lineinfo, in all backends (c,vm,js) (#11955) 2021-08-13 09:35:48 +02:00
bitsets.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
btrees.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
ccgcalls.nim fixes #19631 (#19618) 2022-03-20 14:02:44 +01:00
ccgexprs.nim fixes #18612; apply cache and memcmp for methods in arc/orc (#19749) 2022-04-26 20:14:39 +02:00
ccgliterals.nim Removed lib/system/allocators.nim. seqs_v2 and strs_v2 now uses allocShared0. (#13190) 2020-01-23 14:25:22 +01:00
ccgmerge_unused.nim IC: green tests (#17311) 2021-03-19 16:53:38 +01:00
ccgreset.nim cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString (#17744) 2021-04-17 11:14:09 +02:00
ccgstmts.nim remove noop option gc:v2 (#19810) 2022-06-10 20:32:27 +02:00
ccgthreadvars.nim fix #16752: threadvar now works with importcpp types; osx now uses native TLS (--tlsEmulation:off), which can be orders of magnitude faster (#16750) 2021-01-27 22:35:43 +01:00
ccgtrav.nim allow old styled RTTI for arc/orc (#15331) 2020-09-16 14:57:01 +02:00
ccgtypes.nim remove noop option gc:v2 (#19810) 2022-06-10 20:32:27 +02:00
ccgutils.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
cgen.nim not generate initStackBottomWith in arc/orc [backport] (#19875) 2022-06-10 21:24:28 +08:00
cgendata.nim fix #19266; allow reassign discriminant field (#19567) 2022-02-25 20:33:28 +01:00
cgmeth.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
closureiters.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
cmdlinehelper.nim undefine C symbols in JS backend [backport:1.6] (#19437) 2022-02-04 17:10:24 -05:00
commands.nim remove noop option gc:v2 (#19810) 2022-06-10 20:32:27 +02:00
concepts.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
condsyms.nim fixes #19078 [backport] (#19090) 2021-11-02 16:30:59 +01:00
debuginfo.nim happy new year 2017-01-07 22:35:09 +01:00
debugutils.nim Extend and document compiler debugging utilities (#19841) 2022-06-10 20:40:08 +02:00
depends.nim genDepend: fix for module names that are reserved DOT keywords (#18392) 2021-06-30 07:29:10 +02:00
dfa.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
docgen.nim RST: improve simple tables (#19859) 2022-06-04 07:03:03 +02:00
docgen2.nim Refactor and doc package handling, module name mangling (#19821) 2022-05-30 18:52:19 +02:00
enumtostr.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
errorhandling.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
evalffi.nim cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString (#17744) 2021-04-17 11:14:09 +02:00
evaltempl.nim fix #16993, #18054, #17835 runnableExamples now works with templates and nested templates (#18082) 2021-06-02 09:02:14 -07:00
extccomp.nim Refactor and doc package handling, module name mangling (#19821) 2022-05-30 18:52:19 +02:00
filter_tmpl.nim fix wrong name (rnimsyn => renderer; pnimsyn => parser; scanner => lexer) (#18895) 2021-09-25 13:22:00 +02:00
filters.nim Cosmetic compiler cleanup (#12718) 2019-11-28 17:13:04 +01:00
gorgeimpl.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
guards.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
hlo.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
idents.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
importer.nim fix #18986; Import/except doesn't work on devel [backport: 1.6] (#19687) 2022-04-06 16:17:09 +02:00
index.nim walkDirRecFilter, update doc CI filter, compiler/index.nim for docs + various other fixes (#14501) 2020-06-01 19:21:41 +02:00
injectdestructors.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
installer.ini make choosenim work on windows [backport] (#18993) 2021-10-14 23:55:05 +08:00
int128.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
isolation_check.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
jsgen.nim Fix global destructor injection for JS backend (#19797) 2022-05-23 06:17:32 +02:00
jstypes.nim jsgen improve spacing (#18048) 2021-05-20 15:48:46 +02:00
lambdalifting.nim Friendlier error message with solution (#19880) 2022-06-11 18:23:31 +02:00
layouter.nim fix #12155, improve nimpretty's handling of pragmas (#17353) 2021-03-12 15:34:42 +01:00
lexer.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
liftdestructors.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
liftlocals.nim fixes #11225; generic sandwich problems; [backport:1.2] (#17255) 2021-03-09 20:19:24 +01:00
lineinfos.nim RST: improve simple tables (#19859) 2022-06-04 07:03:03 +02:00
linter.nim add astmsgs; add declared in msg for usage lint errors (#17961) 2021-05-08 06:43:52 +02:00
llstream.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
lookups.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
lowerings.nim Fix bug in freshVarForClosureIter. Fixes #18474 (#19675) [backport] 2022-04-04 12:05:23 +02:00
macrocacheimpl.nim IC: next steps (#16632) 2021-01-12 09:36:51 +01:00
magicsys.nim cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString (#17744) 2021-04-17 11:14:09 +02:00
main.nim fix #17286 nim check -b:js works (#19704) 2022-04-09 17:52:11 +02:00
md5_old.nim Use openarray of bytes in md5 (#19307) 2022-01-15 13:19:05 +01:00
modulegraphs.nim Initial implementation of nimsuggest v3 (#19826) 2022-06-13 11:33:44 +02:00
modulepaths.nim Refactor and doc package handling, module name mangling (#19821) 2022-05-30 18:52:19 +02:00
modules.nim Refactor and doc package handling, module name mangling (#19821) 2022-05-30 18:52:19 +02:00
msgs.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
ndi.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
nilcheck.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
nim.cfg [backport] use old style hints in .cfg files (#18917) 2021-09-29 11:14:47 +02:00
nim.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
nimblecmd.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
nimconf.nim fix #8219; nim check/dump shouldn't run single nimscript project [backport: 1.6] (#19641) 2022-03-26 11:50:15 +01:00
nimeval.nim Added setGlobalValue to VM api (#19007) 2021-10-17 16:24:43 +02:00
nimlexbase.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
nimpaths.nim Move common Latex code into class nimdoc.cls (#19734) 2022-04-21 15:06:09 -04:00
nimsets.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
nodejs.nim Improve error message when NodeJS is not installed and 'nim js -r' is run (#18978) 2021-10-12 15:41:30 +02:00
nversion.nim Fix spellings (#12277) [backport] 2019-09-27 07:02:54 +02:00
optimizer.nim correct the comments (#19322) 2022-01-04 11:10:46 +01:00
options.nim Initial implementation of nimsuggest v3 (#19826) 2022-06-13 11:33:44 +02:00
packagehandling.nim Refactor and doc package handling, module name mangling (#19821) 2022-05-30 18:52:19 +02:00
packages.nim Refactor and doc package handling, module name mangling (#19821) 2022-05-30 18:52:19 +02:00
parampatterns.nim apply changes from #18017 and some fixes (#19571) 2022-03-01 07:46:08 +01:00
parser.nim fixes #19662; Indent level errored for first line (#19718) 2022-04-25 12:00:23 +02:00
passaux.nim improvements to hint:processing: show import stack, distinguish nims, show includes etc (#18372) 2021-06-30 07:16:31 +02:00
passes.nim Initial implementation of nimsuggest v3 (#19826) 2022-06-13 11:33:44 +02:00
pathutils.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
patterns.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
platform.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
pluginsupport.nim refactoring: fewer global variables 2018-05-27 19:19:12 +02:00
pragmas.nim Refactor and doc package handling, module name mangling (#19821) 2022-05-30 18:52:19 +02:00
prefixmatches.nim move tests under the compiler directory to testament (#16096) 2020-11-25 07:48:27 +01:00
procfind.nim Fix forward declarations in shadow scope contexts (#15386) 2020-09-22 18:24:13 +02:00
readme.md refactor: renamed readme to readme.md (#14283) 2020-05-11 13:50:40 +02:00
renderer.nim fix NimNode comment repr() regression [backport: 1.2] (#19726) 2022-04-25 11:19:21 +02:00
renderverbatim.nim runnableExamples now show originating location in stacktraces on failure (#18457) 2021-07-09 11:41:28 +02:00
reorder.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
rodutils.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
ropes.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
saturate.nim fix warnings for deprecated low and high (#15291) 2020-09-11 01:04:07 +02:00
scriptconfig.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
sem.nim fixes 'lent T' inside object constructor [backport] (#18911) 2021-09-27 22:23:31 +02:00
semcall.nim Fixed distinct composite type class proc borrowing (#18904) 2021-10-26 11:29:07 +02:00
semdata.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
semexprs.nim Fix fixAbstractType for user defined typeclasses, fixes #19730 & #18409 (#19732) 2022-04-30 15:58:58 +02:00
semfields.nim IC: next steps (#16550) 2021-01-07 20:26:40 +01:00
semfold.nim [semfold] fix #19199; properly fold uint to float conversion (#19890) [backport] 2022-06-13 09:01:40 +02:00
semgnrc.nim fixes #18769 (#18790) 2021-09-03 15:18:55 +02:00
seminst.nim Fixed distinct composite type class proc borrowing (#18904) 2021-10-26 11:29:07 +02:00
semmacrosanity.nim cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString (#17744) 2021-04-17 11:14:09 +02:00
semmagic.nim apply changes from #18017 and some fixes (#19571) 2022-03-01 07:46:08 +01:00
semobjconstr.nim misc bugfixes [backport:1.2] (#19203) 2021-12-04 07:42:34 +01:00
semparallel.nim minor typos (#17668) 2021-04-07 19:54:28 +02:00
sempass2.nim fix #19435; don't create TypeBoundOps for tyOpenArray, tyVarargs [backport: 1.6] (#19723) 2022-04-25 11:07:55 +02:00
semstmts.nim give a better error message for some template expansions (#19871) 2022-06-09 14:21:18 +02:00
semtempl.nim New/better macro pragmas, mark some as experimental (#19406) 2022-01-20 20:57:50 +01:00
semtypes.nim Don't reject types directly on AST (#19407) 2022-01-19 12:38:14 +01:00
semtypinst.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
sighashes.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
sigmatch.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
sinkparameter_inference.nim big steps torwards an efficient, simple IC implementation (#16543) 2021-01-02 07:30:39 +01:00
sizealignoffsetimpl.nim fixes #19569 (#19595) [backport] 2022-03-09 07:22:10 +01:00
sourcemap.nim cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString (#17744) 2021-04-17 11:14:09 +02:00
spawn.nim Fix bug in freshVarForClosureIter. Fixes #18474 (#19675) [backport] 2022-04-04 12:05:23 +02:00
strutils2.nim Correct all eggs (#15906) 2020-11-10 21:53:25 +01:00
suggest.nim Initial implementation of nimsuggest v3 (#19826) 2022-06-13 11:33:44 +02:00
syntaxes.nim fixes #19662; Indent level errored for first line (#19718) 2022-04-25 12:00:23 +02:00
tccgen.nim move tinyc to a separate repo and allow installing external dependencency (eg tinyc) from koch / library code (#13850) 2020-04-03 09:10:45 +02:00
transf.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
trees.nim Revert "fix #16185 (#16195)" (#16197) 2020-11-30 23:36:38 +01:00
treetab.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
typeallowed.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
types.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
typesrenderer.nim docgen: implement doc link resolution in current module (#18642) 2021-10-28 19:20:52 +02:00
varpartitions.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
vm.nim [cleanup] remove unnecessary procs in vm (#19888) 2022-06-13 08:10:40 +02:00
vmconv.nim make system random work in VM (#17059) 2021-02-17 11:52:46 +01:00
vmdef.nim [vm] remove unused opcSubstr opcode (#19834) 2022-05-30 10:41:24 +02:00
vmdeps.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
vmgen.nim [cleanup] remove unnecessary procs in vm (#19888) 2022-06-13 08:10:40 +02:00
vmhooks.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
vmmarshal.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
vmops.nim move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
vmprofiler.nim cleanup of PR #14833 (VM profiler) 2020-07-09 19:21:20 +02:00
wordrecg.nim stylecheck usages part two: stdlib cleanup (#19338) 2022-01-08 21:34:22 +01:00

Nim Compiler

  • This directory contains the Nim compiler written in Nim.
  • Note that this code has been translated from a bootstrapping version written in Pascal.
  • So the code is not a poster child of good Nim code.

See Internals of the Nim Compiler for more information.