neovim / nvim-lspconfig

Quickstart configs for Nvim LSP
Apache License 2.0
10.64k stars 2.08k forks source link

pylsp black/isort formatting does not work #903

Closed carrascomj closed 3 years ago

carrascomj commented 3 years ago

How to reproduce the problem from neovim startup

Add this and load it in your config:


require"lspconfig".pylsp.setup {
    filetypes = {"python"},
    settings = {
        configurationSources = {"flake8"},
    formatCommand = {"black"}
    }
}

Then open a python file and, in command mode (:), run

:lua vim.lsp.buf.formatting()

Actual behaviour

No formatting occurs, sometimes this error is produced:

code_name = MethodNotFound, message = "method textDocument/formatting is not supported by any of the servers registered for the current buffer"

Apart from that, flake8 is not repecting my setup.cfg and returns the warnings from the default parameters.

Expected behaviour

With pyls-black installed, I would expect to run black on vim.lsp.buf.formatting(), but that's not the case. I guess that this is not implemented for pylsp and it may be hard since it is using its own plugins to handle formatting.

The same holds for pyls-isort.

Minimal init.vim or init.lua and code sample

Health check

Checkhealth result health#lspconfig#check ======================================================================== ## Checking language server protocol configuration - INFO: dockerls: configuration checked. - INFO: pylsp: configuration checked. - INFO: jsonls: configuration checked. - INFO: rust_analyzer: configuration checked. - INFO: sumneko_lua: configuration checked.

LSP log

