Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: CompletionItem.HelpLink #1962

Open
KalleOlaviNiemitalo opened this issue Nov 12, 2022 · 1 comment
Open

Idea: CompletionItem.HelpLink #1962

KalleOlaviNiemitalo opened this issue Nov 12, 2022 · 1 comment

Comments

@KalleOlaviNiemitalo
Copy link

KalleOlaviNiemitalo commented Nov 12, 2022

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.

@KalleOlaviNiemitalo
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant