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

Show auto-completion items together with their src path #1728

Closed
Alexey-T opened this issue Jan 9, 2021 · 4 comments
Closed

Show auto-completion items together with their src path #1728

Alexey-T opened this issue Jan 9, 2021 · 4 comments

Comments

@Alexey-T
Copy link
Contributor

Alexey-T commented Jan 9, 2021

VSCode can now show autocompletion items with additional string: path of source file.

TypeScript can provide completions that also add an import statement. However, when there are multiple symbols with the same name, it is hard to pick the right completion. This release makes this simpler because paths of auto-import completions are shown with the label.

vs-path

additional string is of gray font color.
how Jedi can help? to do the same.

@kvichans @OlehL for your info.

@Alexey-T Alexey-T changed the title possibility to show auto-completion items together with their src path Show auto-completion items together with their src path Jan 9, 2021
@OlehL
Copy link

OlehL commented Jan 9, 2021

It can be useful for TypeScript/JavaScript. But for Python and many other languages can't be multiple symbols with the same name.

@PeterJCLaw
Copy link
Collaborator

In Python there cannot be more than one symbol with a given name in scope at a time. My guess is that what VSCode is doing here for JavaScript is showing symbols which are not yet imported and that when one was selected the proper import statement would also be added.

If that is the case, then this feature is actually quite different -- what would really be wanted here is a way to show the symbols which match a given name and are present anywhere in the Python environment, rather than those in the scope of the current file. Jedi currently focusses on the latter.

@davidhalter
Copy link
Owner

Something like list(jedi.get_default_project().search('Project')) could help.

However Jedi currently has no intentions to search diffferent files for random symbols. Jedi would just be too slow for that. So I'm closing, because without a cache this is just not feasible. Not that it would be hard to implement, but it's just way too slow for medium/large projects.

@davidhalter
Copy link
Owner

If we ever have a solution for #1059, I think we can improve some things in the direction you want, but since I doubt that that will ever be the case, closing makes more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants