Giter Club home page Giter Club logo

anakin-language-server's Introduction

Stand With Ukraine

anakin-language-server

Yet another Jedi Python language server

Requirements

  • Python >= 3.6
  • pygls >= 1.1, <1.2
  • Jedi >= 0.19
  • pyflakes ~= 2.2
  • pycodestyle ~= 2.5
  • yapf ~=0.30

Optional requirements

  • mypy

Implemented features

  • textDocument/completion
  • textDocument/hover
  • textDocument/signatureHelp
  • textDocument/definition
  • textDocument/references
  • textDocument/publishDiagnostics
  • textDocument/documentSymbol
  • textDocument/codeAction (Inline variable)
  • textDocument/formatting
  • textDocument/rangeFormatting
  • textDocument/rename
  • textDocument/documentHighlight

Initialization option

Also one can set VIRTUAL_ENV or CONDA_PREFIX before running anakinls so Jedi will find proper environment. See get_default_environment.

Diagnostics

Diagnostics are published on document open and save.

Diagnostics providers:

  • Jedi

    See get_syntax_errors.

  • pyflakes

  • pycodestyle

    Server restart is needed after changing one of the configuration files.

  • mypy

    Install mypy in the same environment as anakinls and set mypy_enabled configuration option.

Configuration options

Configuration options must be passed under anakinls key in workspace/didChangeConfiguration notification.

Available options:

Option Description Default
help_on_hover Use help instead of infer for textDocument/hover. True
completion_snippet_first Tweak sortText property so snippet completion appear before plain completion. False
completion_fuzzy Value of the fuzzy parameter for complete. False
diagnostic_on_open Publish diagnostics on textDocument/didOpen True
diagnostic_on_change Publish diagnostics on textDocument/didChange False
diagnostic_on_save Publish diagnostics on textDocument/didSave True
pyflakes_errors Diagnostic severity will be set to Error if Pyflakes message class name is in this list. See Pyflakes messages. ['UndefinedName']
pycodestyle_config In addition to project and user level config, specify pycodestyle config file. Same as --config option for pycodestyle. None
mypy_enabled Use mypy to provide diagnostics. False
yapf_style_config Either a style name or a path to a file that contains formatting style settings. 'pep8'
jedi_settings Global Jedi settings.
E.g. set it to {"case_insensitive_completion": False} to turn off case insensitive completion
{}

Configuration example

Here is eglot configuration:

