Skip to content

A document matcher whose synchronous match throws takes away every language server of the file #2163

Done

Description

@lagergren

What happens

LanguageServiceAccessor.getMatchedLanguageServerDefinitions calls each synchronous DocumentMatcher.match(file, project) of a file's mappings in a loop, through the private match(...) helper, with no error handling. So when one matcher throws, the exception leaves getMatchedLanguageServerDefinitions, and the request for the file's language servers fails.

The file then gets none of its language servers, not even those that other matchers or plain file-type and pattern mappings matched. A bug in one plugin's matcher takes away the language servers of every other plugin, and every user-defined one, for that file.

This is the synchronous counterpart of #2161, which is about an asynchronous matchAsync whose future fails. It was found while fixing #2161, and left out of that fix to keep its scope.

Expected

As for #2161:

  • a matcher that throws counts as "no match" for its definition, and its failure is logged with the definition's name;
  • the other definitions still match;
  • a ProcessCanceledException is rethrown, as everywhere else.

Activity

  1. added
    bug
    on Nov 23, 2026
  2. added this to the 0.30.2 milestone on Nov 23, 2026
  3. added a commit that references this issue on Nov 23, 2026
    965ba39
  4. added a commit that references this issue on Nov 24, 2026
    d6f12e3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions