Merge pull request #1122 from arp242/prefer-text

Use plain text if the client tells zls it's preferred
This commit is contained in:
Lee Cannon 2023-04-13 13:13:15 +01:00 committed by GitHub
commit fe4c9d5a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -399,6 +399,9 @@ fn initializeHandler(server: *Server, request: types.InitializeParams) Error!typ
if (textDocument.hover) |hover| { if (textDocument.hover) |hover| {
if (hover.contentFormat) |content_format| { if (hover.contentFormat) |content_format| {
for (content_format) |format| { for (content_format) |format| {
if (format == .plaintext) {
break;
}
if (format == .markdown) { if (format == .markdown) {
server.client_capabilities.hover_supports_md = true; server.client_capabilities.hover_supports_md = true;
break; break;
@ -412,6 +415,9 @@ fn initializeHandler(server: *Server, request: types.InitializeParams) Error!typ
server.client_capabilities.supports_snippets = completionItem.snippetSupport orelse false; server.client_capabilities.supports_snippets = completionItem.snippetSupport orelse false;
if (completionItem.documentationFormat) |documentation_format| { if (completionItem.documentationFormat) |documentation_format| {
for (documentation_format) |format| { for (documentation_format) |format| {
if (format == .plaintext) {
break;
}
if (format == .markdown) { if (format == .markdown) {
server.client_capabilities.completion_doc_supports_md = true; server.client_capabilities.completion_doc_supports_md = true;
break; break;