(defvar my/lsp-venv nil
  "Name of virtualenv.
Set it in project's dir-locals file.")

(defclass my/eglot-anakinls (eglot-lsp-server) ()
  :documentation
  "Own eglot server class.")

(cl-defmethod eglot-initialization-options ((_server my/eglot-anakinls))
  "Pass initialization param to anakinls."
  `(:venv ,(when my/lsp-venv
             (expand-file-name
              (concat "~/.virtualenvs/" my/lsp-venv)))))

;; Add this server to eglot programs to handle python-mode and run `anakinls'
(add-to-list 'eglot-server-programs
             '(python-mode my/eglot-anakinls "anakinls"))

;; Also treat UnusedVariable as error
(setq-default eglot-workspace-configuration
              '((:anakinls :pyflakes_errors ["UndefinedName" "UnusedVariable"])))

Installation

pip install anakin-language-server

Development

pip install pre-commit
pre-commit install

anakin-language-server's People

Contributors

kwist-sgr avatar muffinmad avatar nemethf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

anakin-language-server's Issues

Return a list of 2 MarkedStrings for function/classes in textDocument/hover

The first MarkedString should be of the form

{"language": "python", "value": "def foo(bar, baz) -> None"} (put the word def in front of it for a function/method, class for a class)

The second MarkedString should be the plaintext docs of the function/class.

Right now the hover content is a bit dry, I think this can be improved greatly with this simple adjustment.

Screenshot from 2020-05-15 20-51-23

textDocument/definition may throw an exception

Perhaps the text sync goes out of sync, I'm not entirely sure why this happens.

Some relevant logs:

:: --> anakin textDocument/definition(302): {'position': {'line': 64, 'character': 43}, 'textDocument': {'uri': 'file:///home/raoul/.config/sublime-text-3/Packages/LSP/tests/test_configurations.py'}}
anakin: ERROR:pygls.protocol:Failed to handle request 302 textDocument/definition Object(position=Object(line=64, character=43), textDocument=Object(uri='file:///home/raoul/.config/sublime-text-3/Packages/LSP/tests/test_configurations.py'))
:: <<< anakin 302: ValueError: `column` parameter (43) is not in a valid range (0-8) for line 65 ('        \n').
anakin: Traceback (most recent call last):
anakin: File "/home/raoul/.local/lib/python3.7/site-packages/pygls/protocol.py", line 325, in _handle_request
anakin: self._execute_request(msg_id, handler, params)
anakin: File "/home/raoul/.local/lib/python3.7/site-packages/pygls/protocol.py", line 250, in _execute_request
anakin: self._send_response(msg_id, handler(params))
anakin: File "/home/raoul/.local/lib/python3.7/site-packages/anakinls/server.py", line 312, in definition
anakin: defs = script.goto(params.position.line + 1, params.position.character)
anakin: File "/home/raoul/.local/lib/python3.7/site-packages/jedi/api/helpers.py", line 464, in wrapper
anakin: column, line_len, line, line_string))
anakin: ValueError: `column` parameter (43) is not in a valid range (0-8) for line 65 ('        \n').

`textDocument/definition` not working in nvim

Thanks for the great project.

While experimenting with builtin LSP in nvim I found that goto definition do not work with anakinls as language server (it doesn't work with jedi-language-server either).
Unfotunately anakinls do not work with LanguageClient either with the following error message:

[LC] data did not match any variant of untagged enum GotoDefinitionResponse

I opened an issue at nvim-lspconfig at neovim/nvim-lspconfig#424 but they pointed out that it may be a upstream bug (They suggest that the feature is not implemented but my understanding from the readme is that that feature should be implemented).

Please find here the relevant log relative to the nvim builtin LSP:

[ DEBUG ] 2020-11-24T10:02:57+0100 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:670 ]      "LSP[anakin_language_server]"   "client.request"        1       "textDocument/definition"       {  position = {    character = 13,    line = 622  },  textDocument = {    uri = "file:///home/xxxx/codes/mycode/mycode/base.py"  }}        <function 1>    1
[ DEBUG ] 2020-11-24T10:02:57+0100 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:376 ]  "rpc.send.payload"      {  id = 2,  jsonrpc = "2.0",  method = "textDocument/definition",  params = {    position = {      character = 13,      line = 622    },    textDocument = {      uri = "file:///home/xxxx/codes/mycode/mycode[ DEBUG ] 2020-11-24T10:02:57+0100 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:670 ]      "LSP[anakin_language_server]"   "client.request"        1       "textDocument/definition"       {  position = {    character = 13,    line = 622  },  textDocument = {    uri = "file:///home/xxxx/codes/mycode/mycode/base.py"  }}        <function 1>    1
[ DEBUG ] 2020-11-24T10:02:57+0100 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:376 ]  "rpc.send.payload"      {  id = 2,  jsonrpc = "2.0",  method = "textDocument/definition",  params = {    position = {      character = 13,      line = 622    },    textDocument = {      uri = "file:///home/xxxx/codes/mycode/mycode/base.py"    }  }}
[ DEBUG ] 2020-11-24T10:02:57+0100 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:477 ]  "decoded"       {  id = 2,  jsonrpc = "2.0",  result = { {      range = {        end = {          character = 12,          line = 635        },        start = {          character = 4,          line = 635        }      },      uri = vim.NIL    } }}
[ DEBUG ] 2020-11-24T10:02:57+0100 ] /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:297 ]     "default_handler"       "textDocument/definition"       {  bufnr = 1,  client_id = 1,  params = { {      range = {        end = {          character = 12,          line = 635        },        start = {          character = 4,          line = 635        }      }    } }}
[ INFO ] 2020-11-24T10:03:01+0100 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:974 ]       "exit_handler"  { {    _on_attach = <function 1>,    callbacks = <1>{      ["window/logMessage"] = <function 2>,      ["window/showMessage"] = <function 3>,      ["workspace/configuration"] = <function 4>    },    cancel_request = <function 5>,    config = {      _on_attach = <function 6>,      capabilities = {        callHierarchy = {          dynamicRegistration = false,          <metatable> = <2>{            __tostring = <function 7>          }        },        textDocument = {          codeAction = {            codeActionLiteralSupport = {              codeActionKind = {                valueSet = { "", "RefactorInline", "source.organizeImports", "quickfix", "QuickFix", "Refactor", "Source", "RefactorRewrite", "refactor.inline", "RefactorExtract", "source", "SourceOrganizeImports", "refactor", "Empty", "refactor.rewrite", "refactor.extract" },                <metatable> = <table 2>              },              <metatable> = <table 2>            },            dynamicRegistration = false,            <metatable> = <table 2>          },          completion = {            completionItem = {              commitCharactersSupport = false,              deprecatedSupport = false,              documentationFormat = { "markdown", "plaintext" },              preselectSupport = false,              snippetSupport = false,              <metatable> = <table 2>            },            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 },              <metatable> = <table 2>            },            contextSupport = false,            dynamicRegistration = false,            <metatable> = <table 2>          },          declaration = {            linkSupport = true,            <metatable> = <table 2>          },          definition = {            linkSupport = true,            <metatable> = <table 2>          },          documentHighlight = {            dynamicRegistration = false,            <metatable> = <table 2>          },          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 },              <metatable> = <table 2>            },            <metatable> = <table 2>          },          hover = {            contentFormat = { "markdown", "plaintext" },            dynamicRegistration = false,            <metatable> = <table 2>          },          implementation = {            linkSupport = true,            <metatable> = <table 2>          },          references = {            dynamicRegistration = false,            <metatable> = <table 2>          },          rename = {            dynamicRegistration = false,            prepareSupport = true,            <metatable> = <table 2>          },          signatureHelp = {            dynamicRegistration = false,            signatureInformation = {              documentationFormat = { "markdown", "plaintext" },              <metatable> = <table 2>            },            <metatable> = <table 2>          },          synchronization = {            didSave = true,            dynamicRegistration = false,            willSave = false,            willSaveWaitUntil = false,            <metatable> = <table 2>          },          typeDefinition = {            linkSupport = true,            <metatable> = <table 2>          },          <metatable> = <table 2>        },        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 },              <metatable> = <table 2>            },            <metatable> = <table 2>          },          <metatable> = <table 2>        }      },      cmd = { "anakinls" },      filetypes = { "python" },      handlers = <table 1>,      init_options = vim.empty_dict(),      log_level = 2,      message_level = 2,      name = "anakin_language_server",      on_attach = <function 8>,      on_exit = <function 9>,      on_init = <function 10>,      root_dir = "/home/xxxx/codes/mycode/mycode",      settings = vim.empty_dict(),      <metatable> = <table 2>    },    handlers = <table 1>,    id = 1,    initialized = true,    is_stopped = <function 11>,    name = "anakin_language_server",    notify = <function 12>,    offset_encoding = "utf-16",    request = <function 13>,    resolved_capabilities = {      call_hierarchy = false,      code_action = <3>{        codeActionKinds = { "refactor.inline", "refactor.extract" }      },      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 = <4>{ "(", "," },      text_document_did_change = 2,      text_document_open_close = true,      text_document_save = <5>{        includeText = false      },      text_document_save_include_text = false,      text_document_will_save = false,      text_document_will_save_wait_until = false,      type_definition = false,      workspace_symbol = false    },    rpc = {      handle = <userdata 1>,      notify = <function 14>,      pid = 547204,      request = <function 15>    },    server_capabilities = {      codeActionProvider = <table 3>,      completionProvider = {        resolveProvider = false,        triggerCharacters = { "." }      },      definitionProvider = true,      documentFormattingProvider = true,      documentHighlightProvider = true,      documentOnTypeFormattingProvider = {        firstTriggerCharacter = "",        moreTriggerCharacter = {}      },      documentRangeFormattingProvider = true,      documentSymbolProvider = true,      executeCommandProvider = {        commands = {}      },      hoverProvider = true,      referencesProvider = true,      renameProvider = true,      signatureHelpProvider = {        triggerCharacters = <table 4>      },      textDocumentSync = {        change = 2,        openClose = true,        save = <table 5>,        willSave = false,        willSaveWaitUntil = false      },      workspace = {        workspaceFolders = {          changeNotifications = true,          supported = true        }      },      workspaceSymbolProvider = false    },    stop = <function 16>,    supports_method = <function 17>,    workspace_did_change_configuration = <function 18>  } }
/base.py"    }  }}
[ DEBUG ] 2020-11-24T10:02:57+0100 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:477 ]  "decoded"       {  id = 2,  jsonrpc = "2.0",  result = { {      range = {        end = {          character = 12,          line = 635        },        start = {          character = 4,          line = 635        }      },      uri = vim.NIL    } }}
[ DEBUG ] 2020-11-24T10:02:57+0100 ] /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:297 ]     "default_handler"       "textDocument/definition"       {  bufnr = 1,  client_id = 1,  params = { {      range = {        end = {          character = 12,          line = 635        },        start = {          character = 4,          line = 635        }      }    } }}
[ INFO ] 2020-11-24T10:03:01+0100 ] /usr/share/nvim/runtime/lua/vim/lsp.lua:974 ]       "exit_handler"  { {    _on_attach = <function 1>,    callbacks = <1>{      ["window/logMessage"] = <function 2>,      ["window/showMessage"] = <function 3>,      ["workspace/configuration"] = <function 4>    },    cancel_request = <function 5>,    config = {      _on_attach = <function 6>,      capabilities = {        callHierarchy = {          dynamicRegistration = false,          <metatable> = <2>{            __tostring = <function 7>          }        },        textDocument = {          codeAction = {            codeActionLiteralSupport = {              codeActionKind = {                valueSet = { "", "RefactorInline", "source.organizeImports", "quickfix", "QuickFix", "Refactor", "Source", "RefactorRewrite", "refactor.inline", "RefactorExtract", "source", "SourceOrganizeImports", "refactor", "Empty", "refactor.rewrite", "refactor.extract" },                <metatable> = <table 2>              },              <metatable> = <table 2>            },            dynamicRegistration = false,            <metatable> = <table 2>          },          completion = {            completionItem = {              commitCharactersSupport = false,              deprecatedSupport = false,              documentationFormat = { "markdown", "plaintext" },              preselectSupport = false,              snippetSupport = false,              <metatable> = <table 2>            },            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 },              <metatable> = <table 2>            },            contextSupport = false,            dynamicRegistration = false,            <metatable> = <table 2>          },          declaration = {            linkSupport = true,            <metatable> = <table 2>          },          definition = {            linkSupport = true,            <metatable> = <table 2>          },          documentHighlight = {            dynamicRegistration = false,            <metatable> = <table 2>          },          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 },              <metatable> = <table 2>            },            <metatable> = <table 2>          },          hover = {            contentFormat = { "markdown", "plaintext" },            dynamicRegistration = false,            <metatable> = <table 2>          },          implementation = {            linkSupport = true,            <metatable> = <table 2>          },          references = {            dynamicRegistration = false,            <metatable> = <table 2>          },          rename = {            dynamicRegistration = false,            prepareSupport = true,            <metatable> = <table 2>          },          signatureHelp = {            dynamicRegistration = false,            signatureInformation = {              documentationFormat = { "markdown", "plaintext" },              <metatable> = <table 2>            },            <metatable> = <table 2>          },          synchronization = {            didSave = true,            dynamicRegistration = false,            willSave = false,            willSaveWaitUntil = false,            <metatable> = <table 2>          },          typeDefinition = {            linkSupport = true,            <metatable> = <table 2>          },          <metatable> = <table 2>        },        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 },              <metatable> = <table 2>            },            <metatable> = <table 2>          },          <metatable> = <table 2>        }      },      cmd = { "anakinls" },      filetypes = { "python" },      handlers = <table 1>,      init_options = vim.empty_dict(),      log_level = 2,      message_level = 2,      name = "anakin_language_server",      on_attach = <function 8>,      on_exit = <function 9>,      on_init = <function 10>,      root_dir = "/home/xxxx/codes/mycode/mycode",      settings = vim.empty_dict(),      <metatable> = <table 2>    },    handlers = <table 1>,    id = 1,    initialized = true,    is_stopped = <function 11>,    name = "anakin_language_server",    notify = <function 12>,    offset_encoding = "utf-16",    request = <function 13>,    resolved_capabilities = {      call_hierarchy = false,      code_action = <3>{        codeActionKinds = { "refactor.inline", "refactor.extract" }      },      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 = <4>{ "(", "," },      text_document_did_change = 2,      text_document_open_close = true,      text_document_save = <5>{        includeText = false      },      text_document_save_include_text = false,      text_document_will_save = false,      text_document_will_save_wait_until = false,      type_definition = false,      workspace_symbol = false    },    rpc = {      handle = <userdata 1>,      notify = <function 14>,      pid = 547204,      request = <function 15>    },    server_capabilities = {      codeActionProvider = <table 3>,      completionProvider = {        resolveProvider = false,        triggerCharacters = { "." }      },      definitionProvider = true,      documentFormattingProvider = true,      documentHighlightProvider = true,      documentOnTypeFormattingProvider = {        firstTriggerCharacter = "",        moreTriggerCharacter = {}      },      documentRangeFormattingProvider = true,      documentSymbolProvider = true,      executeCommandProvider = {        commands = {}      },      hoverProvider = true,      referencesProvider = true,      renameProvider = true,      signatureHelpProvider = {        triggerCharacters = <table 4>      },      textDocumentSync = {        change = 2,        openClose = true,        save = <table 5>,        willSave = false,        willSaveWaitUntil = false      },      workspace = {        workspaceFolders = {          changeNotifications = true,          supported = true        }      },      workspaceSymbolProvider = false    },    stop = <function 16>,    supports_method = <function 17>,    workspace_did_change_configuration = <function 18>  } }

