suggest: limit Psym.allUsages processing per ideCmd#946
suggest: limit Psym.allUsages processing per ideCmd#946bung87 wants to merge 6 commits intonim-works:develfrom
Psym.allUsages processing per ideCmd#946Conversation
Psym.allUsages processingPsym.allUsages processing per ideCmd
zerbina
left a comment
There was a problem hiding this comment.
Thank you for your work towards improving the suggestion engine!
For the PR message, I think mentioning that ideDus and ideUse require allUsages through their use of listUsages would help.
I'm not sure I understand the inclusion of ideNone just yet. Could you elaborate on why it's needed?
Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
|
IDE tools wrap around |
|
Hmm, but in what situations are |
|
it means no editing file as far as I know. user just open exists project. |
|
Okay, I looked into the implementation. Without a cursor position, Do you have a reproducible example where |
|
don't know why you mentioned "cursor position", the code avoiding re compilation when BTW you can remove the |
|
Ah, got it, I confused Okay, that makes things clearer, but I think that there's a problem now. Consider the following:
If I understand correctly, the result would be that one now gets nothing as the result. Is that correct? |
|
maybe we can just remove well, this is another problem, here the thing is doing right I think. |
It's possible that I misunderstand what you're saying, but does that mean that the PR, as is, is incorrect? |
|
I mean the PR is for limit the |
|
I detailed a possible issue with this PR here. Is that something that now fails or is it not? |
|
the point 5 assuming running these commands without dirty file, that will fails. |
|
Okay, that's what I wanted to know, thanks. In that case, how do you plan to continue with this PR? |
|
remove |
zerbina
left a comment
There was a problem hiding this comment.
I think the implementation should stay how it was (until a rodfile-based approach is used).
The way it is now is not correct, as no usages outside of the selected module and its client modules are reported when the module the symbol is defined in was recompiled since the last use, dus, con, or sug command (or initial compilation).
|
isn't now you conflict with your previous comment? I explain this in last point in details section, also this apply to recent changes that handle isolated module |
Which one do you mean? I'm not sure I follow. As for the incorrect behaviour I've mentioned, consider the following setup: # module_a.nim
var global* = 1
global = 0 # use 1
# module_b.nim
import module_a
global = 1 # use 2Now run the following commands: Prior to this PR, the last |
|
I just test on local, both this patch and devel branch passed as below, though it's not my expectation. |
|
I should have provided a runnable test right away, my bad. There is a small but severe mistake in the setup I posted previously: the files for the Here are the exact files I've tested with the locally: # nimsuggest/tests/module_a.nim
var global* = 1
global = 2# nimsuggest/tests/tmodule_b.nim
import module_a
global = 1
discard """
$nimsuggest --tester $file
>use $path/module_a.nim:3:1
def;;skVar;;module_a.global;;int;;*;;2;;4;;"";;100
use;;skVar;;module_a.global;;int;;*;;3;;0;;"";;100
use;;skVar;;module_a.global;;int;;$file;;3;;0;;"";;100
>def $path/module_a.nim:3:1
def;;skVar;;module_a.global;;int;;*;;2;;4;;"";;100
>use $path/tmodule_b.nim:3:1
def;;skVar;;module_a.global;;int;;*;;2;;4;;"";;100
use;;skVar;;module_a.global;;int;;*;;3;;0;;"";;100
use;;skVar;;module_a.global;;int;;$file;;3;;0;;"";;100
"""A |
Summary
suggestSymlimitPsym.allUsagesprocessing toideNone,ideUse,ideDus,ideSug,ideConideCmdDetails
ideNoneis for initial compilation.ideDusandideUserequireallUsagesthrough their use oflistUsages.ideSug,ideConusePsym.allUsagesfor sorting results.IdeCmd,a file that changed isn't same with dirty file runs with
IdeCmd.Notes for Reviewers