8M1 OpenApi Changes: PsiManager.getInstance(project).getSearchHelper()
Our plug-in code uses
PsiVariable variable = ...
PsiReference[] references = PsiManager.getInstance(project).getSearchHelper().findReferences(variable, variable.getUseScope(), false);
What is the 8M1 replacement for this? I could not find it at
http://www.jetbrains.net/confluence/display/IDEADEV/DianaPluginMigration+Guide
--
Thanks in advance,
Tom
Please sign in to leave a comment.
Hello Tom,
>> PsiVariable variable = ...
>> PsiReference[] references =
>> PsiManager.getInstance(project).getSearchHelper().findReferences(vari
>> able, variable.getUseScope(), false);
Use ReferencesSearch.search(). (This API is actually available both in Selena
and Diana.)
I've updated the migration guide to include this information.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thanks. Next question: we
>
PsiManager.getInstance(project).getElementFactory().createCodeBlockCodeFragment(code,
firstReference, false);
and
What's the replacements for those?
--
Thanks in advance,
Tom
Hello Tom,
>> PsiManager.getInstance(project).getElementFactory().createTypeByFQCla
>> ssName(className, element.getResolveScope())
>>
JavaPsiFacade.getInstance().getParserFacade().create*
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thank you for the speedy response.
--
Tom
The old method
returned a PsiCodeFragment (we are generating a couple of lines containing a
method call), but now using
a PsiCodeBlock is returned.
When debugging, our code is executed fine, even the editor shows the correct
result. Nevertheless, IDEA reports following internal error:
--
Tom
?
Hello Tom,
>> PsiManager.getInstance(project).getElementFactory().createCodeBlockCo
>> deFragment(...)
>>
>> JavaPsiFacade.getInstance(project).getParserFacade().createCodeBlockF
>> romText(...)
>>
The old method is actually still available: JavaPsiFacade.getInstance(project).getElementFactory().createCodeBlockCodeFragment(0
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thank you. That seems to have solved the problem.
Tom