Skip to content
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

[Feature Request] show more suggestions via fuzzy text. #217

Closed
byehack opened this issue Aug 8, 2020 · 4 comments
Closed

[Feature Request] show more suggestions via fuzzy text. #217

byehack opened this issue Aug 8, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request needs investigation Could be an issue - needs investigation

Comments

@byehack
Copy link

byehack commented Aug 8, 2020

write pr and see the suggestion list:

using jedi:

image

using Pylance:
image

in Pylance, we can't see PermissionError and PendingDeprecationWarning.

@github-actions github-actions bot added the triage label Aug 8, 2020
@erictraut
Copy link
Contributor

Thanks for the suggestion.

There's no single "right" way to determine which suggestions to show or which order to display them. Pylance incorporates a complex set of heuristics that take into account context, fuzzy text matching, symbol types, and historical usage. It's significantly more sophisticated than the method used by Jedi. So our goal is not to simply copy Jedi here.

Can you provide more details about what you like about Jedi's results in this specific example? It sounds like you want the fuzzy text matching to be slightly "fuzzier"?

If I adjust our "similarity cutoff" just slightly, the additional suggestions appear. But there's a tradeoff in doing this. It means the suggestions will be noisier.

@jakebailey & @savannahostrowski , I'm interested in your thoughts here. If I change similarityLimit from 0.25 to 0.249, the following suggestions are provided in the example above.

Screen Shot 2020-08-08 at 8 13 38 AM

@byehack
Copy link
Author

byehack commented Aug 8, 2020

Can you provide more details about what you like about Jedi's results in this specific example?

My Suggestion:

when write one character:
the suggestion should starts with this character (like now of Pylance)

when write two or more characters:
the suggestion should has all of the characters , but first character's index < second's character index < third ...

example of words that should suggest the HelloWorldTest from this code: HelloWorldTest = None:

h
H
hw
hW
hwt
world
test

example of words that should not suggest:

olleh
tset

this is usefull when we want the see all Exception list to choice the Exception that endswith 'Error'.

image
in above when i write hwt and wrd, it shows the HelloWorldTest. i think this is from vscode not pylance because it doesn't have value icon. maybe you can also get help with vscode method to how show the suggestions?

@jakebailey
Copy link
Member

After a few completions, we mark the completion list as "complete" to save CPU time as the user continues typing. If the server does any sort of filtering, then when the client (VS Code) stops querying and starts doing its own filtering, things will be missing. That's what's happening here.

In MPLS (and Jedi), the server returns the first completion list as complete the first time and then lets the client do the rest of the filtering. Arguably, this is the simplest way to get good fuzzy matching.

But in our case, we have auto-import completions we'd also like to save work on calculating if their names aren't similar, which requires more filtering, and so we can't mark the first completion as complete (without including a world's worth of auto-import suggestions).

This will take a bit of work to figure out how to fix up efficiently, maybe move some matching back into Pylance to save work internally rather than trying to go for full completeness.

@jakebailey jakebailey added enhancement New feature or request needs investigation Could be an issue - needs investigation labels Aug 10, 2020
@github-actions github-actions bot removed the triage label Aug 10, 2020
@byehack byehack changed the title [Feature Request] Use jedi method to show suggestions. [Feature Request] show more suggestions via fuzzy text. Aug 10, 2020
@jakebailey
Copy link
Member

jakebailey commented Dec 15, 2020

This should be fixed via #608 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs investigation Could be an issue - needs investigation
Projects
None yet
Development

No branches or pull requests

4 participants