Skip to content

Search view doesn't update matches for Xtext DSL code #3813

@iloveeclipse

Description

@iloveeclipse

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.

  1. Start Search -> File, make sure the filter matches some DSL files, like "Search for 'a'" text in any DSL file.
  2. Search view shows those DSL files (OK), highlighting text matches (OK)
  3. Double click on that file & remove the line with the match, save the file
  4. Search view is supposed to update the result to show less matches.
  5. 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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions