Commit Graph

82 Commits

Author SHA1 Message Date
Danil Yarantsev
5702a60793 Change severity of template instantiation message [backport] (#14526)
* Change severity of template instatiation msg

* Add a test

* Trailing newline argh

(cherry picked from commit 3698f197f1)
2020-06-01 17:41:04 +02:00
Miran
5b55aa52d0 fix deprecations and other warnings (#13748) 2020-03-25 19:15:34 +01:00
Jasper Jenkins
1037318e68 fix nimsuggest warning (#13699) 2020-03-20 09:24:04 +01:00
Andy Davidoff
0f672378ab fix .deprecated. object typedef crash (#13643)
* fix .deprecated. object typedef crash
* fixup a test that i don't understand
* disable the test rather than debug ci
2020-03-16 15:08:38 +01:00
alaviss
4bd388ad58 Revert "nimsuggest: don't add CRLF to replies (#13545)" (#13597)
This reverts commit a974684b14.

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.
2020-03-06 19:29:28 +01:00
alaviss
a974684b14 nimsuggest: don't add CRLF to replies (#13545)
This is already sent by replTcp after the message is sent.
2020-03-04 15:56:40 +01:00
Jasper Jenkins
796aafe7e0 make case-object transitions explicit, make unknownLineInfo a const, replace a few magic numbers with consts (#13170) 2020-01-17 10:34:31 +01:00
Jasper Jenkins
0d022622e3 fix nimsuggest deprecation warnings (#12772) 2019-11-30 06:54:15 +01:00
narimiran
cc3e9ca164 remove unused imports 2019-11-06 12:01:00 +01:00
alaviss
558ecd1ca6 compiler/suggest: add variable support to con (#12569)
This allows for the type of a variable to be retrieved.
2019-11-04 18:29:26 +01:00
alaviss
5b3571c9a4 compiler/semtypes: improve lineinfo for exported object fields (#12495)
The line info should now points to the `a`, not the `*`, like this:
    a*: string
    ^
Additionally this fixes nimsuggest's highlighting of exported object
fields.
2019-10-25 01:06:53 +02:00
alaviss
f827d75804 compiler/semcall: return the correct lineinfo for nkCallStrLit (#12484) 2019-10-24 18:21:37 +02:00
alaviss
f957266574 nimsuggest: add a command that returns the project file (#12411)
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.
2019-10-11 18:00:38 +02:00
alaviss
eeffa0163f nimsuggest: add option to force finding the project file (#12409) 2019-10-11 09:55:15 +02:00
alaviss
edb24b7ce0 nimsuggest: fix tcp socket leak for epc backend (#12384) [backport]
Same as e9fa4c9b9c, 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.
2019-10-08 14:14:18 +02:00
alaviss
e9fa4c9b9c nimsuggest: fix tcp socket leak (#12377) [backport]
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.
2019-10-08 08:11:18 +02:00
Federico Ceratto
39290cf88c Fix spellings (#12277) [backport] 2019-09-27 07:02:54 +02:00
Andreas Rumpf
8397554315 fixes #12125 (#12131)
* fixes #12125
2019-09-06 07:23:59 +02:00
Araq
cb3c3c306c minor style changes 2019-07-11 00:28:20 +02:00
Miran
6cad5c7861 [bugfix] fix #11482, fix nimsuggest range error (#11519)
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.
2019-06-17 20:41:41 +02:00
Araq
b70295c768 [other] nimsuggest: adhere to our style guide 2019-06-13 09:59:03 +02:00
Andreas Rumpf
7215341190 make fullpaths the default in error messages and stack traces for mor… (#11385)
* make fullpaths the default in error messages and stack traces for more convenient development
* split up -d:release into -d:release and -d:danger flags
* workaround a Nim config parser bug
* fixes an old nim config parser bug
* make megatest green again
* make nimpretty tests work again
* make nimsuggest green
2019-06-05 08:02:54 +02:00
Araq
dfcd82669b update nimsuggest 2019-05-27 21:29:02 +02:00
Arne Döring
f94ec363ab Allow void macro result (#11286)
* allow void macro result
* add test for void macro result type
2019-05-21 21:31:40 +02:00
Miran
2b5e48d807 move assertions and iterators out of system.nim (#10597)
* move assertions and iterators out of system.nim
* limit nimsuggest tests to the first 3 suggestions
2019-03-07 00:49:39 +01:00
Andreas Rumpf
55bc29c761 nimsuggest: make use project file name if none given for 'sug' command; allows for more convenient debugging 2019-03-04 15:41:07 +01:00
Arne Döring
1102b8ac6e StringStream and parseJson, parseCfg, parseSql et al for the vm (#10746) 2019-02-28 22:57:57 +01:00
Miran
50d1a46537 better docs: osproc (#10708)
* better docs: osproc
* fix a typo in the docs, deprecate "demon"
2019-02-19 17:25:03 +01:00
Miran
8cf97908cc document proper imports, fixes #8164 (#10698) 2019-02-19 12:49:09 +01:00
alaviss
9e754c3b06 compiler/types: correctly generates signature for non-proc types (#10658)
This makes signatures generated for nimsuggest correctly distinguish
template/macro/converter from proc.
2019-02-13 23:30:14 +01:00
alaviss
d64e218abd nimsuggest: only log when logging is enabled (#10646)
fixes #6199
2019-02-13 23:30:14 +01:00
alaviss
2fdf816332 compiler/[msgs, suggest]: improve highlighter accuracy (#10496)
Previously the compiler would generate suggestions based on the symbol
identifier length, but that might not reflect the actual representation
of it within the actual source code.

This commit implements a simple source scanner for the suggest module to
address the problem outlined above.

Fixes nim-lang/nimsuggest#24
2019-02-07 17:08:15 +01:00
alaviss
74a7b09412 suggest: quote operators and keywords on suggestion (#10460) 2019-01-28 09:29:49 +01:00
alaviss
0b02241fc5 semcall: correct lineinfo for accquoted symbols (#10461) 2019-01-27 14:58:10 +01:00
alaviss
d72921ecf6 compiler/sem: correct macros lineinfo (#10438)
The compiler believes these are where a macro call starts (marked with
`^`):

    m "string"
    ^ ^

This commit addresses that.
2019-01-24 12:22:19 +01:00
alaviss
35d96d8749 compiler/sem*: better lineinfo for templates (#10428)
* compiler/sem*: better lineinfo for templates

Lineinfo for templates is inconsistant across the compiler, for example:

    doAssert true
    ^        ^

    a[int](10)
    ^^    ^

The `^` marks where the compiler thinks the template starts.

For qualified call, we got the same situation with `proc`s before #10427:

    system.once
          ^

Generics lineinfo within template declaration is also incorrect, for
example, this is where the compiler believes the `T` in `[T]` is:

    template a[T](b: T)
                  ^

This PR addresses all of these problems.

* nimsuggest: add tests for template highlighting
2019-01-23 16:35:34 +01:00
alaviss
2fb8b1d132 nimsuggest/tester: disable highlight tests for epc (#10426)
The EPC backend of nimsuggest currently doesn't support nimsuggest
highlighter, see nim-lang/nim-mode#140
2019-01-23 09:43:11 +01:00
alaviss
e962be8981 compiler/sem*: improve lineinfo for qualified and generic procs (#10427)
Previously the compiler will believe these are where `newSeq` symbol
starts:

    newSeq[int]()
          ^
    system.newSeq[int]()
                 ^

This commit moves them back to:

    newSeq[int]()
    ^
    system.newSeq[int]()
           ^
2019-01-23 09:24:21 +01:00
alaviss
413755fd45 Correct lineinfo for accent quoted symbols in proc definition (#10399)
* compiler/parser: preserve lineinfo for accent quoted symbols

Previously the lineinfo for symbol $$$ in this example is:

    proc `$$$`
             ^

After this commit:

    proc `$$$`
          ^

* compiler/semstmts: correct lineinfo for accent quoted idents

Previously nimsuggest would highlight this as:

    proc `$$$`
         ^~~

After this commit:

    proc `$$$`
          ^~~

* nimsuggest/tests: add a test for accent quoted proc

Disabled by default
2019-01-21 16:57:48 +01:00
alaviss
fc30cf02bc nimsuggest: add an option to bind to a free port (#10328) 2019-01-16 21:06:32 +01:00
alaviss
58d293d6a9 fixes nim-lang/nimsuggest#76 (#10093)
* nimsuggest: prevent out-of-bound access

* fixes nim-lang/nimsuggest#76

* undo tester changes
2018-12-25 21:08:16 +01:00
PMunch
3f546b70ed Moved some code around in nimsuggest to avoid crash when run as library (#9818)
* Moved some code around in nimsuggest to avoid crash when run as library

* Moved the common executecallback setting to a procedure

* Fixed slight issue
2018-12-01 09:38:18 +01:00
PMunch
a20169af91 Made nimsuggest importable as a library and add Nim-path override option (#9784)
* Made nimsuggest importable as a library and add Nim-path override option

* Remove leftover debug output
2018-11-23 15:45:48 +01:00
Timothee Cour
fe2eb25650 nimsuggest: fixes #96 2018-11-20 22:57:27 +01:00
Timothee Cour
6e003eeecb refs #9637 ; cleanup installation of nimsuggest (#9703) 2018-11-15 10:02:34 +01:00
Timothee Cour
08de33a2e3 remove ---path:"../compiler" from nimsuggest/nimsuggest.nim.cfg 2018-11-07 19:52:11 +01:00
Andreas Rumpf
86556ebfdb compiler refactoring; use typesafe path handing; docgen: render symbols between modules 2018-09-07 19:21:16 +02:00
Timothee Cour
ed0cb7b85d make config.nims behave like nim.cfg in terms of where these scripts are 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
2018-08-30 13:52:32 +02:00
Timothee Cour
01211ced1d add nim c -r nimsuggest/tester to travis (#8805) 2018-08-29 16:03:16 +02:00
Andreas Rumpf
7f49364fd0 make more tests green 2018-08-13 12:29:03 +02:00