summary refs log tree commit diff stats
path: root/nimsuggest/nimsuggest.nim
Commit message (Collapse)AuthorAgeFilesLines
* Fix infinite recursion introduced in 7031ea6 [backport 1.6] (#21555)Peter Munch-Ellingsen2023-03-201-1/+1
| | | Fix infinite recursion introduced in 7031ea6
* replaces implicit passes array registed at runtime with explicit function ↵ringabout2023-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | calls; simplify compilation pipeline (#21444) * abolish using passes in the compiler; simplify compilation pipeline * duplicate code * Really cool to have the same signature... * haul * unify other backends * refactor process * introduce PipelinePhase * refactor compiler * fixes passes * fixes nimsuggest * add a sentinel * enable docs checkj * activate doc testing * clean up * complete cleanups
* Implemented basic macro expand functionality (#20579)Ivan Yonchovski2023-01-271-42/+151
| | | | | | | | | | | | | | | | | | * Implemented level based macro expand functionality - it can handle single macro call or expand whole function/proc/etc and it - In addition, I have altered the parser to provide the endInfo for the node. The usefulness of the `endInfo` is not limited to the `expandMacro` functionality but also it is useful for `ideOutline` functionality and I have altered the ideOutline functionality to use `endInfo`. Note `endInfo` most of the time is lost during the AST transformation thus in `nimsuggest.nim` I am using freshly parsed tree to get the location information. * Make sure we stop expanding correctly * Test CI * Fix tv3_outline.nim
* Nimsuggest now defines the backends symbol (#21083)Jake Leahy2022-12-121-2/+5
| | | | | | | * Add testcase * Define the backend symbol * Remove unneeded whitespace
* rename `std/threads` to `std/typedthreads` (#20850)ringabout2022-11-161-1/+1
| | | | | | | | | * rename `std/threads` to `std/oldthreads` * fixes tests * rename to `typedthreads` * changelog
* Fix typo in nimsuggest.nim (#20767)Ikko Ashimine2022-11-051-1/+1
| | | becase -> because
* put std/threads under the umbrella of nimPreviewSlimSystem (#20711)ringabout2022-10-311-0/+2
| | | | | | | | | | | * put `std/threads` under the umbrella of `nimPreviewSlimSystem` * add changelog * fixes tests * fixes tests again * fixes tests
* Fix/improve handling of forward declarations in nimsuggest (#20493)Ivan Yonchovski2022-10-061-9/+77
| | | | | | | | | | | | | | | | | * Fix/improve handling of forward declarations in nimsuggest - ideUse now works fine when invoked on the implementation - implemented ideDeclaration to make cover lsp feature textDocument/declaration - fixed performance issue related to deduplicating symbols. Now the deduplication happens after the symbols are filtered. As a alternative we might change the way cached symbols are stored(e. g. use set). - I also fixed the way globalSymbols work. Now it will sort the responses based on the match location to make sure that the results are sorted in user friendly way. * Update nimsuggest/nimsuggest.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* [nimsuggest] fix def call on identifier 2 times on the line (#20228)Ivan Yonchovski2022-08-301-38/+34
| | | | | | | - apparently TLineInfo's implementation of `==` ignores the column. After I fixed the code to use exact TLineInfo comparison I fixed several other issues hidden by that issue. - Replaced `tuple[sym, info]` with `SymInfoPair`
* Implement type command (#19944)Ivan Yonchovski2022-07-151-1/+11
| | | | | | | | | | | * Implement type command - this will be mapped to textDocument/typeDefinition in LSP protocol. It will be very useful for `nim` in particular because typically most of the time the type is inferred. * Update nimsuggest/nimsuggest.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Initial implementation of nimsuggest v3 (#19826)Ivan Yonchovski2022-06-131-14/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Deprecate TaintedString (#15423)Juan Carlos2021-01-151-1/+1
| | | | Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* IC: next steps (#16550)Andreas Rumpf2021-01-071-1/+1
| | | | | | | | | | | | | | | | | | * cleanups * ast.nim: cleanups * IC: no more sym.tab field, stored externally in the module graph * nimble compiles again * rodfiles: store bitwidth of integers and the endianness in the cookie because we serialize 'int' directly * rodfiles: added compilerproc and export sections * rodfiles: added all the missing sections * rodfiles: track the missing information * IC: architecture for lazy loading of proc bodies * make tests green again * completed the lazy loading of proc bodies * symbol lookup integration, part 1 * symbol lookup integration, part 2 * symbol lookup integration, part 3 * make tcompilerapi work again * rodfiles: fixed config change handling
* cmdline: improve command processing (#16056)Timothee Cour2020-11-261-2/+2
|
* rename loadConfigsAndRunMainCommand => loadConfigsAndProcessCmdLine, reflect ↵Timothee Cour2020-11-201-2/+2
| | | | reality (#16057)
* refactoring: removed cmdlinehelper.mainCommand callbackAndreas Rumpf2020-10-111-6/+8
|
* * honor --errorMax even for tools (eg drnim, nim doc) (#14546)Timothee Cour2020-06-021-4/+2
| | | * fix a bug that prevented nim doc compiler/nim on windows
* fix nimsuggest warning (#13699)Jasper Jenkins2020-03-201-3/+0
|
* Revert "nimsuggest: don't add CRLF to replies (#13545)" (#13597)alaviss2020-03-061-4/+4
| | | | | | | | This reverts commit a974684b149faa19645f1e18b7b11aa67f169997. The CRLF was to separate between each response, and removing them causes the responses to not be splitted correctly. I didn't notice that it was in a loop when I made the #13545.
* nimsuggest: don't add CRLF to replies (#13545)alaviss2020-03-041-4/+4
| | | This is already sent by replTcp after the message is sent.
* remove unused importsnarimiran2019-11-061-4/+3
|
* nimsuggest: add a command that returns the project file (#12411)alaviss2019-10-111-1/+10
| | | | | | | This can be used to let nimsuggest users know which project is nimsuggest being in charge of, so they can know when should a new nimsuggest instance be spawned. An additional feature is to debug the project file finding feature.
* nimsuggest: add option to force finding the project file (#12409)alaviss2019-10-111-1/+10
|
* nimsuggest: fix tcp socket leak for epc backend (#12384) [backport]alaviss2019-10-081-1/+1
| | | | | | | | Same as e9fa4c9b9c8e2926449399a69a02676936bb842c, but for the epc backend which is used by emacs and vscode plugin. Since the EPC backend only deal with one connection per nimsuggest instance, only one socket is leaked, thus not as servere as with the tcp backend.
* nimsuggest: fix tcp socket leak (#12377) [backport]alaviss2019-10-081-1/+1
| | | | | | A new socket is created for each iteration and leak immediately thanks to the accept() call replacing the created socket with the client socket. This commit fixes that.
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-1/+1
|
* minor style changesAraq2019-07-111-9/+9
|
* [bugfix] fix #11482, fix nimsuggest range error (#11519)Miran2019-06-171-2/+2
| | | | | | The default starting parameters for `line` and `col` were switched. See line 141: "line starts at 1, column at 0, dirtyfile is optional". Also, in `TLineInfo` object, `line` is uint16, `col` is int16.
* [other] nimsuggest: adhere to our style guideAraq2019-06-131-2/+2
|
* nimsuggest: make use project file name if none given for 'sug' command; ↵Andreas Rumpf2019-03-041-4/+8
| | | | allows for more convenient debugging
* nimsuggest: only log when logging is enabled (#10646)alaviss2019-02-131-2/+2
| | | fixes #6199
* nimsuggest: add an option to bind to a free port (#10328)alaviss2019-01-161-2/+15
|
* fixes nim-lang/nimsuggest#76 (#10093)alaviss2018-12-251-2/+2
| | | | | | | | * nimsuggest: prevent out-of-bound access * fixes nim-lang/nimsuggest#76 * undo tester changes
* Moved some code around in nimsuggest to avoid crash when run as library (#9818)PMunch2018-12-011-8/+22
| | | | | | | | * Moved some code around in nimsuggest to avoid crash when run as library * Moved the common executecallback setting to a procedure * Fixed slight issue
* Made nimsuggest importable as a library and add Nim-path override option (#9784)PMunch2018-11-231-1/+100
| | | | | | * Made nimsuggest importable as a library and add Nim-path override option * Remove leftover debug output
* nimsuggest: fixes #96Timothee Cour2018-11-201-2/+3
|
* compiler refactoring; use typesafe path handing; docgen: render symbols ↵Andreas Rumpf2018-09-071-18/+21
| | | | between modules
* make config.nims behave like nim.cfg in terms of where these scripts are ↵Timothee Cour2018-08-301-48/+25
| | | | | | | | | searched / run (#8682) * run project config.nims if exists, then inputfile.nims if exists * ~/.config/nim/config.nims can now be used * also check in getSystemConfigPath for config.nims * refactor handleCmdLine for nim and nimsuggest
* make more tests greenAndreas Rumpf2018-08-131-3/+3
|
* implements a --nep1:on switch to make the compiler enforce the naming ↵Andreas Rumpf2018-06-131-1/+0
| | | | conventions outlined in NEP-1
* incremental compilation: implemented basic replay logicAndreas Rumpf2018-06-021-16/+16
|
* compiler API: final cleanups; improve security by diabling 'gorge' and friendsAndreas Rumpf2018-05-291-3/+6
|
* vm now free of global variablesAndreas Rumpf2018-05-281-1/+1
|
* refactoring: remove idents.legacy global variable and pass the IdentCache ↵Andreas Rumpf2018-05-271-1/+1
| | | | around explicitly
* remove more global variables in the Nim compilerAndreas Rumpf2018-05-271-33/+32
|
* preparations of making compiler/msgs.nim free of global variablesAndreas Rumpf2018-05-171-6/+6
|
* make nimsuggest compile againAndreas Rumpf2018-05-141-10/+10
|
* make nimsuggest compile againAndreas Rumpf2018-05-131-69/+77
|
* .experimental can now be used to enable specific featuresAndreas Rumpf2018-04-241-4/+4
|
* include help short option in processCmdLine (#7515)skilchen2018-04-061-1/+1
|