-
Notifications
You must be signed in to change notification settings - Fork 244
Search view doesn't update matches for Xtext DSL code #3813
Description
Unfortunately I don't have a self containing example at hand, just saw the issue immediately by loking at the PR related to the Search view PositionTracker fix #3802.
I can see it with custom Xtext based application that provides various DSL (text file based) implementations.
- Start Search -> File, make sure the filter matches some DSL files, like "Search for 'a'" text in any DSL file.
- Search view shows those DSL files (OK), highlighting text matches (OK)
- Double click on that file & remove the line with the match, save the file
- Search view is supposed to update the result to show less matches.
- For Xtext based DSL files this doesn't work - because Xtext by default doesn't use
ITextFileBufferManager.
See org.eclipse.search2.internal.ui.text.PositionTracker constructor why this doesn't work:
Lines 61 to 64 in 1c1d72e
| public PositionTracker() { | |
| NewSearchUI.addQueryListener(this); | |
| FileBuffers.getTextFileBufferManager().addFileBufferListener(this); | |
| } |
Of course it would be nice if Xtext would use "common" text file buffers API, but it's obviously design decision which was made several years ago and changing that would be either not possible or breaking existing API/code.
One possible solution on platform UI side would be to add resource change listener in PositionTracker...
See also related issue / proposed workaround in LSP4E eclipse-lsp4e/lsp4e#1501.