Mypy diagnostics

It would be nice to see mypy diagnostics enabled. I am using a lot of type hinting in my code and the extra diagnostics about type mismatches helps.

textDocument/formatting

This language server is maturing quite a bit. Can we get textDocument/formatting (yapf) implemented?

textDocument/documentHighlight

pyls has textDocument/documentHighlight. I'm not sure how it achieves it, but in any case I'm missing that feature in anakinLS.

Local variables are reported as keywords in the completions

I know that pyls has this problem too, so I'm guessing that it is a problem of jedi. But I'll report it here to track the issue.

def f():
    a = 1
    a|
        {
            "filterText": null,
            "insertText": null,
            "insertTextFormat": null,
            "additionalTextEdits": null,
            "commitCharacters": null,
            "kind": 14,  // <---------------- keyword? (should be variable (6))
            "detail": null,
            "data": null,
            "preselect": false,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 5
                    },
                    "end": {
                        "line": 2,
                        "character": 5
                    }
                },
                "newText": ""
            },
            "command": null,
            "documentation": "",
            "deprecated": false,
            "label": "a",
            "sortText": "aaa"
        },

A few keys in CompletionItem violate the protocol

Some keys in the returned completion items have a null value. For example:

{
    "label": "__bool__",
    "deprecated": false,
    "documentation": "self != 0",
    "command": null,
    "textEdit": {
        "newText": "__bool__",
        "range": {
            "end": {
                "character": 18,
                "line": 237
            },
            "start": {
                "character": 18,
                "line": 237
            }
        }
    },
    "preselect": false,
    "detail": null,
    "data": null,
    "commitCharacters": null,
    "kind": 18,
    "sortText": "zz__bool__",
    "insertTextFormat": null,
    "additionalTextEdits": null,
    "filterText": null,
    "insertText": null
}

