From fa5739e6366ba3d7fb2f1d84e479d3aeb180d946 Mon Sep 17 00:00:00 2001 From: Greg Werbin Date: Tue, 25 Oct 2022 02:24:48 -0400 Subject: feat: add anakin language server (Python) (#2217) * feat: add anakin-language-server * fix(anakin-language-server): use the correct executable name * fix(anakin-language-server): display errors as ERROR, not WARNING This is an attempt to elevate the reporting level of mistakes that will cause you program to crash unexpectedly, above the level of style warnings and other non-critical problems. * fix(anakin-language-server): style warning --- .../anakin_language_server.lua | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 lua/lspconfig/server_configurations/anakin_language_server.lua (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/anakin_language_server.lua b/lua/lspconfig/server_configurations/anakin_language_server.lua new file mode 100644 index 00000000..f0c281cc --- /dev/null +++ b/lua/lspconfig/server_configurations/anakin_language_server.lua @@ -0,0 +1,78 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'anakinls' }, + filetypes = { 'python' }, + root_dir = function(fname) + local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + } + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + settings = { + anakinls = { + pyflakes_errors = { + -- Full list: https://github.com/PyCQA/pyflakes/blob/master/pyflakes/messages.py + + 'ImportStarNotPermitted', + + 'UndefinedExport', + 'UndefinedLocal', + 'UndefinedName', + + 'DuplicateArgument', + 'MultiValueRepeatedKeyLiteral', + 'MultiValueRepeatedKeyVariable', + + 'FutureFeatureNotDefined', + 'LateFutureImport', + + 'ReturnOutsideFunction', + 'YieldOutsideFunction', + 'ContinueOutsideLoop', + 'BreakOutsideLoop', + + 'TwoStarredExpressions', + 'TooManyExpressionsInStarredAssignment', + + 'ForwardAnnotationSyntaxError', + 'RaiseNotImplemented', + + 'StringDotFormatExtraPositionalArguments', + 'StringDotFormatExtraNamedArguments', + 'StringDotFormatMissingArgument', + 'StringDotFormatMixingAutomatic', + 'StringDotFormatInvalidFormat', + + 'PercentFormatInvalidFormat', + 'PercentFormatMixedPositionalAndNamed', + 'PercentFormatUnsupportedFormat', + 'PercentFormatPositionalCountMismatch', + 'PercentFormatExtraNamedArguments', + 'PercentFormatMissingArgument', + 'PercentFormatExpectedMapping', + 'PercentFormatExpectedSequence', + 'PercentFormatStarRequiresSequence', + }, + }, + }, + }, + docs = { + description = [[ +https://pypi.org/project/anakin-language-server/ + +`anakin-language-server` is yet another Jedi Python language server. + +Available options: + +* Initialization: https://github.com/muffinmad/anakin-language-server#initialization-option +* Configuration: https://github.com/muffinmad/anakin-language-server#configuration-options + ]], + }, +} -- cgit v1.2.3-70-g09d2