Log file [ START ] 2021-05-13T12:57:08+0200 ] LSP logging initiated [ INFO ] 2021-05-13T12:57:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:311 ] "Starting RPC client" { args = {}, cmd = "pylsp", extra = {}} [ DEBUG ] 2021-05-13T12:57:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:819 ] "LSP[pylsp]" "initialize_params" { capabilities = { callHierarchy = { dynamicRegistration = false, = <1>{ __tostring = } }, textDocument = { codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }, = }, =
}, dynamicRegistration = false, =
}, completion = { completionItem = { commitCharactersSupport = false, deprecatedSupport = false, documentationFormat = { "markdown", "plaintext" }, preselectSupport = false, snippetSupport = false, =
}, completionItemKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, =
}, contextSupport = false, dynamicRegistration = false, =
}, declaration = { linkSupport = true, =
}, definition = { linkSupport = true, =
}, documentHighlight = { dynamicRegistration = false, =
}, documentSymbol = { dynamicRegistration = false, hierarchicalDocumentSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }, =
}, =
}, hover = { contentFormat = { "markdown", "plaintext" }, dynamicRegistration = false, =
}, implementation = { linkSupport = true, =
}, publishDiagnostics = { relatedInformation = true, tagSupport = { valueSet = { 1, 2 }, =
}, =
}, references = { dynamicRegistration = false, =
}, rename = { dynamicRegistration = false, prepareSupport = true, =
}, signatureHelp = { dynamicRegistration = false, signatureInformation = { documentationFormat = { "markdown", "plaintext" }, =
}, =
}, synchronization = { didSave = true, dynamicRegistration = false, willSave = false, willSaveWaitUntil = false, =
}, typeDefinition = { linkSupport = true, =
}, =
}, window = { showDocument = { support = false, =
}, showMessage = { messageActionItem = { additionalPropertiesSupport = false, =
}, =
}, workDoneProgress = true, =
}, workspace = { applyEdit = true, configuration = true, symbol = { dynamicRegistration = false, hierarchicalWorkspaceSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }, =
}, =
}, workspaceEdit = { resourceOperations = { "rename", "create", "delete" }, =
}, workspaceFolders = true, =
} }, clientInfo = { name = "Neovim", version = "0.5.0" }, initializationOptions = vim.empty_dict(), processId = 1138576, rootPath = "/home/georg/GIT/dynamic-fba", rootUri = "file:///home/georg/GIT/dynamic-fba", trace = "off", workspaceFolders = { { name = "/home/georg/GIT/dynamic-fba", uri = "file:///home/georg/GIT/dynamic-fba" } }} [ DEBUG ] 2021-05-13T12:57:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { id = 1, jsonrpc = "2.0", method = "initialize", params = { capabilities = { callHierarchy = { dynamicRegistration = false, = <1>{ __tostring = } }, textDocument = { codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }, =
}, =
}, dynamicRegistration = false, =
}, completion = { completionItem = { commitCharactersSupport = false, deprecatedSupport = false, documentationFormat = { "markdown", "plaintext" }, preselectSupport = false, snippetSupport = false, =
}, completionItemKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, =
}, contextSupport = false, dynamicRegistration = false, =
}, declaration = { linkSupport = true, =
}, definition = { linkSupport = true, =
}, documentHighlight = { dynamicRegistration = false, =
}, documentSymbol = { dynamicRegistration = false, hierarchicalDocumentSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }, =
}, =
}, hover = { contentFormat = { "markdown", "plaintext" }, dynamicRegistration = false, =
}, implementation = { linkSupport = true, =
}, publishDiagnostics = { relatedInformation = true, tagSupport = { valueSet = { 1, 2 }, =
}, =
}, references = { dynamicRegistration = false, =
}, rename = { dynamicRegistration = false, prepareSupport = true, =
}, signatureHelp = { dynamicRegistration = false, signatureInformation = { documentationFormat = { "markdown", "plaintext" }, =
}, =
}, synchronization = { didSave = true, dynamicRegistration = false, willSave = false, willSaveWaitUntil = false, =
}, typeDefinition = { linkSupport = true, =
}, =
}, window = { showDocument = { support = false, =
}, showMessage = { messageActionItem = { additionalPropertiesSupport = false, =
}, =
}, workDoneProgress = true, =
}, workspace = { applyEdit = true, configuration = true, symbol = { dynamicRegistration = false, hierarchicalWorkspaceSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }, =
}, =
}, workspaceEdit = { resourceOperations = { "rename", "create", "delete" }, =
}, workspaceFolders = true, =
} }, clientInfo = { name = "Neovim", version = "0.5.0" }, initializationOptions = vim.empty_dict(), processId = 1138576, rootPath = "/home/georg/GIT/dynamic-fba", rootUri = "file:///home/georg/GIT/dynamic-fba", trace = "off", workspaceFolders = { { name = "/home/georg/GIT/dynamic-fba", uri = "file:///home/georg/GIT/dynamic-fba" } } }} [ ERROR ] 2021-05-13T12:57:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc" "pylsp" "stderr" "2021-05-13 12:57:14,594 UTC - WARNING - pylsp.config.config - Failed to load pylsp entry point 'autopep8': No module named 'autopep8'\n" [ ERROR ] 2021-05-13T12:57:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc" "pylsp" "stderr" "2021-05-13 12:57:14,676 UTC - WARNING - pylsp.config.config - Failed to load pylsp entry point 'pylint': No module named 'pylint'\n" [ ERROR ] 2021-05-13T12:57:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc" "pylsp" "stderr" "2021-05-13 12:57:14,677 UTC - WARNING - pylsp.config.config - Failed to load pylsp entry point 'rope_completion': No module named 'rope'\n" [ ERROR ] 2021-05-13T12:57:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc" "pylsp" "stderr" "2021-05-13 12:57:14,679 UTC - WARNING - pylsp.config.config - Failed to load pylsp entry point 'rope_rename': No module named 'rope'\n" [ ERROR ] 2021-05-13T12:57:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc" "pylsp" "stderr" "2021-05-13 12:57:14,680 UTC - WARNING - pylsp.config.config - Failed to load pylsp entry point 'yapf': No module named 'yapf'\n" [ DEBUG ] 2021-05-13T12:57:15+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:491 ] "decoded" { id = 1, jsonrpc = "2.0", result = { capabilities = { codeActionProvider = true, codeLensProvider = { resolveProvider = false }, completionProvider = { resolveProvider = false, triggerCharacters = { "." } }, definitionProvider = true, documentFormattingProvider = true, documentHighlightProvider = true, documentRangeFormattingProvider = true, documentSymbolProvider = true, executeCommandProvider = { commands = {} }, experimental = vim.empty_dict(), foldingRangeProvider = true, hoverProvider = true, referencesProvider = true, renameProvider = true, signatureHelpProvider = { triggerCharacters = { "(", ",", "=" } }, textDocumentSync = { change = 2, openClose = true, save = { includeText = true } }, workspace = { workspaceFolders = { changeNotifications = true, supported = true } } } }} [ DEBUG ] 2021-05-13T12:57:15+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "initialized", params = { [true] = 6 }} [ DEBUG ] 2021-05-13T12:57:15+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "workspace/didChangeConfiguration", params = { settings = { configurationSources = { "flake8" }, formatCommand = { "isort" }, = { __tostring = } } }} [ DEBUG ] 2021-05-13T12:57:15+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:846 ] "LSP[pylsp]" "server_capabilities" { codeActionProvider = true, codeLensProvider = { resolveProvider = false }, completionProvider = { resolveProvider = false, triggerCharacters = { "." } }, definitionProvider = true, documentFormattingProvider = true, documentHighlightProvider = true, documentRangeFormattingProvider = true, documentSymbolProvider = true, executeCommandProvider = { commands = {} }, experimental = {}, foldingRangeProvider = true, hoverProvider = true, referencesProvider = true, renameProvider = true, signatureHelpProvider = { triggerCharacters = { "(", ",", "=" } }, textDocumentSync = { change = 2, openClose = true, save = { includeText = true } }, workspace = { workspaceFolders = { changeNotifications = true, supported = true } }} [ INFO ] 2021-05-13T12:57:15+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:847 ] "LSP[pylsp]" "initialized" { resolved_capabilities = { call_hierarchy = false, code_action = true, code_lens = true, code_lens_resolve = false, completion = true, declaration = false, document_formatting = true, document_highlight = true, document_range_formatting = true, document_symbol = true, execute_command = true, find_references = true, goto_definition = true, hover = true, implementation = false, rename = true, signature_help = true, signature_help_trigger_characters = { "(", ",", "=" }, text_document_did_change = 2, text_document_open_close = true, text_document_save = { includeText = true }, text_document_save_include_text = true, text_document_will_save = false, text_document_will_save_wait_until = false, type_definition = false, workspace_folder_properties = { changeNotifications = true, supported = true }, workspace_symbol = false }} [ DEBUG ] 2021-05-13T12:57:15+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didOpen", params = { textDocument = { languageId = "python", text = '# Copyright (C) 2018, 2019 Columbia University Irving Medical Center,\n# New York, USA\n# Copyright (C) 2019 Novo Nordisk Foundation Center for Biosustainability,\n# Technical University of Denmark\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n\n"""Definition of `KineticVariable` class."""\n\nfrom numbers import Number\nfrom typing import Union\n\nfrom optlang import symbolics\n\nfrom .types import Expression\n\n\nclass KineticVariable(symbolics.Symbol):\n """Class for holding information for a kinetic variable in a `DfbaModel` object.\n\n Attributes\n ----------\n id: string\n The identifier to associate with this kinetic variable.\n\n rhs_expression: optlang.symbolics expression\n The symbolic expression for calculating derivative of this kinetic\n variable wrt time.\n\n initital_condition: int or float\n The initial value of this kinetic variable to be used at start of\n simulation.\n\n """\n\n def __init__(self, name: str, initial_condition: Number = 0.0, *args, **kwargs):\n """`symbolics.Symbol` with rhs expression to be added."""\n symbolics.Symbol.__init__(self, name, *args, **kwargs)\n self._id = name\n self.initial_condition = initial_condition\n self.rhs_expression = None\n\n @property\n def id(self) -> str:\n """For convenience, synonym with .name from `symbolics.Symbol`."""\n return self._id\n\n @property\n def rhs_expression(self) -> Union[Expression, None]:\n """Relate the rhs expression to some symbolic expression."""\n return self._rhs_expression\n\n @property\n def initial_condition(self) -> Number:\n """Relate the ininital condition to some int or float value."""\n return self._initial_condition\n\n @rhs_expression.setter\n def rhs_expression(self, expression: Expression) -> None:\n self._rhs_expression = expression\n\n @initial_condition.setter\n def initial_condition(self, value: Expression) -> None:\n if not isinstance(value, (int, float)):\n raise Exception(\n f"Error: initial condition for kinetic variable {self.id} must"\n f"be int or float!"\n )\n self._initial_condition = value\n', uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py", version = 0 } }} [ DEBUG ] 2021-05-13T12:57:15+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:442 ] "default_handler" "textDocument/publishDiagnostics" { client_id = 1, params = { diagnostics = {}, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:16+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:491 ] "decoded" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:16+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:672 ] "notification" "textDocument/publishDiagnostics" { diagnostics = { { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py"} [ DEBUG ] 2021-05-13T12:57:16+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:442 ] "default_handler" "textDocument/publishDiagnostics" { client_id = 1, params = { diagnostics = { { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:19+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:887 ] "LSP[pylsp]" "client.request" 1 "textDocument/formatting" { options = { insertSpaces = true, tabSize = 4 }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} 1 [ DEBUG ] 2021-05-13T12:57:19+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { id = 2, jsonrpc = "2.0", method = "textDocument/formatting", params = { options = { insertSpaces = true, tabSize = 4 }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" } }} [ DEBUG ] 2021-05-13T12:57:19+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:491 ] "decoded" { id = 2, jsonrpc = "2.0", result = vim.NIL} [ DEBUG ] 2021-05-13T12:57:19+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:442 ] "default_handler" "textDocument/formatting" { bufnr = 1, client_id = 1} [ DEBUG ] 2021-05-13T12:57:26+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:991 ] "on_lines bufnr: 1, changedtick: 5, firstline: 25, lastline: 26, new_lastline: 26, old_byte_size: 30, old_utf32_size: 30, old_utf16_size: 30" { "from .types import Expression " } [ DEBUG ] 2021-05-13T12:57:26+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { end = { character = 29, line = 25 }, start = { character = 29, line = 25 } }, rangeLength = 0, text = " " } }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py", version = 5 } }} [ DEBUG ] 2021-05-13T12:57:26+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:991 ] "on_lines bufnr: 1, changedtick: 6, firstline: 25, lastline: 26, new_lastline: 26, old_byte_size: 31, old_utf32_size: 31, old_utf16_size: 31" { "from .types import Expression " } [ DEBUG ] 2021-05-13T12:57:26+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { end = { character = 30, line = 25 }, start = { character = 30, line = 25 } }, rangeLength = 0, text = " " } }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py", version = 6 } }} [ DEBUG ] 2021-05-13T12:57:26+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:991 ] "on_lines bufnr: 1, changedtick: 7, firstline: 25, lastline: 26, new_lastline: 26, old_byte_size: 32, old_utf32_size: 32, old_utf16_size: 32" { "from .types import Expression " } [ DEBUG ] 2021-05-13T12:57:26+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { end = { character = 31, line = 25 }, start = { character = 31, line = 25 } }, rangeLength = 0, text = " " } }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py", version = 7 } }} [ DEBUG ] 2021-05-13T12:57:26+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:991 ] "on_lines bufnr: 1, changedtick: 8, firstline: 25, lastline: 26, new_lastline: 26, old_byte_size: 33, old_utf32_size: 33, old_utf16_size: 33" { "from .types import Expression " } [ DEBUG ] 2021-05-13T12:57:26+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { end = { character = 32, line = 25 }, start = { character = 32, line = 25 } }, rangeLength = 0, text = " " } }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py", version = 8 } }} [ DEBUG ] 2021-05-13T12:57:27+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:491 ] "decoded" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { code = "W291", message = "W291 trailing whitespace", range = { end = { character = 34, line = 25 }, start = { character = 29, line = 25 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:27+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:672 ] "notification" "textDocument/publishDiagnostics" { diagnostics = { { code = "W291", message = "W291 trailing whitespace", range = { end = { character = 34, line = 25 }, start = { character = 29, line = 25 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py"} [ DEBUG ] 2021-05-13T12:57:27+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:442 ] "default_handler" "textDocument/publishDiagnostics" { client_id = 1, params = { diagnostics = { { code = "W291", message = "W291 trailing whitespace", range = { end = { character = 34, line = 25 }, start = { character = 29, line = 25 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:27+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didSave", params = { text = '# Copyright (C) 2018, 2019 Columbia University Irving Medical Center,\n# New York, USA\n# Copyright (C) 2019 Novo Nordisk Foundation Center for Biosustainability,\n# Technical University of Denmark\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n\n"""Definition of `KineticVariable` class."""\n\nfrom numbers import Number\nfrom typing import Union\n\nfrom optlang import symbolics\n\nfrom .types import Expression \n\n\nclass KineticVariable(symbolics.Symbol):\n """Class for holding information for a kinetic variable in a `DfbaModel` object.\n\n Attributes\n ----------\n id: string\n The identifier to associate with this kinetic variable.\n\n rhs_expression: optlang.symbolics expression\n The symbolic expression for calculating derivative of this kinetic\n variable wrt time.\n\n initital_condition: int or float\n The initial value of this kinetic variable to be used at start of\n simulation.\n\n """\n\n def __init__(self, name: str, initial_condition: Number = 0.0, *args, **kwargs):\n """`symbolics.Symbol` with rhs expression to be added."""\n symbolics.Symbol.__init__(self, name, *args, **kwargs)\n self._id = name\n self.initial_condition = initial_condition\n self.rhs_expression = None\n\n @property\n def id(self) -> str:\n """For convenience, synonym with .name from `symbolics.Symbol`."""\n return self._id\n\n @property\n def rhs_expression(self) -> Union[Expression, None]:\n """Relate the rhs expression to some symbolic expression."""\n return self._rhs_expression\n\n @property\n def initial_condition(self) -> Number:\n """Relate the ininital condition to some int or float value."""\n return self._initial_condition\n\n @rhs_expression.setter\n def rhs_expression(self, expression: Expression) -> None:\n self._rhs_expression = expression\n\n @initial_condition.setter\n def initial_condition(self, value: Expression) -> None:\n if not isinstance(value, (int, float)):\n raise Exception(\n f"Error: initial condition for kinetic variable {self.id} must"\n f"be int or float!"\n )\n self._initial_condition = value\n', textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" } }} [ DEBUG ] 2021-05-13T12:57:28+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:491 ] "decoded" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { code = "W291", message = "W291 trailing whitespace", range = { end = { character = 34, line = 25 }, start = { character = 29, line = 25 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:28+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:672 ] "notification" "textDocument/publishDiagnostics" { diagnostics = { { code = "W291", message = "W291 trailing whitespace", range = { end = { character = 34, line = 25 }, start = { character = 29, line = 25 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py"} [ DEBUG ] 2021-05-13T12:57:28+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:442 ] "default_handler" "textDocument/publishDiagnostics" { client_id = 1, params = { diagnostics = { { code = "W291", message = "W291 trailing whitespace", range = { end = { character = 34, line = 25 }, start = { character = 29, line = 25 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:29+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:887 ] "LSP[pylsp]" "client.request" 1 "textDocument/formatting" { options = { insertSpaces = true, tabSize = 4 }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} 1 [ DEBUG ] 2021-05-13T12:57:29+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { id = 3, jsonrpc = "2.0", method = "textDocument/formatting", params = { options = { insertSpaces = true, tabSize = 4 }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" } }} [ DEBUG ] 2021-05-13T12:57:29+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:491 ] "decoded" { id = 3, jsonrpc = "2.0", result = vim.NIL} [ DEBUG ] 2021-05-13T12:57:29+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:442 ] "default_handler" "textDocument/formatting" { bufnr = 1, client_id = 1} [ DEBUG ] 2021-05-13T12:57:34+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:991 ] "on_lines bufnr: 1, changedtick: 10, firstline: 25, lastline: 26, new_lastline: 26, old_byte_size: 34, old_utf32_size: 34, old_utf16_size: 34" { "from .types import Expression " } [ DEBUG ] 2021-05-13T12:57:34+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { end = { character = 33, line = 25 }, start = { character = 32, line = 25 } }, rangeLength = 1, text = "" } }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py", version = 10 } }} [ DEBUG ] 2021-05-13T12:57:34+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:991 ] "on_lines bufnr: 1, changedtick: 11, firstline: 25, lastline: 26, new_lastline: 26, old_byte_size: 33, old_utf32_size: 33, old_utf16_size: 33" { "from .types import Expression " } [ DEBUG ] 2021-05-13T12:57:34+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { end = { character = 32, line = 25 }, start = { character = 31, line = 25 } }, rangeLength = 1, text = "" } }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py", version = 11 } }} [ DEBUG ] 2021-05-13T12:57:34+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:991 ] "on_lines bufnr: 1, changedtick: 12, firstline: 25, lastline: 26, new_lastline: 26, old_byte_size: 32, old_utf32_size: 32, old_utf16_size: 32" { "from .types import Expression " } [ DEBUG ] 2021-05-13T12:57:34+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { end = { character = 31, line = 25 }, start = { character = 30, line = 25 } }, rangeLength = 1, text = "" } }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py", version = 12 } }} [ DEBUG ] 2021-05-13T12:57:34+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:991 ] "on_lines bufnr: 1, changedtick: 13, firstline: 25, lastline: 26, new_lastline: 26, old_byte_size: 31, old_utf32_size: 31, old_utf16_size: 31" { "from .types import Expression" } [ DEBUG ] 2021-05-13T12:57:34+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { end = { character = 30, line = 25 }, start = { character = 29, line = 25 } }, rangeLength = 1, text = "" } }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py", version = 13 } }} [ DEBUG ] 2021-05-13T12:57:34+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:991 ] "on_lines bufnr: 1, changedtick: 14, firstline: 25, lastline: 26, new_lastline: 26, old_byte_size: 30, old_utf32_size: 30, old_utf16_size: 30" { "from .types import Expressio" } [ DEBUG ] 2021-05-13T12:57:34+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { end = { character = 29, line = 25 }, start = { character = 28, line = 25 } }, rangeLength = 1, text = "" } }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py", version = 14 } }} [ DEBUG ] 2021-05-13T12:57:35+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:491 ] "decoded" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { message = "'.types.Expressio' imported but unused", range = { end = { character = 29, line = 25 }, start = { character = 0, line = 25 } }, severity = 2, source = "pyflakes" }, { message = "undefined name 'Expression'", range = { end = { character = 57, line = 59 }, start = { character = 38, line = 59 } }, severity = 1, source = "pyflakes" }, { message = "undefined name 'Expression'", range = { end = { character = 62, line = 69 }, start = { character = 41, line = 69 } }, severity = 1, source = "pyflakes" }, { message = "undefined name 'Expression'", range = { end = { character = 60, line = 73 }, start = { character = 39, line = 73 } }, severity = 1, source = "pyflakes" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:35+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:672 ] "notification" "textDocument/publishDiagnostics" { diagnostics = { { message = "'.types.Expressio' imported but unused", range = { end = { character = 29, line = 25 }, start = { character = 0, line = 25 } }, severity = 2, source = "pyflakes" }, { message = "undefined name 'Expression'", range = { end = { character = 57, line = 59 }, start = { character = 38, line = 59 } }, severity = 1, source = "pyflakes" }, { message = "undefined name 'Expression'", range = { end = { character = 62, line = 69 }, start = { character = 41, line = 69 } }, severity = 1, source = "pyflakes" }, { message = "undefined name 'Expression'", range = { end = { character = 60, line = 73 }, start = { character = 39, line = 73 } }, severity = 1, source = "pyflakes" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py"} [ DEBUG ] 2021-05-13T12:57:35+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:442 ] "default_handler" "textDocument/publishDiagnostics" { client_id = 1, params = { diagnostics = { { message = "'.types.Expressio' imported but unused", range = { end = { character = 29, line = 25 }, start = { character = 0, line = 25 } }, severity = 2, source = "pyflakes" }, { message = "undefined name 'Expression'", range = { end = { character = 57, line = 59 }, start = { character = 38, line = 59 } }, severity = 1, source = "pyflakes" }, { message = "undefined name 'Expression'", range = { end = { character = 62, line = 69 }, start = { character = 41, line = 69 } }, severity = 1, source = "pyflakes" }, { message = "undefined name 'Expression'", range = { end = { character = 60, line = 73 }, start = { character = 39, line = 73 } }, severity = 1, source = "pyflakes" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:35+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:991 ] "on_lines bufnr: 1, changedtick: 15, firstline: 25, lastline: 26, new_lastline: 26, old_byte_size: 29, old_utf32_size: 29, old_utf16_size: 29" { "from .types import Expression" } [ DEBUG ] 2021-05-13T12:57:35+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { end = { character = 28, line = 25 }, start = { character = 28, line = 25 } }, rangeLength = 0, text = "n" } }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py", version = 15 } }} [ DEBUG ] 2021-05-13T12:57:35+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:887 ] "LSP[pylsp]" "client.request" 1 "textDocument/completion" { context = { triggerKind = 1 }, position = { character = 29, line = 25 }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} nil [ DEBUG ] 2021-05-13T12:57:35+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { id = 4, jsonrpc = "2.0", method = "textDocument/completion", params = { context = { triggerKind = 1 }, position = { character = 29, line = 25 }, textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" } }} [ DEBUG ] 2021-05-13T12:57:35+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:491 ] "decoded" { id = 4, jsonrpc = "2.0", result = { isIncomplete = false, items = { { detail = "src.dfba.types", documentation = "", insertText = "Expression", kind = 14, label = "Expression", sortText = "aExpression" } } }} [ DEBUG ] 2021-05-13T12:57:35+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:491 ] "decoded" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:35+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:672 ] "notification" "textDocument/publishDiagnostics" { diagnostics = { { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py"} [ DEBUG ] 2021-05-13T12:57:35+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:442 ] "default_handler" "textDocument/publishDiagnostics" { client_id = 1, params = { diagnostics = { { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:37+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "textDocument/didSave", params = { text = # This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n\n"""Definition of `KineticVariable` class."""\n\nfrom numbers import Number\nfrom typing import Union\n\nfrom optlang import symbolics\n\nfrom .types import Expression\n\n\nclass KineticVariable(symbolics.Symbol):\n """Class for holding information for a kinetic variable in a `DfbaModel` object.\n\n Attributes\n ----------\n id: string\n The identifier to associate with this kinetic variable.\n\n rhs_expression: optlang.symbolics expression\n The symbolic expression for calculating derivative of this kinetic\n variable wrt time.\n\n initital_condition: int or float\n The initial value of this kinetic variable to be used at start of\n simulation.\n\n """\n\n def __init__(self, name: str, initial_condition: Number = 0.0, *args, **kwargs):\n """`symbolics.Symbol` with rhs expression to be added."""\n symbolics.Symbol.__init__(self, name, *args, **kwargs)\n self._id = name\n self.initial_condition = initial_condition\n self.rhs_expression = None\n\n @property\n def id(self) -> str:\n """For convenience, synonym with .name from `symbolics.Symbol`."""\n return self._id\n\n @property\n def rhs_expression(self) -> Union[Expression, None]:\n """Relate the rhs expression to some symbolic expression."""\n return self._rhs_expression\n\n @property\n def initial_condition(self) -> Number:\n """Relate the ininital condition to some int or float value."""\n return self._initial_condition\n\n @rhs_expression.setter\n def rhs_expression(self, expression: Expression) -> None:\n self._rhs_expression = expression\n\n @initial_condition.setter\n def initial_condition(self, value: Expression) -> None:\n if not isinstance(value, (int, float)):\n raise Exception(\n f"Error: initial condition for kinetic variable {self.id} must"\n f"be int or float!"\n )\n self._initial_condition = value\n', textDocument = { uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" } }} [ DEBUG ] 2021-05-13T12:57:37+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:491 ] "decoded" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ DEBUG ] 2021-05-13T12:57:37+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:672 ] "notification" "textDocument/publishDiagnostics" { diagnostics = { { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py"} [ DEBUG ] 2021-05-13T12:57:37+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:442 ] "default_handler" "textDocument/publishDiagnostics" { client_id = 1, params = { diagnostics = { { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 29 }, start = { character = 79, line = 29 } }, severity = 2, source = "pycodestyle" }, { code = "E501", message = "E501 line too long (84 > 79 characters)", range = { end = { character = 85, line = 46 }, start = { character = 79, line = 46 } }, severity = 2, source = "pycodestyle" } }, uri = "file:///home/georg/GIT/dynamic-fba/src/dfba/variable.py" }} [ INFO ] 2021-05-13T12:57:38+0200 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:1170 ] "exit_handler" { { _on_attach = , cancel_request = , config = { capabilities = { callHierarchy = { dynamicRegistration = false, = <1>{ __tostring = } }, textDocument = { codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }, =
}, =
}, dynamicRegistration = false, =
}, completion = { completionItem = { commitCharactersSupport = false, deprecatedSupport = false, documentationFormat = { "markdown", "plaintext" }, preselectSupport = false, snippetSupport = false, =
}, completionItemKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, =
}, contextSupport = false, dynamicRegistration = false, =
}, declaration = { linkSupport = true, =
}, definition = { linkSupport = true, =
}, documentHighlight = { dynamicRegistration = false, =
}, documentSymbol = { dynamicRegistration = false, hierarchicalDocumentSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }, =
}, =
}, hover = { contentFormat = { "markdown", "plaintext" }, dynamicRegistration = false, =
}, implementation = { linkSupport = true, =
}, publishDiagnostics = { relatedInformation = true, tagSupport = { valueSet = { 1, 2 }, =
}, =
}, references = { dynamicRegistration = false, =
}, rename = { dynamicRegistration = false, prepareSupport = true, =
}, signatureHelp = { dynamicRegistration = false, signatureInformation = { documentationFormat = { "markdown", "plaintext" }, =
}, =
}, synchronization = { didSave = true, dynamicRegistration = false, willSave = false, willSaveWaitUntil = false, =
}, typeDefinition = { linkSupport = true, =
}, =
}, window = { showDocument = { support = false, =
}, showMessage = { messageActionItem = { additionalPropertiesSupport = false, =
}, =
}, workDoneProgress = true, =
}, workspace = { applyEdit = true, configuration = true, symbol = { dynamicRegistration = false, hierarchicalWorkspaceSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }, =
}, =
}, workspaceEdit = { resourceOperations = { "rename", "create", "delete" }, =
}, workspaceFolders = true, =
} }, cmd = { "pylsp" }, filetypes = { "python" }, flags = {}, get_language_id = , handlers = <2>{}, init_options = vim.empty_dict(), log_level = 2, message_level = 2, name = "pylsp", on_attach = , on_exit = , on_init = , root_dir = "/home/georg/GIT/dynamic-fba", settings = { configurationSources = { "flake8" }, formatCommand = { "isort" }, =
}, =
}, handlers =
, id = 1, initialized = true, is_stopped = , messages = { messages = {}, name = "pylsp", progress = {}, status = {} }, name = "pylsp", notify = , offset_encoding = "utf-16", request = , resolved_capabilities = { call_hierarchy = false, code_action = true, code_lens = true, code_lens_resolve = false, completion = true, declaration = false, document_formatting = true, document_highlight = true, document_range_formatting = true, document_symbol = true, execute_command = true, find_references = true, goto_definition = true, hover = true, implementation = false, rename = true, signature_help = true, signature_help_trigger_characters = <3>{ "(", ",", "=" }, text_document_did_change = 2, text_document_open_close = true, text_document_save = <4>{ includeText = true }, text_document_save_include_text = true, text_document_will_save = false, text_document_will_save_wait_until = false, type_definition = false, workspace_folder_properties = { changeNotifications = true, supported = true }, workspace_symbol = false }, rpc = { handle = , notify = , pid = 1139207, request = }, server_capabilities = { codeActionProvider = true, codeLensProvider = { resolveProvider = false }, completionProvider = { resolveProvider = false, triggerCharacters = { "." } }, definitionProvider = true, documentFormattingProvider = true, documentHighlightProvider = true, documentRangeFormattingProvider = true, documentSymbolProvider = true, executeCommandProvider = { commands = {} }, experimental = {}, foldingRangeProvider = true, hoverProvider = true, referencesProvider = true, renameProvider = true, signatureHelpProvider = { triggerCharacters =
}, textDocumentSync = { change = 2, openClose = true, save =
}, workspace = { workspaceFolders = { changeNotifications = true, supported = true } } }, stop = , supports_method = , workspaceFolders = { { name = "/home/georg/GIT/dynamic-fba", uri = "file:///home/georg/GIT/dynamic-fba" } }, workspace_did_change_configuration = } } [ DEBUG ] 2021-05-13T12:57:38+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { id = 5, jsonrpc = "2.0", method = "shutdown"} [ DEBUG ] 2021-05-13T12:57:38+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:491 ] "decoded" { id = 5, jsonrpc = "2.0", result = vim.NIL} [ DEBUG ] 2021-05-13T12:57:38+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:390 ] "rpc.send.payload" { jsonrpc = "2.0", method = "exit"}
mjlbach commented 3 years ago
carrascomj commented 3 years ago

Oh, crap, I didn't see that (and it is very unfortunate). Thanks for the info!

haplo commented 3 years ago

@carrascomj Try python-lsp-black, which is a fork of pyls-black that is compatible with python-lsp-server. Just uninstall pyls-black and install the new one and it should work.

There is also a new release of pyls-isort that is compatible with python-lsp-server, so you should just need to upgrade it.

carrascomj commented 3 years ago

@haplo That's awesome, thank you very much! I tried and it works perfectly. It seems like it is the best LSP python server for neovim right now.

mjlbach commented 3 years ago

I personally find pyright significantly more performant FWIW

carrascomj commented 3 years ago

pyright was very good, but I could not get go-to-definition or formatting to work (I don't remember which one), but I might give it a try again.

lithammer commented 3 years ago

Pyright doesn't have formatting. You have to use something like diagnostic-languageserver or efm-langserver for that. Which I think is a more flexible solution anyway.

require("lspconfig").diagnosticls.setup {
  filetypes = {"python"},
  init_options = {
    formatters = {
      black = {
        command = "black",
        args = {"--quiet", "-"},
        rootPatterns = {"pyproject.toml"},
      },
      formatFiletypes = {
        python = {"black"}
      }
    }
  }
}
nyngwang commented 2 years ago

kindly link to the diagnostic-languageserver config by @lithammer for future readers reference.

lithammer commented 2 years ago

Note that I'm not very good at keeping that repo up-to-date. It might not even work with recent Neovim 0.6-0.7 changes.