Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-30595

Semantic token requests not sent for matching document

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • Qt Creator 12.0.0, Qt Creator 14.0.0

      Issue

      Semantic highlighting requests are not sent by QtCreator.

      The semantic tokens endpoint of our custom language server (written in Python using the pygls library) works correctly with VSCode.

      The capabilities are correctly detected by QtCreator.

      Analysis

      The filtering logic in `
      SemanticTokenSupport::supportedSemanticRequests` seems to be inverted. A semantic token request will not be sent to a document matching the specified filter (MIME type, pattern, any) but will be sent to a non-matching document.
      This has been verified by changing the documentSelector pattern on server side.
       
      Also changing

      if (docOptions.isValid()
          && docOptions.filterApplies(...))

      to

      if (!docOptions.isValid()
           || docOptions.filterApplies(...))  

      in the `supportedRequests` lambda seems to resolve the issue.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            davschul David Schulz
            t6tb7n t6t b7n
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes