Supress changes in Structure view?

I'd like to prevent the Structure view from updating while changes are being made to the corresponding class (of our custom language) in the editor. Is there a clearcut way to do that? Thanks.

3 comments
Comment actions Permalink

Normally the structure view is updated when you increase the out-of-code-block modification counter through the PsiModificationTrackerImpl class. This is normally done by your plugin code, so you can also skip doing this if you don't need it. :)

0
Comment actions Permalink

In our case since our language adheres to standard Java Psi tree structure (PsiClass etc.) the JavaCodeBlockModificationListener is standing in for us.

I'm not sure this helps us because we *do* want the structure view to update; we just don't want it to update when our Psi tree is in a certain state (for perf reasons our psi tree is "light" during active edits to a given source file -- the structure view can't handle our light psi [it's plain text]). To handle this (via some hacky reflective code) I tried wrapping StructureTreeBuilder's PsiTreeChangeListener with the hope of supressing changes involving "light" Psi tree state, but that didn't work. Apparently StructureTreeBuilder fields psi tree changes and then posts updates via an Alarm, which processes the tree at a later time when the Psi tree could be in a "light" state.

Ultimately, what I'm after is controlling StructureTreeBuilder updates, preventing updates involving certain Psi tree changes. Unless I'm wrong there's no way to override behavior at this level. Right?

Thanks for your help.

Scott

0
Comment actions Permalink

No, I don't think it's possible to override behavior at that level.

0

Please sign in to leave a comment.