aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorGreg Werbin <gwerbin@users.noreply.github.com>2022-10-25 02:24:48 -0400
committerGitHub <noreply@github.com>2022-10-25 14:24:48 +0800
commitfa5739e6366ba3d7fb2f1d84e479d3aeb180d946 (patch)
tree02beb5454180d106f18af4debb85ec3b8214caa8 /lua
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-fa5739e6366ba3d7fb2f1d84e479d3aeb180d946.tar
nvim-lspconfig-fa5739e6366ba3d7fb2f1d84e479d3aeb180d946.tar.gz
nvim-lspconfig-fa5739e6366ba3d7fb2f1d84e479d3aeb180d946.tar.bz2
nvim-lspconfig-fa5739e6366ba3d7fb2f1d84e479d3aeb180d946.tar.lz
nvim-lspconfig-fa5739e6366ba3d7fb2f1d84e479d3aeb180d946.tar.xz
nvim-lspconfig-fa5739e6366ba3d7fb2f1d84e479d3aeb180d946.tar.zst
nvim-lspconfig-fa5739e6366ba3d7fb2f1d84e479d3aeb180d946.zip
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
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/server_configurations/anakin_language_server.lua78
1 files changed, 78 insertions, 0 deletions
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
+ ]],
+ },
+}