-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suggest: limit Psym.allUsages
processing per ideCmd
#946
base: devel
Are you sure you want to change the base?
Conversation
Psym.allUsages
processingPsym.allUsages
processing per ideCmd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 2 Now 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
suggestSym
limitPsym.allUsages
processing toideNone
,ideUse
,ideDus
,ideSug
,ideCon
ideCmd
Details
ideNone
is for initial compilation.ideDus
andideUse
requireallUsages
through their use oflistUsages
.ideSug
,ideCon
usePsym.allUsages
for sorting results.IdeCmd
,a file that changed isn't same with dirty file runs with
IdeCmd
.Notes for Reviewers