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

Python scope crawler force all Named psi elements to by in autocompletion/resolve #240

Closed
iromeo opened this issue Aug 30, 2019 · 0 comments
Assignees
Labels
3rd party codeInsight Code completion, resolve subtask

Comments

@iromeo
Copy link
Contributor

iromeo commented Aug 30, 2019

Python scope crawler force all Named psi elements to by in autocompletion/resolve

Resolve/completion implemented via com.jetbrains.python.psi.resolve.PyResolveUtil.scopeCrawlUp() method which delegates to com.jetbrains.python.codeInsight.dataflow.scope.impl.ScopeImpl.collectDeclarations(). Method collectDeclarations() contains python visitor which adds all PsiNameIdentifierOwner and PsiNamedElements into autocompletion.

I'd like to customize this ScopeImpl method and provide my own impl filtering out my rule-like psi elements.

At the moment we have to replace PyReferenceImpl with fake reference to remove SmkRuleLike elements. It is also not very convenient because PyReferenceExpressionImpl.getReference() has large piece of code selecting different type of references (e.g references for import, qualifed reference, etc) and if nothing interested was found finally returns basic default PyReferenceImpl(). We'd like to replace this default choice and do not copy all advanced implementation for choosing suitable refernce type.

@iromeo iromeo added 3rd party codeInsight Code completion, resolve subtask labels Aug 30, 2019
@iromeo iromeo closed this as completed in 1cd17ed Aug 30, 2019
@iromeo iromeo self-assigned this Aug 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party codeInsight Code completion, resolve subtask
Projects
None yet
Development

No branches or pull requests

1 participant