This isn't allowed by the spec. Either the key exists and the value is valid, or the key doesn't exist.

Diagnostic ranges are incorrect

The ranges of the diagnostics are not entirely correct:

Screenshot from 2020-05-02 16-57-43

Relevant payload:

{
    "uri": "file:///home/raoul/.config/sublime-text-3/Packages/LSP/plugin/core/transports.py",
    "diagnostics": [
        {
            "message": "E501 line too long (102 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 34,
                    "character": 79
                },
                "end": {
                    "line": 34,
                    "character": 23
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (103 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 48,
                    "character": 79
                },
                "end": {
                    "line": 48,
                    "character": 24
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (89 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 54,
                    "character": 79
                },
                "end": {
                    "line": 54,
                    "character": 10
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (112 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 66,
                    "character": 79
                },
                "end": {
                    "line": 66,
                    "character": 33
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (100 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 67,
                    "character": 79
                },
                "end": {
                    "line": 67,
                    "character": 21
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (101 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 73,
                    "character": 79
                },
                "end": {
                    "line": 73,
                    "character": 22
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (102 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 74,
                    "character": 79
                },
                "end": {
                    "line": 74,
                    "character": 23
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (103 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 75,
                    "character": 79
                },
                "end": {
                    "line": 75,
                    "character": 24
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (102 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 169,
                    "character": 79
                },
                "end": {
                    "line": 169,
                    "character": 23
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (85 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 181,
                    "character": 79
                },
                "end": {
                    "line": 181,
                    "character": 6
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (103 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 199,
                    "character": 79
                },
                "end": {
                    "line": 199,
                    "character": 24
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (81 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 202,
                    "character": 79
                },
                "end": {
                    "line": 202,
                    "character": 2
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (99 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 211,
                    "character": 79
                },
                "end": {
                    "line": 211,
                    "character": 20
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (89 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 221,
                    "character": 79
                },
                "end": {
                    "line": 221,
                    "character": 10
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (85 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 236,
                    "character": 79
                },
                "end": {
                    "line": 236,
                    "character": 6
                }
            },
            "severity": 2,
            "relatedInformation": null
        },
        {
            "message": "E501 line too long (104 > 79 characters)",
            "source": "pycodestyle",
            "code": "E501",
            "range": {
                "start": {
                    "line": 242,
                    "character": 79
                },
                "end": {
                    "line": 242,
                    "character": 25
                }
            },
            "severity": 2,
            "relatedInformation": null
        }
    ]
}

Sometimes exception thrown in textDocument/didOpen notification handler

anakin: INFO:root:  /home/raoul/.local/lib/python3.7/site-packages
anakin: INFO:root:  /usr/local/lib/python3.7/dist-packages
anakin: INFO:root:  /usr/lib/python3/dist-packages
anakin: INFO:root:Jedi project path: /home/raoul/.config/sublime-text-3/Packages/LSP
anakin: ERROR:pygls.protocol:Failed to handle *user defined* notification textDocument/didOpen: <snip>
anakin: Traceback (most recent call last):
anakin:   File "/home/raoul/.local/lib/python3.7/site-packages/pygls/protocol.py", line 60, in decorator
anakin:     self._execute_notification(user_func, *args, **kwargs)
anakin:   File "/home/raoul/.local/lib/python3.7/site-packages/pygls/protocol.py", line 221, in _execute_notification
anakin:     handler(*params)
anakin:   File "/home/raoul/.local/lib/python3.7/site-packages/anakinls/server.py", line 342, in did_open
anakin:     _validate(ls, params.textDocument.uri)
anakin:   File "/home/raoul/.local/lib/python3.7/site-packages/anakinls/server.py", line 321, in _validate
anakin:     PyflakesReporter(result, script, config['pyflakes_errors']))
anakin:   File "/home/raoul/.local/lib/python3.7/site-packages/pyflakes/api.py", line 77, in check
anakin:     reporter.flake(warning)
anakin:   File "/home/raoul/.local/lib/python3.7/site-packages/anakinls/server.py", line 170, in flake
anakin:     if message.__class__.__name__ in self.errors:
anakin: TypeError: argument of type 'bool' is not iterable

This is usually for the first file. Further didOpens work OK.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.