Closed BorisCarvajal closed 5 years ago
Found the source of the problem: lsp-mode (and neovim-languageclient when opening a single file) don't set a language id when sending requests to open files. DLS internally only keeps contents of files with a language id of d
or D
, which is why it doesn't save any changes afterwards and only uses the on-disk files.
I'll simply lift the language id requirement, it's no big deal to be saving the contents of a few non D files.
EDIT: it seems that language clients usually only send document opening request for files that the server can handle anyway, for example lsp-mode and vscode-language-client only notify DLS about D files.
First thanks for this awesome tool!
I'm using emacs with lsp-mode. For example, if I create a file:
then add a line:
v.
and try code completion. I get this error from server (set lsp-print-io variable to get client/server messages):but if I save the file to disk right at that point and try again it works, completion for alignof, dup, idup, length, etc. appears. Now editing and trying completion again:
same error. Looking at the logs there are indeed some "textDocument/didChange" messages with my edits but the server just sees the file as it is on disk. I also tried Vim with the recommended config but the same behavior happens.