| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
see https://github.com/nim-lang/Nim/issues/23052
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
| |
Currently pragmas just fall through to `suggestSentinel` and show
everything which isn't very useful. Now it filters for symbols that
could be pragmas (templates with `{.pragma.}`, macros, user pragmas) and
only shows them
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running `check`/`suggest` in a file with an invalid user pragma
like
```nim
{.pragma foo: test.}
```
It will continue to try and process it which leads to the compiler
running into a `FieldDefect`
```
fatal.nim(53) sysFatal
Error: unhandled exception: field 'sons' is not accessible for type 'TNode' using 'kind = nkIdent' [FieldDefect]
```
This makes it instead bail out trying to process the user pragma if its
invalid
|
|
|
|
| |
* remove some dead code and leftovers from past features
* fix yaml printing of uint64 literals
|
|
|
|
|
|
|
|
|
|
| |
(#23034)
…eption: Exception
fixes #23019
I suppose `implicitPragmas` is called somewhere which converts
`otherPragmas`.
|
|
|
| |
I image `add` for `PType` to be used everythere
|
|
|
|
| |
This affects also nimsuggest hints (e.g. on mouse hover), as well as
compiler messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the documentation isn't shown when running `def` on the
definition of a proc (Which works for things like variables).
`gcsafe`/`noSideEffects` status also isn't showing up when running `def`
on the definition
Images of current behavior. After PR both look like "Usage"
**Definition**

**Usage**

Issue was the symbol getting passed too early to nimsuggest so it didn't
have all that info, now gets passed once proc is fully semmed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
doesn't exist (#23017)
For example with the command `nim r foo/bar.nim`, if `foo/` doesn't
exist then it shows this message
```
oserrors.nim(92) raiseOSError
Error: unhandled exception: No such file or directory
Additional info: foo [OSError]
```
After PR it shows
```
Error: cannot open 'foo/bar.nim'
```
Which makes it line up with the error message if `foo/` did exist but
`bar.nim` didn't. Does this by using the same logic for [handling if the
file doesn't
exist](https://github.com/ire4ever1190/Nim/blob/0dc12ec24b7902ef0023a9e694faa11bcf99e257/compiler/options.nim#L785-L788)
|
| |
|
|
|
| |
fixes #23001
|
|
|
|
|
|
|
|
|
|
|
| |
(#23004)
follow up https://github.com/nim-lang/Nim/pull/22991
- [x] turning it into an experimental feature
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
| |
While looking at the CI I noticed that there's a couple false positives
for `case` statements that cannot be checked for exhaustiveness since my
changes, this should resolve them.
---------
Co-authored-by: SirOlaf <>
|
|
|
|
|
| |
array field (#22999)
fixes #22926
|
|
|
| |
fixes #22996
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
new strictions on methods (#22991)
**TODO**
- [x] fixes changelog
With the new option `nimPreviewVtables`, `methods` are confined in the
same module where the type of the first parameter is defined
- [x] make it opt in after CI checks its feasibility
## In the following-up PRs
- [ ] in the following PRs, refactor code into a more efficient one
- [ ] cpp needs special treatments since it cannot embed array in light
of the preceding limits: ref
https://github.com/nim-lang/Nim/pull/20977#discussion_r1035528927; we
can support cpp backends with vtable implementations later on the
comprise that uses indirect vtable access
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently running `nimsuggest`/`check` on this code causes the compiler
to raise an exception
```nim
type
Test = enum
A = 9.0
```
```
assertions.nim(34) raiseAssert
Error: unhandled exception: int128.nim(69, 11) `arg.sdata(3) == 0` out of range [AssertionDefect]
```
Issue was the compiler still trying to get the ordinal value even if it
wasn't an ordinal
|
|
|
|
|
|
|
| |
Currently when using `use` with nimsuggest on an enum field, it doesn't
return the definition of the field.
Breaks renaming in IDEs since it will replace all the usages, but not
the declaration
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#22975)
fixes #22286
ref https://forum.nim-lang.org/t/10642
For backwards compatibilities, we might need to keep the changes under a
preview compiler flag. Let's see how many packags it break.
**TODO** in the following PRs
- [ ] Turn the `var T` destructors warning into an error with
`nimPreviewNonVarDestructor`
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
|
| |
When it is specified, the nimsuggest instance monitors whether this
process is still alive. In case it's found to be dead, nimsuggest shuts
itself down. Currently only implemented on POSIX and Windows platforms.
The switch is silently ignored on other platforms. Note that the Nim
language server should still try to shut down its child nimsuggest
processes. This switch just adds extra protection against crashing Nim
language server and gets rid of the remaining nimsuggest processes,
which consume memory and system resources.
|
| |
|
|
|
| |
fixes #22971
|
|
|
|
|
|
|
|
|
| |
Currently the suggestions create a lot of noise when creating enum
fields. I don't see any way of a macro creating fields (when called
inside an enum) so it should be safe to not show suggestions
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#22944)
…var/let symbols
fixes #22939
fixes #16890
Besides, it was applied to let/const/var with pragmas, now it is
universally applied.
```nim
{.push exportc.}
proc foo =
let bar = 12
echo bar
{.pop.}
```
For example, the `bar` variable will be affected by `exportc`.
|
|
|
|
|
|
|
|
|
|
|
| |
(#22941)
…tes invalid C identifiers
fixes #22913
fixes #12985 differently
`{.push.} now does not apply to generic instantiations`
|
|
|
| |
fixes #22947
|
|
|
|
|
|
|
|
|
| |
version 3 or later. (#22945)
Refactored the way nimsuggest checks for protocol version 3. Instead of
checking for version 3 exactly, it now checks for version 3 or later.
This way, once a version 4 is introduced, it will use version 3 as a
base line, and then extra changes to the protocol can be added on top.
No functional changes are introduced in this commit.
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the assertion defect that happens when using `jsondoc --stdout`
(There is no outfile since its just stdout)
```
Error: unhandled exception: options.nim(732, 3) `not conf.outFile.isEmpty` [AssertionDefect]
```
Also makes the output easier to parse by ending each module output with
a new line.
|
| |
|
|
|
| |
This adds inlay hint support for the types of consts.
|
|
|
|
|
|
|
|
| |
(#22915)
…er base method returning a lent
fixes #22673
|
| |
|
| |
|
|
|
| |
without it, devels fails to build with `-d:useLinenoise`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds inlay hints support to nimsuggest. It adds a new command to
nimsuggest, called 'inlayHints'.
Currently, it provides type information to 'var' and 'let' variables. In
the future, inlay hints can also be added for 'const' and for function
parameters. The protocol also reserves space for a tooltip field, which
is not used, yet, but support for it can be added in the future, without
further changing the protocol.
The change includes refactoring to allow the 'inlayHints' command to
return a completely different structure, compared to the other
nimsuggest commands. This will allow other future commands to have
custom return types as well. All the previous commands return the same
structure as before, so perfect backwards compatibility is maintained.
To use this feature, an update to the nim language server, as well as
the VS code extension is needed.
Related PRs:
nimlangserver: https://github.com/nim-lang/langserver/pull/53
VS code extension: https://github.com/saem/vscode-nim/pull/134
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
| |
fixes #22902
|
|
|
|
|
|
| |
custom destructors (#22901)
fixes #22866;
fixes #19998
|
| |
|
|
|
|
|
|
|
|
|
|
| |
ref
https://github.com/nim-lang/nightlies/actions/runs/6686795512/job/18166625042#logs
> /home/runner/work/nightlies/nightlies/nim/compiler/nir/nirvm.nim(163,
35) Error: type mismatch: got 'BiggestInt' for
'b.m.lit.numbers[litId(b.m.types.nodes[int(y)])]' but expected 'int'
Or unifies the type in one way or another
|
| |
|
|
|
| |
follow up https://github.com/nim-lang/Nim/pull/22851
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Close #22826
I am not sure why this code skips generic insts, so letting CI tell me.
Update: It has told me nothing. Maybe someone knows during review.
Issue itself seems to be that the generic instance is skipped thus it
ends up being just `float` which makes it use the wrong generic instance
of the proc because it matches the one in cache
---------
Co-authored-by: SirOlaf <>
|
| |
|
|
|
|
|
| |
(#22822)
…s of a patent-pending new VM
|
|
|
|
|
|
|
|
|
|
|
| |
containsManagedMemory(n.typ) (#22823)
fixes #19250
fixes #22259
The strings, seqs, refs types all have this flag, why should closures be
treated differently?
follow up https://github.com/nim-lang/Nim/pull/14336
|
|
|
|
|
|
| |
fixes #22354
It skips `nkHiddenAddr`. No need to hoist `var parameters` without side
effects. Besides, it saves lots of temporary variables in ORC.
|
|
|
|
|
|
| |
Done:
- [x] Implement conversions to openArray/varargs.
- [x] Implement index/range checking.
|