Closed MartenBE closed 6 years ago
vscode-html-languageserver-bin
only handle Range Formatting and not textDocument/formatting
, however you can send a Range Formatting request with the full file as Range
Language server issue. Closing.
Aha I see, I will do that. @DeltaEvo, is this also the case for the css and json vscode languageservers?
bin/languageclient --version
to get its version number. Yes, I've used ":PlugUpdate":languageclient 0.1.94
:checkhealth LanguageClient
? YesIf you are still experiencing an issue, please create ticket with
Summary
When formatting an HTML file, neovim returns an
Unhandled method
error. However, https://github.com/vscode-langservers/vscode-html-languageserver-bin/blob/master/README.md describes that formatting is enabled.Reproduction
nvim --version
orvim --version
):Features: +acl +iconv +jemalloc +tui See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
set hidden set signcolumn=yes
let g:LanguageClient_loggingFile = '/tmp/LanguageClient.log' let g:LanguageClient_loggingLevel = 'INFO' let g:LanguageClient_serverStderr = '/tmp/LanguageServer.log' let g:LanguageClient_autoStart = 1 let g:LanguageClient_serverCommands = {}
if executable('html-languageserver') let g:LanguageClient_serverCommands.html = ['html-languageserver', '--stdio'] " npm install -g vscode-html-languageserver-bin autocmd FileType html nnoremapf :call LanguageClient_textDocument_formatting()
else
echo "LSP: html-languageserver not installed!\n"
endif
12:16:49 INFO main src/vim.rs:90 => None {"jsonrpc":"2.0","method":"eval","params":["[!!get(g:, 'LanguageClient_autoStart', 1), get(g:, 'LanguageClient_serverCommands', {}), get(g:, 'LanguageClient_selectionUI', v:null), get(g:, 'LanguageClient_trace', v:null), get(g:, 'LanguageClient_settingsPath', '.vim/settings.json'), !!get(g:, 'LanguageClient_loadSettings', 1), get(g:, 'LanguageClient_rootMarkers', v:null), get(g:, 'LanguageClient_changeThrottle', v:null), get(g:, 'LanguageClient_waitOutputTimeout', v:null), !!get(g:, 'LanguageClient_diagnosticsEnable', 1), get(g:, 'LanguageClient_diagnosticsList', 'Quickfix'), get(g:, 'LanguageClient_diagnosticsDisplay', {}), get(g:, 'LanguageClient_windowLogMessageLevel', 'Warning'), get(g:, 'LanguageClient_hoverPreview', 'Auto'), get(g:, 'LanguageClient_completionPreferTextEdit', 0), has('nvim')]"],"id":4} 12:16:49 INFO reader-main src/vim.rs:386 <= None {"id": 4, "jsonrpc": "2.0", "result": [1, {"c": ["clangd"], "json": ["json-languageserver", "--stdio"], "javascript": ["javascript-typescript-stdio"], "html": ["html-languageserver", "--stdio"], "cpp": ["clangd"], "css": ["css-languageserver", "--stdio"], "python": ["docker-langserver", "--stdio"]}, null, null, ".vim/settings.json", 1, null, null, null, 1, "Quickfix", {}, "Warning", "Auto", 0, 1]} 12:16:49 INFO main src/vim.rs:90 => None {"jsonrpc":"2.0","method":"eval","params":["[get(g:, 'LanguageClient_diagnosticsSignsMax', v:null)]"],"id":5} 12:16:49 INFO reader-main src/vim.rs:386 <= None {"id": 5, "jsonrpc": "2.0", "result": [null]} 12:16:49 INFO main src/vim.rs:90 => None {"jsonrpc":"2.0","method":"eval","params":["get(g:, 'loaded_fzf')"],"id":6} 12:16:49 INFO reader-main src/vim.rs:386 <= None {"id": 6, "jsonrpc": "2.0", "result": 1} 12:16:49 INFO main src/languageclient.rs:2538 End languageClient/startServer 12:16:49 INFO main src/languageclient.rs:219 Define signs 12:16:49 INFO main src/vim.rs:90 => None {"jsonrpc":"2.0","method":"execute","params":["echo | execute 'sign define LanguageClientHint text=➤ texthl=ALEInfoSign' | execute 'sign define LanguageClientWarning text=⚠ texthl=ALEWarningSign' | execute 'sign define LanguageClientError text=✖ texthl=ALEErrorSign' | execute 'sign define LanguageClientInformation text=ℹ texthl=ALEInfoSign'"],"id":7} 12:16:49 INFO reader-main src/vim.rs:386 <= None {"id": 7, "jsonrpc": "2.0", "result": 0} 12:16:49 INFO main src/languageclient.rs:233 Define signs 12:16:49 INFO main src/languageclient.rs:654 Begin initialize 12:16:49 INFO main src/languageclient.rs:46 gather_args: [LanguageId, Filename] = [String("html"), String("/home/martijn/Desktop/test.html")] 12:16:49 INFO main src/languageclient.rs:29 Some arguments are not available. Requesting from vim. Keys: ["rootPath", "hasSnippetSupport"]. Exps: ["v:null", "s:hasSnippetSupport()"] 12:16:49 INFO main src/vim.rs:90 => None {"jsonrpc":"2.0","method":"eval","params":["[v:null, s:hasSnippetSupport()]"],"id":8} 12:16:49 INFO reader-main src/vim.rs:386 <= None {"id": 8, "jsonrpc": "2.0", "result": [null, 0]} 12:16:49 INFO main src/languageclient.rs:46 gather_args: [("rootPath", "v:null"), ("hasSnippetSupport", "s:hasSnippetSupport()")] = [Null, Number(0)] 12:16:49 INFO main src/vim.rs:90 => None {"jsonrpc":"2.0","method":"s:Echomsg","params":["LanguageClient project root: /home/martijn"],"id":9} 12:16:49 INFO reader-main src/vim.rs:386 <= None {"id": 9, "jsonrpc": "2.0", "result": 0} 12:16:49 INFO main src/languageclient.rs:674 Project root: /home/martijn 12:16:49 WARN main src/languageclient.rs:681 Failed to get initializationOptions: No such file or directory (os error 2) 12:16:49 INFO main src/vim.rs:90 => Some("html") {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"completion":{"completionItem":{"snippetSupport":false}}},"workspace":{"applyEdit":true,"didChangeWatchedFiles":{"dynamicRegistration":true}}},"processId":32266,"rootPath":"/home/martijn","rootUri":"file:///home/martijn","trace":"off"},"id":10} 12:16:50 INFO reader-html src/vim.rs:386 <= Some("html") {"jsonrpc":"2.0","id":10,"result":{"capabilities":{"textDocumentSync":1,"hoverProvider":true,"documentHighlightProvider":true,"documentRangeFormattingProvider":false,"documentLinkProvider":{"resolveProvider":false},"documentSymbolProvider":true,"definitionProvider":true,"signatureHelpProvider":{"triggerCharacters":["("]},"referencesProvider":true,"colorProvider":{},"foldingRangeProvider":true}}} 12:16:50 INFO main src/languageclient.rs:733 End initialize 12:16:50 INFO main src/languageclient.rs:511 Begin register NCM source 12:16:50 INFO main src/vim.rs:90 => None {"jsonrpc":"2.0","method":"eval","params":["exists('g:cm_matcher')"],"id":11} 12:16:50 INFO reader-main src/vim.rs:386 <= None {"id": 11, "jsonrpc": "2.0", "result": 0} 12:16:50 INFO main src/languageclient.rs:744 Begin initialized 12:16:50 INFO main src/languageclient.rs:46 gather_args: [LanguageId] = [String("html")] 12:16:50 INFO main src/vim.rs:90 => Some("html") {"jsonrpc":"2.0","method":"initialized","params":{}} 12:16:50 INFO main src/languageclient.rs:751 End initialized 12:16:50 WARN main src/languageclient.rs:2554 Failed to get workspace settings: No such file or directory (os error 2) 12:16:50 INFO main src/languageclient.rs:1516 Begin textDocument/didOpen 12:16:50 INFO main src/languageclient.rs:29 Some arguments are not available. Requesting from vim. Keys: ["text"]. Exps: ["LSP#text()"] 12:16:50 INFO main src/vim.rs:90 => None {"jsonrpc":"2.0","method":"eval","params":["[LSP#text()]"],"id":12} 12:16:50 INFO reader-main src/vim.rs:386 <= None {"id": 12, "jsonrpc": "2.0", "result": [["<!DOCTYPE html>", "", "
", "<meta charset=\"UTF-8\">", "Message: {"jsonrpc":"2.0","method":"textDocument/formatting","params":{"buftype":"","character":0,"filename":"/home/martijn/Desktop/test.html","handle":true,"languageId":"html","line":0,"text":["<!DOCTYPE html>","","
","<meta charset=\"UTF-8\">","Error: ErrorMessage { msg: "Unhandled method textDocument/formatting" } 12:16:52 INFO main src/vim.rs:90 => None {"jsonrpc":"2.0","error":{"code":-32603,"message":"Unhandled method textDocument/formatting"},"id":1}