Documentation

Lean.Server.FileWorker.SemanticHighlighting

SyntaxNodeKinds for which the syntax node and its children receive no semantic highlighting.

Equations
Instances For
    Equations
    Instances For

      Keywords for which a specific semantic token is provided.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Semantic token information for a source range.

        Instances For

          The semantic token for the source range of stx, if it has one.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Semantic token information with absolute LSP positions.

            Instances For
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Given a set of LeanSemanticToken, computes the AbsoluteLspSemanticToken with absolute LSP position information for each token.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        Eliminates overlapping tokens by selecting a single “best” token for each interval between token boundaries.

                        While LSP allows clients to state they they can handle overlapping tokens, widely used clients such as VS Code cannot handle them. Thus, we need to make them non-overlapping (this strictly generalizes removal of duplicates).

                        Given tokens A, B, C, D as in:

                        |-----A------|  |----D----|
                            |------B----------|
                                |----C----|
                        

                        with priorities C > B, B > A, B > D, we want to emit the tokens:

                        |-A-|-B-|----C----|-B-|-D--|
                        

                        In other words, B is split into two regions: before and after C.

                        If two overlapping tokens have the same priority, then ties are broken as follows:

                        • If the tokens start at the same position, then the shorter one is used.
                        • If they have the same start position and are the same length, then the one that occurs later in the original input array is used.
                        • If a new token starts in the middle of an existing one, and they have the same priority, then the new token is used.

                        Callers should ensure that all tokens in tokens designate non-empty regions of the file. In other words, it should be true that ∀ t ∈ tokens, t.pos < t.tailPos.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For

                          Given a set of AbsoluteLspSemanticToken, computes the LSP SemanticTokens data with token-relative positioning. See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            Markdown highlighting #

                            Traverses the result of the full Markdown parse (Lean.Markdown.parseDocument, which runs both passes) and emits LeanSemanticTokens.

                            Collects semantic tokens for a Markdown docstring. Markup syntax (bold/italic delimiters, #, >, list markers, fences) consists of keyword tokens with the markupSyntax modifier; URLs are markupUrl; code block contents are markupCodeBlock; and text is markupText, markupHeading, markupQuote, or markupList by its block context, with the markupBold and markupItalic modifiers for emphasis.

                            Every token receives the documentation modifier because Markdown semantic tokens occur only in docstrings.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              Collects all semantic tokens that can be deduced purely from Syntax without elaboration information.

                              Collects all semantic tokens from the given Elab.InfoTree.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                A debugging utility for inspecting sets of collected tokens, classified by line and sorted by column.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For

                                    Computes all semantic tokens for the document.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      Computes the semantic tokens in the range provided by p.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For