trouble migrating to Diana

I am trying to migrate IdentifierHighlighter to Diana. Two issues:

1. Is there any documentation on the new PersistentStateComponent? I have something working but the persisted state saved to the xml file in the options directory duplicates each setting:

<<<<<<<============ Why is this in here twice? ]]>


2. What is the replacement for:

PsiElement idents[] = PsiSearchHelper.findIdentifiers(pElem.getText(),GlobalSearchScope.fileScope(pFile),UsageSearchContext.ANY);

2 comments
Comment actions Permalink

Hello Shawn,

I am trying to migrate IdentifierHighlighter to Diana. Two issues:

1. Is there any documentation on the new PersistentStateComponent? I
have something working but the persisted state saved to the xml file
in the options directory duplicates each setting:

<?xml version="1.0" encoding="UTF-8"?>
<application>
<component name="IdentifierHighlighterAppComponent">
<option name="_classHighlightEnabled" value="false" />
<option name="_classHighlightEnabled" value="false" />
<<<<<<<============ Why is this in here twice?
</component>
</application>


Probably because you have both public fields and public accessor methods
for them in your state class.

2. What is the replacement for:

PsiElement idents[] =
PsiSearchHelper.findIdentifiers(pElem.getText(),GlobalSearchScope.file
Scope(pFile),UsageSearchContext.ANY);


Use PsiSearchHelper.processElementsWithWord() and check the passed elements
for 'instanceof PsiIdentifier'.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thanks, that did the trick

0

Please sign in to leave a comment.