You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Quick Documentation: show a late hover reply in a file whose language registers no documentation provider #2129
Since #2020, Quick Documentation (Ctrl+Q, F1) waits at most 500 ms for the textDocument/hover reply in a file that isn't a plain text, TextMate or abstract file type file. A later reply shows only the next time at the same offset.
The limit is there so that a target whose reply has no documentation doesn't hide the file's own documentation. IntelliJ shows that only if no DocumentationTargetProvider returns a target: documentationTargets in com.intellij.lang.documentation.impl falls back to psiDocumentationTargets when the list is empty.
A plugin can define a language and a file type for its parser, highlighting and structure view, and leave documentation to its language server. Its files then have no documentation of their own to hide, but they still get the 500 ms limit. When the server is slow, Quick Documentation shows nothing, and the user has to ask again. A typical slow reply is the first hover after a restart, which waits for the server to analyze the file.
Steps
A plugin defines a language with a file type and a parser definition, and registers no lang.documentationProvider for it.
A language server for its files answers textDocument/hover after more than 500 ms.
Press Ctrl+Q on a word in one of its files.
Nothing shows. A second Ctrl+Q shows the reply.
Expected
The same as in a plain text file: the popup opens and shows the reply when it comes (LSPPendingHoverDocumentationTarget).
Suggested change
In LSPDocumentationTargetProvider.hasNoDocumentationOfItsOwn, also count a file whose languages register no documentation provider: LanguageDocumentation.INSTANCE.allForLanguage(language) is empty for each language of the file's view provider.
allForLanguage leaves out the providers registered for any language, such as LSP4IJ's LSPDocumentLinkDocumentationProvider and LSPSemanticTokenDocumentationProvider.
LSPFormattingFeature.isEnabled decides in the same way whether a file has a formatter of its own: it checks LanguageFormatting.INSTANCE.forContext(file).
The check can't see two kinds of provider:
a provider registered for any language (documentationProvider);
a platform.backend.documentation.psiTargetProvider.
If the reply then has no documentation, the pending target hides theirs, as it already does in a plain text file. If that is a concern, a hook on LSPHoverFeature could let a client decide instead, as LSPFormattingFeature.isExistingFormatterOverrideable does for formatting.
Activity
Register UP82 as filed: the enhancement redhat-developer/lsp4ij#2129,…
feat: show a late hover reply in a file whose languages register no d…
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Register UP82 as filed: the enhancement redhat-developer/lsp4ij#2129,…
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Register UP82 as filed: the enhancement redhat-developer/lsp4ij#2129,…
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Register UP82 as filed: the enhancement redhat-developer/lsp4ij#2129,…
4 remaining items
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Register UP82 as filed: the enhancement redhat-developer/lsp4ij#2129,…
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Register UP82 as filed: the enhancement redhat-developer/lsp4ij#2129,…
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Register UP82 as filed: the enhancement redhat-developer/lsp4ij#2129,…
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …
Show an Ecstasy hover that takes LSP4IJ 0.30.1 longer than 500 ms in …