Skip to content

Support highlights coming from different DocumentHighlightProvider fro the same document selector #230946

Closed as not planned

Description

@BoykoAlex

Multiple providers can be registered for a language. In that case providers are sorted by their score and groups sequentially asked for document highlights. The process stops when a provider returns a non-falsy or non-failure result.

I'd be great to merge results from different providers together.

Example:

	@Query("SELECT DISTINCT owner FROM Owner owner left join  owner.pets WHERE owner.lastName LIKE :lastName% ")
	@Transactional(readOnly = true)
	Page<Owner> findByLastName(@Param("lastName") String lastName, Pageable pageable);

The method parameter lastName is referenced in the HQL query inside the @Query annotation. Now if the cursor is at the lastName inside the query we can highlight the lastName method declaration parameter. However, if the cursor is at the lastName parameter inside the method declaration we cannot just add a highlight the lastName inside the query because we'd lose all highlights provided by the Java extension. There is a workaround of course by trying to highlight everything that Java would highlight but it is ugly and likely to have issues down the road

Activity

  1. added
    feature-request
    editor-highlight
    on Dec 10, 2024
  2. vs-code-engineering commented on Dec 10, 2024

    @vs-code-engineering
    Contributor

    This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  3. vs-code-engineering commented on Nov 12, 2026

    @vs-code-engineering
    Contributor

    Thanks for the request. This is implemented in 89263b4. Set "editor.occurrencesHighlightFromAllProviders": true to merge highlights from matching providers, allowing Java and Spring query highlights to appear together. The setting defaults to false to preserve existing behavior. The fix shipped in 1.142.0.

    This issue was closed automatically: the fix shipped in 1.142.0, proposed by the VS Code sweeper and confirmed by an independent second review. It is closed as "not planned" rather than "completed" only because a "completed" close would put this already-shipped fix back into the current milestone's verification queue. If it still reproduces on 1.142.0 or later, reply here or reopen the issue and a maintainer will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

editor-highlightfeature-request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions