Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pylsp black/isort formatting does not work #903

Closed
carrascomj opened this issue May 13, 2021 · 9 comments
Closed

pylsp black/isort formatting does not work #903

carrascomj opened this issue May 13, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@carrascomj
Copy link

  • nvim --version: v0.5.0-dev+1282-gfbe18d9ca
  • nvim-lsp version(commit hash): 0a921bf
  • What language server (If the problem is related to a specific language server): pylsp
  • Can you reproduce this behavior on other language server clients (vscode, languageclient-neovim, coc.nvim, etc.): coc.nvim works fine (but I does not use pylsp).
  • Can you reproduce this behavior on other language servers offered in the nvim-lspconfig repo? (pyls -> pyright): I had the same problems than with pyright but the efm was working right for that (although it had other problems).
  • Is the problem isolated to a particular language server: I guess
  • Operating system/version: Linux 5.12.1-arch1-1

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"}
@carrascomj carrascomj added the bug Something isn't working label May 13, 2021
@mjlbach
Copy link
Contributor

mjlbach commented May 13, 2021

Upstream issue: rupert/pyls-black#35

@mjlbach mjlbach closed this as completed May 13, 2021
@carrascomj
Copy link
Author

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

@haplo
Copy link

haplo commented May 19, 2021

@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
Copy link
Author

@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
Copy link
Contributor

mjlbach commented May 19, 2021

I personally find pyright significantly more performant FWIW

@carrascomj
Copy link
Author

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
Copy link
Collaborator

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
Copy link

nyngwang commented Mar 2, 2022

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

@lithammer
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants