Commit Graph

148 Commits

Author SHA1 Message Date
Saem Ghani
1097cc4173 nimsuggest prioritize non-deprecated suggestions (#16816)
* penalizes the quality score of deprecated symbols
* uses quality more pervasively in order to reflect deprecation impact
* impacts both sug and con

additional notes:
* linux i386 CI was failing
* this is because the suggested results differ slightly in their sort
* 64 bit tables.getOrDefault:441 was returned, while 32 bit returned 422
* for now simply removing the last line is good enough
2021-01-29 15:15:35 +01:00
Saem Ghani
d99ea00829 fixed nim-lang/nimsuggest#48 type aware sug (#16814)
* suggesting identifiers accounts context over scope (distance)
* key takeaway: context fit is prioritized over a heuristics like scope
2021-01-25 07:36:47 +01:00
Saem Ghani
bb3c6d0797 fixes nim-lang/nimsuggest#103 con dot exprs (#16657)
- con calls for dot exprs now returns results
- discovered an issue with dot expr results -- documented
2021-01-12 13:35:21 +01:00
Saem Ghani
bbc96f974d fixed nim-lang/nimsuggest#82 pure enum field sug (#16676)
- previous code wasn't account for tyEnum being wrapped in tyTypeDesc
- now pure enum fields are suggested
2021-01-11 10:18:01 +01:00
Andreas Rumpf
796498525a IC: next steps (#16550)
* 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
2021-01-07 20:26:40 +01:00
Saem Ghani
21dfa04cbf fixes nim-lang/nimsuggest#119 outline includes (#16608)
nimsuggest outline should account for includes, now it does:
- the module prefix will be of the module doing the including
- the filename will be of the module that was included
- adds a test case for it
2021-01-06 20:26:16 +01:00
Andreas Rumpf
979148e863 refactorings to prepare the compiler for IC (#15935)
* added ic specific Nim code; WIP
* make the symbol import mechanism lazy; WIP
* ensure that modules can be imported multiple times
* ambiguity checking
* handle converters and TR macros properly
* make 'enum' test category green again
* special logic for semi-pure enums
* makes nimsuggest tests green again
* fixes nimdata
* makes nimpy green again
* makes more important packages work
2020-12-17 08:01:36 +01:00
alaviss
c2ba4ef979 suggest: try to find the implementation of a symbol when def is used (#15555)
* suggest: try to find the implementation of a symbol when def is used

* suggest: return all declarations of the symbol on `def`
2020-10-14 17:08:56 +02:00
Clyybber
13e659cfec Big compiler Cleanup (#14777) 2020-08-28 22:18:09 +02:00
Araq
a0049d1fb0 compiler: minor code cleanups 2020-07-27 08:05:52 +02:00
flywind
40b58a0a18 fix #11009 (#14935) 2020-07-09 09:57:35 +02:00
Juan Carlos
74d1f25010 Clean out oldast (#14837)
* Clean out old Deprecated CLI switch
* Update to remove --oldast CLI option
2020-06-30 10:01:25 +02:00
alaviss
77834f0fda compiler/suggest: highlight squashed operators (#11796)
The operator fetching proc is greedy, so operators such as `%*` in
expression `%*{}` can't be highlighted.

This commit fixes that.
2020-04-20 11:54:53 +02:00
Timothee Cour
216fd59c44 make usage of foo is a user-defined error more informative (#13833) 2020-04-01 17:49:29 +02: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
Clyybber
7e747d11c6 Cosmetic compiler cleanup (#12718)
* Cleanup compiler code base

* Unify add calls

* Unify len invocations

* Unify range operators

* Fix oversight

* Remove {.procvar.} pragma

* initCandidate -> newCandidate where reasonable

* Unify safeLen calls
2019-11-28 17:13:04 +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
Clyybber
ed1d41c51e Small ast.nim cleanup (#12156)
* Remove sonsLen
* Use Indexable
2019-09-09 11:54:15 +02:00
narimiran
a9c7fb2fcc fixes nimsuggest/#108: RangeError with d:release 2019-09-04 13:31:59 +02:00
Andreas Rumpf
b07694cd90 new gensym handling (#11985)
* new .gensym implementation
* make astspec test green again
* introduce a --useVersion switch to group compatibility switches
* fixes #10180
* fixes #11494 
* fixes #11483
* object constructor fields and named parameters are also not gensym'ed
* disabled broken package
2019-08-23 16:15:02 +02:00
Araq
0e4a8bfb28 fixes 'unused module' feature for 32 bit builds of Nim for good [nobackport] 2019-08-09 16:38:10 +02:00
Andreas Rumpf
81ddc67785 [refactoring] compiler: simplified markUsed 2019-08-08 22:43:58 +02:00
Andreas Rumpf
04708742e7 fixes #11809 2019-08-08 21:41:05 +02:00
Andreas Rumpf
fbb0642e27 Merge branch 'devel' into araq-detect-unused-imports 2019-07-18 18:16:32 +02:00
Araq
07d465ca42 [refactoring] remove unused imports in the compiler and in some stdlib modules 2019-07-18 00:36:03 +02:00
Araq
4137a4dbf3 [feature] detect unused imports 2019-07-17 22:36:23 +02:00
Araq
cb3c3c306c minor style changes 2019-07-11 00:28:20 +02:00
Araq
bd689849f2 nim styleChecker: implemented all the missing features (bugfix) 2019-07-10 00:29:58 +02:00
Arne Döring
b92fd30282 rename tyExpr/tyStmt to tyUntyped/tyTyped (#11227) 2019-05-11 10:11:08 +02:00
Clyybber
f18b3af9d4 Replace countup(x, y-1) with x ..< y 2019-05-07 12:32:05 +02:00
Arne Döring
35aab357e2 Less warnings in macros (#10799) 2019-03-11 19:21:39 +01:00
Andreas Rumpf
bf4e688ca3 make nimsuggest aware of tyOwned 2019-02-25 16:37:09 +01:00
Arne Döring
28394153ab 32 bit fixes (#10608) 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
Neelesh Chandola
fb26b95f81 {.deprecated: msg.} now works for vars and lets (#10234) 2019-01-08 19:44:47 +01:00
Neelesh Chandola
9faad7591e Deprecate gc v2 (#10151)
* Deprecate gc v2

* warnDeprecated now has custom messages
2019-01-01 13:50:48 +01:00
Neelesh Chandola
bcbe317d17 Before showing deprecated warning, check whether enum field was marked deprecated or the whole enum type (#10135) 2018-12-30 18:34:41 +01:00
Neelesh Chandola
cbbdcb2669 Show deprecation warning for fields of a deprecated enum (#10112)
* Show deprecation warning for fields of a deprecated enum

* Add test
2018-12-30 09:45:39 +01:00
Andreas Rumpf
cb4d810659 make Nim take roughly 100MB less RAM for bootstrapping via a new compiler switch -d:leanCompiler; useful for the Raberry PI 2018-11-07 18:36:52 +01:00
Araq
548fc778c9 .error for routines now can also have a custom error message; improve error message for 'nil' strings 2018-09-25 00:28:39 +02:00
Andreas Rumpf
86556ebfdb compiler refactoring; use typesafe path handing; docgen: render symbols between modules 2018-09-07 19:21:16 +02:00
Andreas Rumpf
ae0255ea67 make nimsuggest compile again 2018-08-23 17:36:24 +02:00
Araq
30597e643f fixes merge conflict 2018-08-23 11:30:55 +02:00
Araq
64517445ea even more strict isNil handling for strings/seqs in order to detect bugs 2018-08-22 12:35:46 +02:00
LemonBoy
cf20c4460c More robust handling of deprecated pragmas (#8696)
Prevent `deprecated` annotations to "slip" up to the parent module and
warn about unsupported annotations.

Accidentally fixes #7867
2018-08-21 15:07:44 +02:00
Andreas Rumpf
826c1e2d78 incremental compilation: implemented basic replay logic 2018-06-02 09:41:27 +02:00
Andreas Rumpf
a5701d6b71 ensure compiler API doesn't import the RST engine 2018-05-29 08:22:09 +02:00
Andreas Rumpf
669a564492 remove more global variables in the Nim compiler 2018-05-27 11:10:56 +02:00
Andreas Rumpf
bf6c2c5ccf preparations of making compiler/msgs.nim free of global variables 2018-05-17 15:21:22 +02:00