Don't repeat suggestions for same symbol (#21140)
* Track seen module graphs so symbols from the same module aren't repeated Add test case * Track symbols instead of modules * Don't show duplicate symbols in spell checker Removes the declared location from the message. Since we don't show duplicates anymore it would be a bit misleading if we only show the location for the first declaration of the symbol
This commit is contained in:
parent
37daed3897
commit
18c115c8d0
5 changed files with 71 additions and 35 deletions
21
tests/misc/tspellsuggest3.nim
Normal file
21
tests/misc/tspellsuggest3.nim
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
discard """
|
||||
# pending bug #16521 (bug 12) use `matrix`
|
||||
cmd: "nim c --spellsuggest:4 --hints:off $file"
|
||||
action: "reject"
|
||||
nimout: '''
|
||||
tspellsuggest3.nim(21, 1) Error: undeclared identifier: 'fooBar'
|
||||
candidates (edit distance, scope distance); see '--spellSuggest':
|
||||
(1, 2): 'FooBar'
|
||||
(1, 2): 'fooBar4'
|
||||
(1, 2): 'fooBar9'
|
||||
(1, 2): 'fooCar'
|
||||
'''
|
||||
"""
|
||||
|
||||
import ./mspellsuggest
|
||||
import ./mspellsuggest
|
||||
import ./mspellsuggest
|
||||
import ./mspellsuggest
|
||||
|
||||
|
||||
fooBar
|
||||
Loading…
Add table
Add a link
Reference in a new issue