Skip to content

Commit

Permalink
WIP - Template for python configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
yyoncho committed Jan 8, 2019
1 parent 39e6c46 commit 72186e1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lsp-clients.el
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,23 @@
:risky t
:type '(repeat string))

(defcustom lsp-clients-python-settings (list :pyls.plugins.jedi_completion.enabled t
:pyls.plugins.jedi_definition.follow_imports t)
;; TODO rest of the settings from https://raw.githubusercontent.com/palantir/python-language-server/develop/vscode-client/package.json
"Lsp clients configuration settings."
:group 'lsp-python
:risky t
:type '(repeat string))

;;; pyls
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection "pyls")
:major-modes '(python-mode)
:priority -1
:server-id 'pyls
:initialized-fn (lambda (workspace)
(with-lsp-workspace workspace
(lsp--set-configuration lsp-clients-python-settings)))
:library-folders-fn (lambda (_workspace)
lsp-clients-python-library-directories)))

Expand Down

1 comment on commit 72186e1

@hrehfeld
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                ;; :pyls.configurationSources 
                ;;     "type": "array",
                ;;     "default": ["pycodestyle"],
                ;;     "description": "List of configuration sources to use.",
                ;;     "items": {
                ;;         "type": "string",
                ;;         "enum": ["pycodestyle", "pyflakes"]
                ;;     },
                ;;     "uniqueItems": true
                ;; },
                :pyls.plugins.jedi_completion.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.jedi_definition.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.jedi_definition.follow_imports nil
                ;;     "type": "boolean",
                ;;     "default": null,
                ;;     "description": "The goto call will follow imports."
                ;; },
                :pyls.plugins.jedi_definition.follow_builtin_imports nil
                ;;     "type": "boolean",
                ;;     "default": null,
                ;;     "description": "If follow_imports is True will decide if it follow builtin imports."
                ;; },
                :pyls.plugins.jedi_hover.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.jedi_references.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.jedi_signature_help.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.jedi_symbols.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.jedi_symbols.all_scopes nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "If True lists the names of all scopes instead of only the module namespace."
                ;; },
                :pyls.plugins.mccabe.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.mccabe.threshold nil
                ;;     "type": "number",
                ;;     "default": 15,
                ;;     "description": "The minimum threshold that triggers warnings about cyclomatic complexity."
                ;; },
                :pyls.plugins.preload.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.preload.modules nil
                ;;     "type": "array",
                ;;     "default": null,
                ;;     "items": {
                ;;         "type": "string"
                ;;     },
                ;;     "uniqueItems": true,
                ;;     "description": "List of modules to import on startup"
                ;; },
                :pyls.plugins.pycodestyle.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.pycodestyle.exclude nil
                ;;     "type": "array",
                ;;     "default": null,
                ;;     "items": {
                ;;         "type": "string"
                ;;     },
                ;;     "uniqueItems": true,
                ;;     "description": "Exclude files or directories which match these patterns."
                ;; },
                :pyls.plugins.pycodestyle.filename nil
                ;;     "type": "array",
                ;;     "default": null,
                ;;     "items": {
                ;;         "type": "string"
                ;;     },
                ;;     "uniqueItems": true,
                ;;     "description": "When parsing directories, only check filenames matching these patterns."
                ;; },
                :pyls.plugins.pycodestyle.select nil
                ;;     "type": "array",
                ;;     "default": null,
                ;;     "items": {
                ;;         "type": "string"
                ;;     },
                ;;     "uniqueItems": true,
                ;;     "description": "Select errors and warnings"
                ;; },
                :pyls.plugins.pycodestyle.ignore nil
                ;;     "type": "array",
                ;;     "default": null,
                ;;     "items": {
                ;;         "type": "string"
                ;;     },
                ;;     "uniqueItems": true,
                ;;     "description": "Ignore errors and warnings"
                ;; },
                :pyls.plugins.pycodestyle.hangClosing nil
                ;;     "type": "boolean",
                ;;     "default": null,
                ;;     "description": "Hang closing bracket instead of matching indentation of opening bracket's line."
                ;; },
                :pyls.plugins.pycodestyle.maxLineLength nil
                ;;     "type": "number",
                ;;     "default": null,
                ;;     "description": "Set maximum allowed line length."
                ;; },
                :pyls.plugins.pydocstyle.enabled nil
                ;;     "type": "boolean",
                ;;     "default": false,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.pydocstyle.convention nil
                ;;     "type": "string",
                ;;     "default": null,
                ;;     "enum": [
                ;;         "pep257",
                ;;         "numpy"
                ;;     ],
                ;;     "description": "Choose the basic list of checked errors by specifying an existing convention."
                ;; },
                :pyls.plugins.pydocstyle.addIgnore nil
                ;;     "type": "array",
                ;;     "default": null,
                ;;     "items": {
                ;;         "type": "string"
                ;;     },
                ;;     "uniqueItems": true,
                ;;     "description": "Ignore errors and warnings in addition to the specified convention."
                ;; },
                :pyls.plugins.pydocstyle.addSelect nil
                ;;     "type": "array",
                ;;     "default": null,
                ;;     "items": {
                ;;         "type": "string"
                ;;     },
                ;;     "uniqueItems": true,
                ;;     "description": "Select errors and warnings in addition to the specified convention."
                ;; },
                :pyls.plugins.pydocstyle.ignore nil
                ;;     "type": "array",
                ;;     "default": null,
                ;;     "items": {
                ;;         "type": "string"
                ;;     },
                ;;     "uniqueItems": true,
                ;;     "description": "Ignore errors and warnings"
                ;; },
                :pyls.plugins.pydocstyle.select nil
                ;;     "type": "array",
                ;;     "default": null,
                ;;     "items": {
                ;;         "type": "string"
                ;;     },
                ;;     "uniqueItems": true,
                ;;     "description": "Select errors and warnings"
                ;; },
                :pyls.plugins.pydocstyle.match nil
                ;;     "type": "string",
                ;;     "default": "(?!test_).*\\.py",
                ;;     "description": "Check only files that exactly match the given regular expression; default is to match files that don't start with 'test_' but end with '.py'."
                ;; },
                :pyls.plugins.pydocstyle.matchDir nil
                ;;     "type": "string",
                ;;     "default": "[^\\.].*",
                ;;     "description": "Search only dirs that exactly match the given regular expression; default is to match dirs which do not begin with a dot."
                ;; },
                :pyls.plugins.pyflakes.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.rope_completion.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.plugins.yapf.enabled nil
                ;;     "type": "boolean",
                ;;     "default": true,
                ;;     "description": "Enable or disable the plugin."
                ;; },
                :pyls.rope.extensionModules nil
                ;;     "type": "string",
                ;;     "default": null,
                ;;     "description": "Builtin and c-extension modules that are allowed to be imported and inspected by rope."
                ;; },
                :pyls.rope.ropeFolder nil
                ;;      "type": "array",
                ;;     "default": null,
                ;;     "items": {
                ;;         "type": "string"
                ;;     },
                ;;     "uniqueItems": true,
                ;;     "description": "The name of the folder in which rope stores project configurations and data.  Pass `null` for not using such a folder at all."
                ;; }

Please sign in to comment.