Skip to content

Idea: CompletionItem.HelpLink #1962

Open

Description

@KalleOlaviNiemitalo

CompletionItem could have a string HelpLink property for a documentation URI. The type and name would be consistent with dotnet/msbuild#5488. Help could then render this as an OSC 8 hyperlink (microsoft/terminal#204), although doing so would complicate the width measurement during two-column layout and line breaking.

On the other hand, as long as class CompletionItem remains unsealed, this can be implemented in application code.

CompletionItem in Language Server Protocol (LSP) does not appear to have this feature.

Activity

  1. KalleOlaviNiemitalo commented on Nov 12, 2022

    @KalleOlaviNiemitalo
    Author

    Ugh, if the renderer breaks a line within a hyperlink in a two-column table, then it needs to output an OSC to pause the hyperlink, to prevent it from affecting the other column; and then another OSC to resume the hyperlink at the next line. So it is not enough if the line breaker gets SGR and OSC…ST sequences in its input and parses them just enough to understand that they do not consume any width. I think there are three API strategies:

    • Parse SGR and OSC…ST more fully in the line breaker, and generate more of the same, to reset the attributes at the end of each line and restore the custom attributes at the start of the next line. This would always be out of date as terminals define new attributes and app developers start using them.
    • As above but make it pluggable so each app can provide parser/renderer for those attributes that it uses.
    • Feed a sequence of (string visibleText, string startAttribute, string endAttribute) tuples to the line breaker. Then it can break anywhere within visibleText (although preferably in whitespace) as long as it outputs the attribute strings as well. This would be public in TwoColumnHelpRow.
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions