lsp-pylsp.el (25400B)
1 ;;; lsp-pylsp.el --- python-lsp-server support -*- lexical-binding: t; -*- 2 3 ;; Copyright (C) 2021 Doug Davis 4 5 ;; Author: Doug Davis <ddavis@ddavis.io> 6 ;; Keywords: language tools 7 8 ;; This program is free software; you can redistribute it and/or modify 9 ;; it under the terms of the GNU General Public License as published by 10 ;; the Free Software Foundation, either version 3 of the License, or 11 ;; (at your option) any later version. 12 13 ;; This program is distributed in the hope that it will be useful, 14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ;; GNU General Public License for more details. 17 18 ;; You should have received a copy of the GNU General Public License 19 ;; along with this program. If not, see <https://www.gnu.org/licenses/>. 20 21 ;;; Commentary: 22 23 ;; pylsp configuration 24 25 ;;; Code: 26 27 (require 'lsp-mode) 28 29 (defgroup lsp-pylsp nil 30 "LSP support for Python, using python-lsp's Python Language Server." 31 :group 'lsp-mode 32 :link '(url-link "https://github.com/python-lsp/python-lsp-server")) 33 34 (defcustom lsp-clients-pylsp-library-directories '("/usr/") 35 "List of directories which will be considered to be libraries." 36 :risky t 37 :type '(repeat string) 38 :group 'lsp-pylsp) 39 40 (defcustom lsp-pylsp-server-command '("pylsp") 41 "Command to start pylsp." 42 :risky t 43 :group 'lsp-pylsp 44 :type '(repeat string)) 45 46 (defcustom lsp-pylsp-configuration-sources ["flake8"] 47 "List of configuration sources to use." 48 :type 'lsp-string-vector 49 :group 'lsp-pylsp) 50 51 (defcustom lsp-pylsp-plugins-jedi-completion-enabled t 52 "Enable or disable the plugin." 53 :type 'boolean 54 :group 'lsp-pylsp) 55 56 (defcustom lsp-pylsp-plugins-jedi-completion-include-params t 57 "Auto-completes methods and classes with tabstops for each 58 parameter." 59 :type 'boolean 60 :group 'lsp-pylsp) 61 62 (defcustom lsp-pylsp-plugins-jedi-definition-enabled t 63 "Enable or disable the plugin." 64 :type 'boolean 65 :group 'lsp-pylsp) 66 67 (defcustom lsp-pylsp-plugins-jedi-definition-follow-imports t 68 "The goto call will follow imports." 69 :type 'boolean 70 :group 'lsp-pylsp) 71 72 (defcustom lsp-pylsp-plugins-jedi-definition-follow-builtin-imports t 73 "If follow_imports is True will decide if it follow builtin 74 imports." 75 :type 'boolean 76 :group 'lsp-pylsp) 77 78 (defcustom lsp-pylsp-plugins-jedi-hover-enabled t 79 "Enable or disable the plugin." 80 :type 'boolean 81 :group 'lsp-pylsp) 82 83 (defcustom lsp-pylsp-plugins-jedi-references-enabled t 84 "Enable or disable the plugin." 85 :type 'boolean 86 :group 'lsp-pylsp) 87 88 (defcustom lsp-pylsp-plugins-jedi-signature-help-enabled t 89 "Enable or disable the plugin." 90 :type 'boolean 91 :group 'lsp-pylsp) 92 93 (defcustom lsp-pylsp-plugins-jedi-symbols-enabled t 94 "Enable or disable the plugin." 95 :type 'boolean 96 :group 'lsp-pylsp) 97 98 (defcustom lsp-pylsp-plugins-jedi-symbols-all-scopes t 99 "If True lists the names of all scopes instead of only the 100 module namespace." 101 :type 'boolean 102 :group 'lsp-pylsp) 103 104 (defcustom lsp-pylsp-plugins-mccabe-enabled t 105 "Enable or disable the plugin." 106 :type 'boolean 107 :group 'lsp-pylsp) 108 109 (defcustom lsp-pylsp-plugins-mccabe-threshold 15 110 "The minimum threshold that triggers warnings about cyclomatic 111 complexity." 112 :type 'number 113 :group 'lsp-pylsp) 114 115 (defcustom lsp-pylsp-plugins-preload-enabled t 116 "Enable or disable the plugin." 117 :type 'boolean 118 :group 'lsp-pylsp) 119 120 (defcustom lsp-pylsp-plugins-preload-modules nil 121 "List of modules to import on startup" 122 :type 'lsp-string-vector 123 :group 'lsp-pylsp) 124 125 (defcustom lsp-pylsp-plugins-pylint-enabled nil 126 "Enable or disable the plugin." 127 :type 'boolean 128 :group 'lsp-pylsp) 129 130 (defcustom lsp-pylsp-plugins-pylint-args [] 131 "Arguments, passed to pylint" 132 :risky t 133 :type 'lsp-string-vector 134 :group 'lsp-pylsp) 135 136 (defcustom lsp-pylsp-plugins-pycodestyle-enabled nil 137 "Enable or disable the plugin." 138 :type 'boolean 139 :group 'lsp-pylsp) 140 141 (defcustom lsp-pylsp-plugins-pycodestyle-exclude nil 142 "Exclude files or directories which match these patterns." 143 :type 'lsp-string-vector 144 :group 'lsp-pylsp) 145 146 (defcustom lsp-pylsp-plugins-pycodestyle-filename nil 147 "When parsing directories, only check filenames matching these 148 patterns." 149 :type 'lsp-string-vector 150 :group 'lsp-pylsp) 151 152 (defcustom lsp-pylsp-plugins-pycodestyle-select nil 153 "Select errors and warnings" 154 :type 'lsp-string-vector 155 :group 'lsp-pylsp) 156 157 (defcustom lsp-pylsp-plugins-pycodestyle-ignore nil 158 "Ignore errors and warnings" 159 :type 'lsp-string-vector 160 :group 'lsp-pylsp) 161 162 (defcustom lsp-pylsp-plugins-pycodestyle-hang-closing nil 163 "Hang closing bracket instead of matching indentation of 164 opening bracket's line." 165 :type 'boolean 166 :group 'lsp-pylsp) 167 168 (defcustom lsp-pylsp-plugins-pycodestyle-max-line-length nil 169 "Set maximum allowed line length." 170 :type 'number 171 :group 'lsp-pylsp) 172 173 (defcustom lsp-pylsp-plugins-pydocstyle-enabled t 174 "Enable or disable the plugin." 175 :type 'boolean 176 :group 'lsp-pylsp) 177 178 (defcustom lsp-pylsp-plugins-pydocstyle-convention nil 179 "Choose the basic list of checked errors by specifying an 180 existing convention." 181 :type '(choice (:tag "pep257" "numpy")) 182 :group 'lsp-pylsp) 183 184 (defcustom lsp-pylsp-plugins-pydocstyle-add-ignore nil 185 "Ignore errors and warnings in addition to the specified 186 convention." 187 :type 'lsp-string-vector 188 :group 'lsp-pylsp) 189 190 (defcustom lsp-pylsp-plugins-pydocstyle-add-select nil 191 "Select errors and warnings in addition to the specified 192 convention." 193 :type 'lsp-string-vector 194 :group 'lsp-pylsp) 195 196 (defcustom lsp-pylsp-plugins-pydocstyle-ignore nil 197 "Ignore errors and warnings" 198 :type 'lsp-string-vector 199 :group 'lsp-pylsp) 200 201 (defcustom lsp-pylsp-plugins-pydocstyle-select nil 202 "Select errors and warnings" 203 :type 'lsp-string-vector 204 :group 'lsp-pylsp) 205 206 (defcustom lsp-pylsp-plugins-pydocstyle-match "(?!test_).*\\.py" 207 "Check only files that exactly match the given regular 208 expression; default is to match files that don't start with 209 `test_' but end with `.py'." 210 :type 'string 211 :group 'lsp-pylsp) 212 213 (defcustom lsp-pylsp-plugins-pydocstyle-match-dir "[^\\.].*" 214 "Search only dirs that exactly match the given regular 215 expression; default is to match dirs which do not begin with a 216 dot." 217 :type 'string 218 :group 'lsp-pylsp) 219 220 (defcustom lsp-pylsp-plugins-pyflakes-enabled nil 221 "Enable or disable the plugin." 222 :type 'boolean 223 :group 'lsp-pylsp) 224 225 (defcustom lsp-pylsp-plugins-rope-autoimport-enabled nil 226 "Enable or disable the plugin." 227 :type 'boolean 228 :group 'lsp-pylsp) 229 230 (defcustom lsp-pylsp-plugins-rope-autoimport-memory nil 231 "Make the autoimport database memory only. 232 233 Drastically increases startup time." 234 :type 'boolean 235 :group 'lsp-pylsp) 236 237 (defcustom lsp-pylsp-plugins-rope-completion-enabled nil 238 "Enable or disable the plugin." 239 :type 'boolean 240 :group 'lsp-pylsp) 241 242 (defcustom lsp-pylsp-plugins-rope-completion-eager nil 243 "Resolve documentation and detail eagerly." 244 :type 'boolean 245 :group 'lsp-pylsp) 246 247 (defcustom lsp-pylsp-plugins-autopep8-enabled nil 248 "Enable or disable the plugin." 249 :type 'boolean 250 :group 'lsp-pylsp) 251 252 (defcustom lsp-pylsp-plugins-yapf-enabled nil 253 "Enable or disable the plugin." 254 :type 'boolean 255 :group 'lsp-pylsp) 256 257 (defcustom lsp-pylsp-plugins-black-enabled nil 258 "Enable or disable the plugin." 259 :type 'boolean 260 :group 'lsp-pylsp) 261 262 (defcustom lsp-pylsp-plugins-isort-enabled nil 263 "Enable or disable the plugin." 264 :type 'boolean 265 :group 'lsp-pylsp) 266 267 (defcustom lsp-pylsp-rope-extension-modules nil 268 "Builtin and c-extension modules that are allowed to be 269 imported and inspected by rope." 270 :type 'string 271 :group 'lsp-pylsp) 272 273 (defcustom lsp-pylsp-rope-rope-folder nil 274 "The name of the folder in which rope stores project 275 configurations and data. Pass `nil` for not using such a folder 276 at all." 277 :type 'lsp-string-vector 278 :group 'lsp-pylsp) 279 280 (defcustom lsp-pylsp-plugins-flake8-enabled t 281 "Enable or disable the plugin." 282 :type 'boolean 283 :group 'lsp-pylsp) 284 285 (defcustom lsp-pylsp-plugins-flake8-exclude nil 286 "List of glob patterns to exclude from checks." 287 :type 'lsp-string-vector 288 :group 'lsp-pylsp) 289 290 (defcustom lsp-pylsp-plugins-flake8-filename nil 291 "List of glob patterns to include for checks." 292 :type 'lsp-string-vector 293 :group 'lsp-pylsp) 294 295 (defcustom lsp-pylsp-plugins-flake8-hang-closing nil 296 "Toggle whether pycodestyle should enforce matching the indentation of the 297 opening bracket’s line. When you specify this, it will prefer that you hang the 298 closing bracket rather than match the indentation." 299 :type 'boolean 300 :group 'lsp-pylsp) 301 302 (defcustom lsp-pylsp-plugins-flake8-ignore nil 303 "A list of codes to ignore." 304 :type 'lsp-string-vector 305 :group 'lsp-pylsp) 306 307 (defcustom lsp-pylsp-plugins-flake8-max-line-length nil 308 "Set the maximum length that any line (with some exceptions) may be. 309 Exceptions include lines that are either strings or comments which are 310 entirely URLs." 311 :type 'integer 312 :group 'lsp-pylsp) 313 314 (defcustom lsp-pylsp-plugins-flake8-select nil 315 "Specify the list of error codes you wish Flake8 to report. Similarly to 316 `lsp-pylsp-plugins-flake8-ignore'. You can specify a portion of an error code to 317 get all that start with that string. For example, you can use E, E4, E43, and 318 E431" 319 :type 'lsp-string-vector 320 :group 'lsp-pylsp) 321 322 (defcustom lsp-pylsp-plugins-flake8-config nil 323 "A path to a config file that will be the only config file read and used. 324 This will cause Flake8 to ignore all other config files that exist. 325 326 NOTE: other parameters as `lsp-pylsp-plugins-flake8-max-line-length' take 327 precedence over parameters referenced in config." 328 :type 'string 329 :group 'lsp-pylsp) 330 331 (defcustom lsp-pylsp-plugins-jedi-use-pyenv-environment nil 332 "If enabled, pass the environment got by pyenv to jedi" 333 :type 'boolean 334 :group 'lsp-pylsp) 335 336 (defcustom lsp-pylsp-plugins-jedi-environment nil 337 "Specify the environment that jedi runs on where <environment>/bin/python 338 should be the python executable. This option will be prioritized over 339 `lsp-pylsp-plugins-jedi-use-pyenv-environment'." 340 :type 'string 341 :group 'lsp-pylsp) 342 343 (defcustom lsp-pylsp-plugins-jedi-completion-fuzzy nil 344 "If enabled, uses fuzzy completion in jedi. Requires pylsp >= 0.32.0 345 Can hit performance, as well as lsp-mode implements its own fuzzy search on 346 completion items." 347 :type 'boolean 348 :group 'lsp-pylsp) 349 350 (defcustom lsp-pylsp-plugins-jedi-completion-include-class-objects t 351 "If enabled, adds class objects to completion in order to avoid snippet 352 with init args. 353 354 Has no effect if `lsp-pylsp-plugins-jedi-completion-include-params' is disabled. 355 Requires pylsp >= 0.33.0" 356 :type 'boolean 357 :group 'lsp-pylsp) 358 359 ;; See https://github.com/python-lsp/python-lsp-ruff#configuration 360 361 (defcustom lsp-pylsp-plugins-ruff-enabled nil 362 "Enable or disable the plugin." 363 :type 'boolean 364 :group 'lsp-pylsp) 365 366 (defcustom lsp-pylsp-plugins-ruff-executable nil 367 "Custom path to ruff." 368 :type 'file 369 :group 'lsp-pylsp) 370 371 (defcustom lsp-pylsp-plugins-ruff-config nil 372 "Custom config for ruff to use." 373 :type 'file 374 :group 'lsp-pylsp) 375 376 (defcustom lsp-pylsp-plugins-ruff-extend-select nil 377 "Rules that are additionally used by ruff." 378 :type 'lsp-string-vector 379 :group 'lsp-pylsp) 380 381 (defcustom lsp-pylsp-plugins-ruff-extend-ignore nil 382 "Rules that are additionally ignored by ruff." 383 :type 'lsp-string-vector 384 :group 'lsp-pylsp) 385 386 (defcustom lsp-pylsp-plugins-ruff-format nil 387 "Rules that should be fixed when running textDocument/formatting. 388 389 Note each rule must additionally be marked as fixable by ruff." 390 :type 'lsp-string-vector 391 :group 'lsp-pylsp) 392 393 (defcustom lsp-pylsp-plugins-ruff-severities nil 394 "Optional table of rules where a custom severity is desired." 395 :type '(alist :key-type (lsp-string-vector :tag "rules") :value-type (string :tag "severity")) 396 :group 'lsp-pylsp) 397 398 (defcustom lsp-pylsp-plugins-ruff-unsafe-fixes nil 399 "Whether or not to offer unsafe fixes as code actions. 400 401 Note this is ignored with the \"Fix All\" action." 402 :type 'boolean 403 :group 'lsp-pylsp) 404 405 ;; Rules that are ignored when a pyproject.toml or ruff.toml is present 406 (defcustom lsp-pylsp-plugins-ruff-line-length 88 407 "Line length to pass to ruff checking and formatting. 408 409 Note this variable will be ignored when a when a pyproject.toml or ruff.toml is 410 present." 411 :type 'integer 412 :group 'lsp-pylsp) 413 414 (defcustom lsp-pylsp-plugins-ruff-exclude nil 415 "Files to be excluded by ruff checking. 416 417 Note this variable will be ignored when a when a pyproject.toml or ruff.toml 418 is present." 419 :type 'lsp-string-vector 420 :group 'lsp-pylsp) 421 422 (defcustom lsp-pylsp-plugins-ruff-select nil 423 "Rules to be enabled by ruff. 424 425 Note this variable will be ignored when a when a pyproject.toml or ruff.toml 426 is present." 427 :type 'lsp-string-vector 428 :group 'lsp-pylsp) 429 430 (defcustom lsp-pylsp-plugins-ruff-ignore nil 431 "Rules to be ignored by ruff. 432 433 Note this variable will be ignored when a when a pyproject.toml or ruff.toml 434 is present." 435 :type 'lsp-string-vector 436 :group 'lsp-pylsp) 437 438 (defcustom lsp-pylsp-plugins-ruff-per-file-ignores nil 439 "Rules that should be ignored for specific files. 440 441 Note this variable will be ignored when a when a pyproject.toml or ruff.toml 442 is present." 443 :type '(alist :key-type (lsp-string-vector :tag "files") :value-type (string :tag "rule")) 444 :group 'lsp-pylsp) 445 446 (defcustom lsp-pylsp-plugins-ruff-preview nil 447 "Whether to enable the preview style linting and formatting. 448 449 Note this variable will be ignored when a when a pyproject.toml or ruff.toml 450 is present." 451 :type 'boolean 452 :group 'lsp-pylsp) 453 454 (defcustom lsp-pylsp-plugins-ruff-target-version nil 455 "The minimum python version to target (applies for both linting and formatting). 456 457 Note this variable will be ignored when a when a pyproject.toml or ruff.toml 458 is present." 459 :type 'string 460 :group 'lsp-pylsp) 461 462 ;; See https://github.com/python-lsp/pylsp-mypy#configuration 463 464 (defcustom lsp-pylsp-plugins-mypy-enabled nil 465 "Enable or disable the plugin." 466 :type 'boolean 467 :group 'lsp-pylsp) 468 469 (defcustom lsp-pylsp-plugins-mypy-live-mode t 470 "If non-nil, type checking is provided as you type. 471 472 This writes to a tempfile every time a check is done. Turning off live_mode 473 means you must save your changes for mypy diagnostics to update correctly." 474 :type 'boolean 475 :group 'lsp-pylsp) 476 477 (defcustom lsp-pylsp-plugins-mypy-dmypy nil 478 "If non-nil, use \"dmypy run\" rather than mypy. 479 480 This uses the dmypy daemon and may dramatically improve the responsiveness of 481 the pylsp server, however this currently does not work in live_mode. Enabling 482 this disables live_mode, even for conflicting configs." 483 :type 'boolean 484 :group 'lsp-pylsp) 485 486 (defcustom lsp-pylsp-plugins-mypy-strict nil 487 "If non-nil, enable the strict option of mypy. 488 489 This option often is too strict to be useful." 490 :type 'boolean 491 :group 'lsp-pylsp) 492 493 (defcustom lsp-pylsp-plugins-mypy-overrides [t] 494 "A list of alternate or supplemental command-line options. 495 496 This modifies the options passed to mypy or the mypy-specific ones passed to 497 dmypy run. When present, the special boolean member True is replaced with 498 the command-line options that would've been passed had overrides not been 499 specified. Later options take precedence, which allows for replacing or 500 negating individual default options (see mypy.main:process_options and mypy 501 --help | grep inverse)." 502 :type '(vector (choice string boolean)) 503 :group 'lsp-pylsp) 504 505 (defcustom lsp-pylsp-plugins-mypy-dmypy-status-file ".dmypy.json" 506 "The status file dmypy should use. 507 508 This modifies the --status-file option passed to dmypy given dmypy is active." 509 :type 'string 510 :group 'lsp-pylsp) 511 512 (defcustom lsp-pylsp-plugins-mypy-config-sub-paths nil 513 "Sub paths under which the mypy configuration file may be found. 514 515 For each directory searched for the mypy config file, this also searches the 516 sub paths specified here." 517 :type 'lsp-string-vector 518 :group 'lsp-pylsp) 519 520 (defcustom lsp-pylsp-plugins-mypy-report-progress nil 521 "If non-nil, report basic progress to the LSP client. 522 523 With this option, pylsp-mypy will report when mypy is running, given your editor 524 supports LSP progress reporting. For small files this might produce annoying 525 flashing, especially in with live_mode. For large projects, enabling this can 526 be helpful to assure yourself whether mypy is still running." 527 :type 'boolean 528 :group 'lsp-pylsp) 529 530 (defcustom lsp-pylsp-plugins-mypy-exclude nil 531 "A list of regular expressions which should be ignored. 532 533 The mypy runner wil not be invoked when a document path is matched by one of the 534 expressions. Note that this differs from the exclude directive of a mypy config 535 which is only used for recursively discovering files when mypy is invoked on a 536 whole directory. For both windows or unix platforms you should use forward 537 slashes (/) to indicate paths." 538 :type 'lsp-string-vector 539 :group 'lsp-pylsp) 540 541 (defcustom lsp-pylsp-rename-backend 'jedi 542 "Choose renaming backend. 543 544 Jedi is preferred but only works for python >= 3.6 and pylsp >= 0.32.0 545 Beware that Jedi is lazy and doesn't scan the whole project. 546 So it will rename only references it can find." 547 :type '(choice (const :tag "jedi" jedi) 548 (const :tag "rope" rope)) 549 :group 'lsp-pylsp) 550 551 (defun lsp-pylsp-get-pyenv-environment () 552 "Get the pyenv-managed environment for current workspace, where 553 <ENV>/bin/python is the corresponding Python executable" 554 (if lsp-pylsp-plugins-jedi-environment 555 lsp-pylsp-plugins-jedi-environment 556 (when lsp-pylsp-plugins-jedi-use-pyenv-environment 557 (let ((pyenv-version (getenv "PYENV_VERSION")) 558 (root (lsp-seq-first (lsp-find-roots-for-workspace lsp--cur-workspace (lsp-session))))) 559 (when root 560 (setenv "PYENV_VERSION" nil) 561 (let* ((pyenv-command-path (executable-find "pyenv")) 562 (python-env (when pyenv-command-path 563 (f-parent 564 (f-parent 565 (shell-command-to-string 566 (format "PYENV_DIR='%s' %s which python" 567 root pyenv-command-path))))))) 568 (if python-env (lsp--info "Configure pylsp with environment: %s" python-env) 569 (lsp--warn "Can't find the python environment for 570 %s even if 571 `lsp-pylsp-plugins-jedi-use-pyenv-environment` is 572 enabled") root) 573 (setenv "PYENV_VERSION" pyenv-version) 574 python-env)))))) 575 576 (lsp-register-custom-settings 577 '(("pylsp.rope.ropeFolder" lsp-pylsp-rope-rope-folder) 578 ("pylsp.rope.extensionModules" lsp-pylsp-rope-extension-modules) 579 ("pylsp.plugins.rope_rename.enabled" (lambda () (eq lsp-pylsp-rename-backend 'rope)) t) 580 ("pylsp.plugins.autopep8.enabled" lsp-pylsp-plugins-autopep8-enabled t) 581 ("pylsp.plugins.yapf.enabled" lsp-pylsp-plugins-yapf-enabled t) 582 ("pylsp.plugins.black.enabled" lsp-pylsp-plugins-black-enabled t) 583 ("pylsp.plugins.pyls_isort.enabled" lsp-pylsp-plugins-isort-enabled t) 584 ("pylsp.plugins.rope_autoimport.enabled" lsp-pylsp-plugins-rope-autoimport-enabled t) 585 ("pylsp.plugins.rope_autoimport.memory" lsp-pylsp-plugins-rope-autoimport-memory t) 586 ("pylsp.plugins.rope_completion.enabled" lsp-pylsp-plugins-rope-completion-enabled t) 587 ("pylsp.plugins.rope_completion.eager" lsp-pylsp-plugins-rope-completion-eager t) 588 ("pylsp.plugins.pyflakes.enabled" lsp-pylsp-plugins-pyflakes-enabled t) 589 ("pylsp.plugins.pydocstyle.matchDir" lsp-pylsp-plugins-pydocstyle-match-dir) 590 ("pylsp.plugins.pydocstyle.match" lsp-pylsp-plugins-pydocstyle-match) 591 ("pylsp.plugins.pydocstyle.select" lsp-pylsp-plugins-pydocstyle-select) 592 ("pylsp.plugins.pydocstyle.ignore" lsp-pylsp-plugins-pydocstyle-ignore) 593 ("pylsp.plugins.pydocstyle.addSelect" lsp-pylsp-plugins-pydocstyle-add-select) 594 ("pylsp.plugins.pydocstyle.addIgnore" lsp-pylsp-plugins-pydocstyle-add-ignore) 595 ("pylsp.plugins.pydocstyle.convention" lsp-pylsp-plugins-pydocstyle-convention) 596 ("pylsp.plugins.pydocstyle.enabled" lsp-pylsp-plugins-pydocstyle-enabled t) 597 ("pylsp.plugins.pycodestyle.maxLineLength" lsp-pylsp-plugins-pycodestyle-max-line-length) 598 ("pylsp.plugins.pycodestyle.hangClosing" lsp-pylsp-plugins-pycodestyle-hang-closing t) 599 ("pylsp.plugins.pycodestyle.ignore" lsp-pylsp-plugins-pycodestyle-ignore) 600 ("pylsp.plugins.pycodestyle.select" lsp-pylsp-plugins-pycodestyle-select) 601 ("pylsp.plugins.pycodestyle.filename" lsp-pylsp-plugins-pycodestyle-filename) 602 ("pylsp.plugins.pycodestyle.exclude" lsp-pylsp-plugins-pycodestyle-exclude) 603 ("pylsp.plugins.pycodestyle.enabled" lsp-pylsp-plugins-pycodestyle-enabled t) 604 ("pylsp.plugins.pylint.enabled" lsp-pylsp-plugins-pylint-enabled t) 605 ("pylsp.plugins.pylint.args" lsp-pylsp-plugins-pylint-args) 606 ("pylsp.plugins.flake8.enabled" lsp-pylsp-plugins-flake8-enabled) 607 ("pylsp.plugins.flake8.exclude" lsp-pylsp-plugins-flake8-exclude) 608 ("pylsp.plugins.flake8.filename" lsp-pylsp-plugins-flake8-filename) 609 ("pylsp.plugins.flake8.hangClosing" lsp-pylsp-plugins-flake8-hang-closing) 610 ("pylsp.plugins.flake8.ignore" lsp-pylsp-plugins-flake8-ignore) 611 ("pylsp.plugins.flake8.maxLineLength" lsp-pylsp-plugins-flake8-max-line-length) 612 ("pylsp.plugins.flake8.select" lsp-pylsp-plugins-flake8-select) 613 ("pylsp.plugins.flake8.config" lsp-pylsp-plugins-flake8-config) 614 ("pylsp.plugins.preload.modules" lsp-pylsp-plugins-preload-modules) 615 ("pylsp.plugins.preload.enabled" lsp-pylsp-plugins-preload-enabled t) 616 ("pylsp.plugins.mccabe.threshold" lsp-pylsp-plugins-mccabe-threshold) 617 ("pylsp.plugins.mccabe.enabled" lsp-pylsp-plugins-mccabe-enabled t) 618 ("pylsp.plugins.ruff.enabled" lsp-pylsp-plugins-ruff-enabled t) 619 ("pylsp.plugins.ruff.executable" lsp-pylsp-plugins-ruff-executable) 620 ("pylsp.plugins.ruff.config" lsp-pylsp-plugins-ruff-config) 621 ("pylsp.plugins.ruff.extendSelect" lsp-pylsp-plugins-ruff-extend-select) 622 ("pylsp.plugins.ruff.extendIgnore" lsp-pylsp-plugins-ruff-extend-ignore) 623 ("pylsp.plugins.ruff.format" lsp-pylsp-plugins-ruff-format) 624 ("pylsp.plugins.ruff.severities" lsp-pylsp-plugins-ruff-severities) 625 ("pylsp.plugins.ruff.unsafeFixes" lsp-pylsp-plugins-ruff-unsafe-fixes t) 626 ("pylsp.plugins.ruff.lineLength" lsp-pylsp-plugins-ruff-line-length) 627 ("pylsp.plugins.ruff.exclude" lsp-pylsp-plugins-ruff-exclude) 628 ("pylsp.plugins.ruff.select" lsp-pylsp-plugins-ruff-select) 629 ("pylsp.plugins.ruff.ignore" lsp-pylsp-plugins-ruff-ignore) 630 ("pylsp.plugins.ruff.perFileIgnores" lsp-pylsp-plugins-ruff-per-file-ignores) 631 ("pylsp.plugins.ruff.preview" lsp-pylsp-plugins-ruff-preview t) 632 ("pylsp.plugins.ruff.targetVersion" lsp-pylsp-plugins-ruff-target-version) 633 ("pylsp.plugins.pylsp_mypy.enabled" lsp-pylsp-plugins-mypy-enabled t) 634 ("pylsp.plugins.pylsp_mypy.live_mode" lsp-pylsp-plugins-mypy-live-mode t) 635 ("pylsp.plugins.pylsp_mypy.dmypy" lsp-pylsp-plugins-mypy-dmypy t) 636 ("pylsp.plugins.pylsp_mypy.strict" lsp-pylsp-plugins-mypy-strict t) 637 ("pylsp.plugins.pylsp_mypy.overrides" lsp-pylsp-plugins-mypy-overrides) 638 ("pylsp.plugins.pylsp_mypy.dmypy_status_file" lsp-pylsp-plugins-mypy-dmypy-status-file) 639 ("pylsp.plugins.pylsp_mypy.config_sub_paths" lsp-pylsp-plugins-mypy-config-sub-paths) 640 ("pylsp.plugins.pylsp_mypy.report_progress" lsp-pylsp-plugins-mypy-report-progress t) 641 ("pylsp.plugins.pylsp_mypy.exclude" lsp-pylsp-plugins-mypy-exclude) 642 ("pylsp.plugins.jedi_symbols.all_scopes" lsp-pylsp-plugins-jedi-symbols-all-scopes t) 643 ("pylsp.plugins.jedi_symbols.enabled" lsp-pylsp-plugins-jedi-symbols-enabled t) 644 ("pylsp.plugins.jedi_signature_help.enabled" lsp-pylsp-plugins-jedi-signature-help-enabled t) 645 ("pylsp.plugins.jedi_references.enabled" lsp-pylsp-plugins-jedi-references-enabled t) 646 ("pylsp.plugins.jedi_hover.enabled" lsp-pylsp-plugins-jedi-hover-enabled t) 647 ("pylsp.plugins.jedi_definition.follow_builtin_imports" lsp-pylsp-plugins-jedi-definition-follow-builtin-imports t) 648 ("pylsp.plugins.jedi_definition.follow_imports" lsp-pylsp-plugins-jedi-definition-follow-imports t) 649 ("pylsp.plugins.jedi_definition.enabled" lsp-pylsp-plugins-jedi-definition-enabled t) 650 ("pylsp.plugins.jedi_completion.include_params" lsp-pylsp-plugins-jedi-completion-include-params t) 651 ("pylsp.plugins.jedi_completion.enabled" lsp-pylsp-plugins-jedi-completion-enabled t) 652 ("pylsp.plugins.jedi_completion.include_class_objects" lsp-pylsp-plugins-jedi-completion-include-class-objects t) 653 ("pylsp.plugins.jedi.environment" lsp-pylsp-get-pyenv-environment) 654 ("pylsp.plugins.jedi_completion.fuzzy" lsp-pylsp-plugins-jedi-completion-fuzzy t) 655 ("pylsp.plugins.jedi_rename.enabled" (lambda () (eq lsp-pylsp-rename-backend 'jedi)) t) 656 ("pylsp.configurationSources" lsp-pylsp-configuration-sources))) 657 658 (lsp-register-client 659 (make-lsp-client :new-connection (lsp-stdio-connection 660 (lambda () lsp-pylsp-server-command)) 661 :activation-fn (lsp-activate-on "python") 662 :priority -1 663 :server-id 'pylsp 664 :library-folders-fn (lambda (_workspace) lsp-clients-pylsp-library-directories) 665 :initialized-fn (lambda (workspace) 666 (with-lsp-workspace workspace 667 (lsp--set-configuration (lsp-configuration-section "pylsp")))))) 668 669 (lsp-consistency-check lsp-pylsp) 670 671 (provide 'lsp-pylsp) 672 ;;; lsp-pylsp.el ends here