Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workspace configuration options not working with pyls #590

Closed
mohkale opened this issue Jan 11, 2021 · 12 comments
Closed

workspace configuration options not working with pyls #590

mohkale opened this issue Jan 11, 2021 · 12 comments

Comments

@mohkale
Copy link
Contributor

mohkale commented Jan 11, 2021

I'm trying to configure pyls to use the pydocstyle plugin (which is disabled by default) but it doesn't seem to be working :-(.

I've been testing use this python file.

Setup Instructions

;; make pyls verbose
(with-eval-after-load 'eglot
  (push '(python-mode "pyls" "--verbose") eglot-server-programs))

(setq eglot-workspace-configuration
      '((:pyls
         (:plugins
          (:pydocstyle
           (:enabled . t))
          (:jedi_completion
           (:fuzzy . t)
           (:follow_builtin_imports . :json-false))))))

If I run (message (json-encode eglot-workspace-configuration)) I get:

{"pyls":{"plugins":{"pydocstyle":{"enabled":true},"jedi_completion":{"fuzzy":true,"follow_builtin_imports":false}}}}

which all appears to be correct to me :/.

stderr

2021-01-11 20:29:56,816 UTC - INFO - pyls.python_ls - Starting PythonLanguageServer IO language server
2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin autopep8 from <module 'pyls.plugins.autopep8_format' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/autopep8_format.py'>
2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin flake8 from <module 'pyls.plugins.flake8_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/flake8_lint.py'>
2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin folding from <module 'pyls.plugins.folding' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/folding.py'>
2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_completion from <module 'pyls.plugins.jedi_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/jedi_completion.py'>
2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_definition from <module 'pyls.plugins.definition' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/definition.py'>
2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_highlight from <module 'pyls.plugins.highlight' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/highlight.py'>
2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_hover from <module 'pyls.plugins.hover' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/hover.py'>
2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_references from <module 'pyls.plugins.references' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/references.py'>
2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_rename from <module 'pyls.plugins.jedi_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/jedi_rename.py'>
2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_signature_help from <module 'pyls.plugins.signature' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/signature.py'>
2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_symbols from <module 'pyls.plugins.symbols' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/symbols.py'>
2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin mccabe from <module 'pyls.plugins.mccabe_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/mccabe_lint.py'>
2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin preload from <module 'pyls.plugins.preload_imports' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/preload_imports.py'>
2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin pycodestyle from <module 'pyls.plugins.pycodestyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pycodestyle_lint.py'>
2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin pydocstyle from <module 'pyls.plugins.pydocstyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pydocstyle_lint.py'>
2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin pyflakes from <module 'pyls.plugins.pyflakes_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pyflakes_lint.py'>
2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin pylint from <module 'pyls.plugins.pylint_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pylint_lint.py'>
2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin rope_completion from <module 'pyls.plugins.rope_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_completion.py'>
2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin rope_rename from <module 'pyls.plugins.rope_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_rename.py'>
2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin yapf from <module 'pyls.plugins.yapf_format' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/yapf_format.py'>
2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Disabled plugins: [<module 'pyls.plugins.flake8_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/flake8_lint.py'>, <module 'pyls.plugins.pydocstyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pydocstyle_lint.py'>, <module 'pyls.plugins.pylint_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pylint_lint.py'>, <module 'pyls.plugins.rope_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_completion.py'>, <module 'pyls.plugins.rope_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_rename.py'>]
2021-01-11 20:29:57,062 UTC - INFO - pyls.python_ls - Server capabilities: {'codeActionProvider': True, 'codeLensProvider': {'resolveProvider': False}, 'completionProvider': {'resolveProvider': False, 'triggerCharacters': ['.']}, 'documentFormattingProvider': True, 'documentHighlightProvider': True, 'documentRangeFormattingProvider': True, 'documentSymbolProvider': True, 'definitionProvider': True, 'executeCommandProvider': {'commands': []}, 'hoverProvider': True, 'referencesProvider': True, 'renameProvider': True, 'foldingRangeProvider': True, 'signatureHelpProvider': {'triggerCharacters': ['(', ',', '=']}, 'textDocumentSync': {'change': 2, 'save': {'includeText': True}, 'openClose': True}, 'workspace': {'workspaceFolders': {'supported': True, 'changeNotifications': True}}, 'experimental': {}}
2021-01-11 20:29:57,079 UTC - INFO - pyls.config.config - Updated settings to {':plugins': {':pydocstyle': {':enabled': True}, ':jedi_completion': {':fuzzy': True, ':follow_builtin_imports': False}}}
2021-01-11 20:29:57,080 UTC - INFO - pyls.config.config - Disabled plugins: [<module 'pyls.plugins.flake8_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/flake8_lint.py'>, <module 'pyls.plugins.pydocstyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pydocstyle_lint.py'>, <module 'pyls.plugins.pylint_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pylint_lint.py'>, <module 'pyls.plugins.rope_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_completion.py'>, <module 'pyls.plugins.rope_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_rename.py'>]
2021-01-11 20:29:57,080 UTC - INFO - pyls.config.config - Updated settings to {':plugins': {':pydocstyle': {':enabled': True}, ':jedi_completion': {':fuzzy': True, ':follow_builtin_imports': False}}}
2021-01-11 20:29:57,081 UTC - INFO - pyls.config.config - Disabled plugins: [<module 'pyls.plugins.flake8_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/flake8_lint.py'>, <module 'pyls.plugins.pydocstyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pydocstyle_lint.py'>, <module 'pyls.plugins.pylint_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pylint_lint.py'>, <module 'pyls.plugins.rope_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_completion.py'>, <module 'pyls.plugins.rope_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_rename.py'>]
2021-01-11 20:29:57,081 UTC - INFO - pyls.config.config - Updated settings to {':plugins': {':pydocstyle': {':enabled': True}, ':jedi_completion': {':fuzzy': True, ':follow_builtin_imports': False}}}
2021-01-11 20:29:57,081 UTC - INFO - pyls.config.config - Disabled plugins: [<module 'pyls.plugins.flake8_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/flake8_lint.py'>, <module 'pyls.plugins.pydocstyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pydocstyle_lint.py'>, <module 'pyls.plugins.pylint_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pylint_lint.py'>, <module 'pyls.plugins.rope_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_completion.py'>, <module 'pyls.plugins.rope_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_rename.py'>]

It looks like eglot is sending the workspace configuration with each key containing a leading :, is this not how we're supposed to set configurations?

Server Transcript

[client-request] (id:1) Mon Jan 11 20:29:56 2021:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
 (:processId 100839 :rootPath "/home/mohkale/" :rootUri "file:///home/mohkale/" :initializationOptions #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                                                                                                     ())
  :capabilities
  (:workspace
   (:applyEdit t :executeCommand
    (:dynamicRegistration :json-false)
    :workspaceEdit
    (:documentChanges :json-false)
    :didChangeWatchedFiles
    (:dynamicRegistration t)
    :symbol
    (:dynamicRegistration :json-false)
    :configuration t)
   :textDocument
   (:synchronization
    (:dynamicRegistration :json-false :willSave t :willSaveWaitUntil t :didSave t)
    :completion
    (:dynamicRegistration :json-false :completionItem
     (:snippetSupport t)
     :contextSupport t)
    :hover
    (:dynamicRegistration :json-false :contentFormat
     ["markdown" "plaintext"])
    :signatureHelp
    (:dynamicRegistration :json-false :signatureInformation
     (:parameterInformation
      (:labelOffsetSupport t)))
    :references
    (:dynamicRegistration :json-false)
    :definition
    (:dynamicRegistration :json-false)
    :declaration
    (:dynamicRegistration :json-false)
    :implementation
    (:dynamicRegistration :json-false)
    :typeDefinition
    (:dynamicRegistration :json-false)
    :documentSymbol
    (:dynamicRegistration :json-false :hierarchicalDocumentSymbolSupport t :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]))
    :documentHighlight
    (:dynamicRegistration :json-false)
    :codeAction
    (:dynamicRegistration :json-false :codeActionLiteralSupport
     (:codeActionKind
      (:valueSet
       ["quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"]))
     :isPreferredSupport t)
    :formatting
    (:dynamicRegistration :json-false)
    :rangeFormatting
    (:dynamicRegistration :json-false)
    :rename
    (:dynamicRegistration :json-false)
    :publishDiagnostics
    (:relatedInformation :json-false))
   :experimental #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                               ()))))
[stderr] 2021-01-11 20:29:56,816 UTC - INFO - pyls.python_ls - Starting PythonLanguageServer IO language server
[stderr] 2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin autopep8 from <module 'pyls.plugins.autopep8_format' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/autopep8_format.py'>
[stderr] 2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin flake8 from <module 'pyls.plugins.flake8_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/flake8_lint.py'>
[stderr] 2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin folding from <module 'pyls.plugins.folding' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/folding.py'>
[stderr] 2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_completion from <module 'pyls.plugins.jedi_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/jedi_completion.py'>
[stderr] 2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_definition from <module 'pyls.plugins.definition' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/definition.py'>
[stderr] 2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_highlight from <module 'pyls.plugins.highlight' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/highlight.py'>
[stderr] 2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_hover from <module 'pyls.plugins.hover' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/hover.py'>
[stderr] 2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_references from <module 'pyls.plugins.references' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/references.py'>
[stderr] 2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_rename from <module 'pyls.plugins.jedi_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/jedi_rename.py'>
[stderr] 2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_signature_help from <module 'pyls.plugins.signature' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/signature.py'>
[stderr] 2021-01-11 20:29:56,996 UTC - INFO - pyls.config.config - Loaded pyls plugin jedi_symbols from <module 'pyls.plugins.symbols' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/symbols.py'>
[stderr] 2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin mccabe from <module 'pyls.plugins.mccabe_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/mccabe_lint.py'>
[stderr] 2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin preload from <module 'pyls.plugins.preload_imports' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/preload_imports.py'>
[stderr] 2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin pycodestyle from <module 'pyls.plugins.pycodestyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pycodestyle_lint.py'>
[stderr] 2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin pydocstyle from <module 'pyls.plugins.pydocstyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pydocstyle_lint.py'>
[stderr] 2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin pyflakes from <module 'pyls.plugins.pyflakes_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pyflakes_lint.py'>
[stderr] 2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin pylint from <module 'pyls.plugins.pylint_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pylint_lint.py'>
[stderr] 2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin rope_completion from <module 'pyls.plugins.rope_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_completion.py'>
[stderr] 2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin rope_rename from <module 'pyls.plugins.rope_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_rename.py'>
[stderr] 2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin yapf from <module 'pyls.plugins.yapf_format' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/yapf_format.py'>
[stderr] 2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Loaded pyls plugin yapf from <module 'pyls.plugins.yapf_format' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/yapf_format.py'>
[server-reply] (id:1) Mon Jan 11 20:29:57 2021:
(:jsonrpc "2.0" :id 1 :result
 (:capabilities
  (:codeActionProvider t :codeLensProvider
   (:resolveProvider :json-false)
   :completionProvider
   (:resolveProvider :json-false :triggerCharacters
    ["."])
   :documentFormattingProvider t :documentHighlightProvider t :documentRangeFormattingProvider t :documentSymbolProvider t :definitionProvider t :executeCommandProvider
   (:commands
    [])
   :hoverProvider t :referencesProvider t :renameProvider t :foldingRangeProvider t :signatureHelpProvider
   (:triggerCharacters
    ["(" "," "="])
   :textDocumentSync
   (:change 2 :save
    (:includeText t)
    :openClose t)
   :workspace
   (:workspaceFolders
    (:supported t :changeNotifications t))
   :experimental nil)))
[client-notification] Mon Jan 11 20:29:57 2021:
(:jsonrpc "2.0" :method "initialized" :params #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                                            ()))
[client-notification] Mon Jan 11 20:29:57 2021:
(:jsonrpc "2.0" :method "textDocument/didOpen" :params
 (:textDocument
  (:uri "file:///home/mohkale/test.py" :version 0 :languageId "python" :text "# No docstring, so we can test D100\nfrom functools import wraps\nimport os\nfrom .expected import Expectation\nfrom typing import overload\n\n\nexpectation = Expectation()\nexpect = expectation.expect\n\nexpect('class_', 'D101: Missing docstring in public class')\n\n\nclass class_:\n\n    expect('meta', 'D106: Missing docstring in public nested class')\n\n    class meta:\n        \"\"\"\"\"\"\n\n    @expect('D102: Missing docstring in public method')\n    def method(self=None):\n        pass\n\n    def _ok_since_private(self=None):\n        pass\n\n    @overload\n    def overloaded_method(self, a: int) -> str:\n        ...\n\n    @overload\n    def overloaded_method(self, a: str) -> str:\n        \"\"\"Foo bar documentation.\"\"\"\n        ...\n\n    def overloaded_method(a):\n        \"\"\"Foo bar documentation.\"\"\"\n        return str(a)\n\n    expect('overloaded_method',\n           \"D418: Function/ Method decorated with @overload\"\n           \" shouldn't contain a docstring\")\n\n    @expect('D102: Missing docstring in public method')\n    def __new__(self=None):\n        pass\n\n    @expect('D107: Missing docstring in __init__')\n    def __init__(self=None):\n        pass\n\n    @expect('D105: Missing docstring in magic method')\n    def __str__(self=None):\n        pass\n\n    @expect('D102: Missing docstring in public method')\n    def __call__(self=None, x=None, y=None, z=None):\n        pass\n\n\n@expect('D103: Missing docstring in public function')\ndef function():\n    \"\"\" \"\"\"\n    def ok_since_nested():\n        pass\n\n    @expect('D103: Missing docstring in public function')\n    def nested():\n        ''\n\n\ndef function_with_nesting():\n    \"\"\"Foo bar documentation.\"\"\"\n    @overload\n    def nested_overloaded_func(a: int) -> str:\n        ...\n\n    @overload\n    def nested_overloaded_func(a: str) -> str:\n        \"\"\"Foo bar documentation.\"\"\"\n        ...\n\n    def nested_overloaded_func(a):\n        \"\"\"Foo bar documentation.\"\"\"\n        return str(a)\n\n\nexpect('nested_overloaded_func',\n       \"D418: Function/ Method decorated with @overload\"\n       \" shouldn't contain a docstring\")\n\n\n@overload\ndef overloaded_func(a: int) -> str:\n    ...\n\n\n@overload\ndef overloaded_func(a: str) -> str:\n    \"\"\"Foo bar documentation.\"\"\"\n    ...\n\n\ndef overloaded_func(a):\n    \"\"\"Foo bar documentation.\"\"\"\n    return str(a)\n\n\nexpect('overloaded_func',\n       \"D418: Function/ Method decorated with @overload\"\n       \" shouldn't contain a docstring\")\n\n\n@expect('D200: One-line docstring should fit on one line with quotes '\n        '(found 3)')\n@expect('D212: Multi-line docstring summary should start at the first line')\ndef asdlkfasd():\n    \"\"\"\n    Wrong.\n    \"\"\"\n\n\n@expect('D201: No blank lines allowed before function docstring (found 1)')\ndef leading_space():\n\n    \"\"\"Leading space.\"\"\"\n\n\n@expect('D202: No blank lines allowed after function docstring (found 1)')\ndef trailing_space():\n    \"\"\"Leading space.\"\"\"\n\n    pass\n\n\n@expect('D201: No blank lines allowed before function docstring (found 1)')\n@expect('D202: No blank lines allowed after function docstring (found 1)')\ndef trailing_and_leading_space():\n\n    \"\"\"Trailing and leading space.\"\"\"\n\n    pass\n\n\nexpect('LeadingSpaceMissing',\n       'D203: 1 blank line required before class docstring (found 0)')\n\n\nclass LeadingSpaceMissing:\n    \"\"\"Leading space missing.\"\"\"\n\n\nexpect('WithLeadingSpace',\n       'D211: No blank lines allowed before class docstring (found 1)')\n\n\nclass WithLeadingSpace:\n\n    \"\"\"With leading space.\"\"\"\n\n\nexpect('TrailingSpace',\n       'D204: 1 blank line required after class docstring (found 0)')\nexpect('TrailingSpace',\n       'D211: No blank lines allowed before class docstring (found 1)')\n\n\nclass TrailingSpace:\n\n    \"\"\"TrailingSpace.\"\"\"\n    pass\n\n\nexpect('LeadingAndTrailingSpaceMissing',\n       'D203: 1 blank line required before class docstring (found 0)')\nexpect('LeadingAndTrailingSpaceMissing',\n       'D204: 1 blank line required after class docstring (found 0)')\n\n\nclass LeadingAndTrailingSpaceMissing:\n    \"\"\"Leading and trailing space missing.\"\"\"\n    pass\n\n\n@expect('D205: 1 blank line required between summary line and description '\n        '(found 0)')\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef multi_line_zero_separating_blanks():\n    \"\"\"Summary.\n    Description.\n\n    \"\"\"\n\n\n@expect('D205: 1 blank line required between summary line and description '\n        '(found 2)')\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef multi_line_two_separating_blanks():\n    \"\"\"Summary.\n\n\n    Description.\n\n    \"\"\"\n\n\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef multi_line_one_separating_blanks():\n    \"\"\"Summary.\n\n    Description.\n\n    \"\"\"\n\n\n@expect('D207: Docstring is under-indented')\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef asdfsdf():\n    \"\"\"Summary.\n\nDescription.\n\n    \"\"\"\n\n\n@expect('D207: Docstring is under-indented')\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef asdsdfsdffsdf():\n    \"\"\"Summary.\n\n    Description.\n\n\"\"\"\n\n\n@expect('D208: Docstring is over-indented')\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef asdfsdsdf24():\n    \"\"\"Summary.\n\n       Description.\n\n    \"\"\"\n\n\n@expect('D208: Docstring is over-indented')\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef asdfsdsdfsdf24():\n    \"\"\"Summary.\n\n    Description.\n\n        \"\"\"\n\n\n@expect('D208: Docstring is over-indented')\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef asdfsdfsdsdsdfsdf24():\n    \"\"\"Summary.\n\n        Description.\n\n    \"\"\"\n\n\n@expect('D209: Multi-line docstring closing quotes should be on a separate '\n        'line')\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef asdfljdf24():\n    \"\"\"Summary.\n\n    Description.\"\"\"\n\n\n@expect('D210: No whitespaces allowed surrounding docstring text')\ndef endswith():\n    \"\"\"Whitespace at the end. \"\"\"\n\n\n@expect('D210: No whitespaces allowed surrounding docstring text')\ndef around():\n    \"\"\" Whitespace at everywhere. \"\"\"\n\n\n@expect('D210: No whitespaces allowed surrounding docstring text')\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef multiline():\n    \"\"\" Whitespace at the beginning.\n\n    This is the end.\n    \"\"\"\n\n\n@expect('D300: Use \"\"\"triple double quotes\"\"\" (found \\'\\'\\'-quotes)')\ndef triple_single_quotes_raw():\n    r'''Summary.'''\n\n\n@expect('D300: Use \"\"\"triple double quotes\"\"\" (found \\'\\'\\'-quotes)')\ndef triple_single_quotes_raw_uppercase():\n    R'''Summary.'''\n\n\n@expect('D300: Use \"\"\"triple double quotes\"\"\" (found \\'-quotes)')\ndef single_quotes_raw():\n    r'Summary.'\n\n\n@expect('D300: Use \"\"\"triple double quotes\"\"\" (found \\'-quotes)')\ndef single_quotes_raw_uppercase():\n    R'Summary.'\n\n\n@expect('D300: Use \"\"\"triple double quotes\"\"\" (found \\'-quotes)')\n@expect('D301: Use r\"\"\" if any backslashes in a docstring')\ndef single_quotes_raw_uppercase_backslash():\n    R'Sum\\mary.'\n\n\n@expect('D301: Use r\"\"\" if any backslashes in a docstring')\ndef double_quotes_backslash():\n    \"\"\"Sum\\\\mary.\"\"\"\n\n\n@expect('D301: Use r\"\"\" if any backslashes in a docstring')\ndef double_quotes_backslash_uppercase():\n    R\"\"\"Sum\\\\mary.\"\"\"\n\n\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef exceptions_of_D301():\n    \"\"\"Exclude some backslashes from D301.\n\n    In particular, line continuations \\\n    and unicode literals \\u0394 and \\N{GREEK CAPITAL LETTER DELTA}.\n    They are considered to be intentionally unescaped.\n    \"\"\"\n\n\n@expect(\"D400: First line should end with a period (not 'y')\")\n@expect(\"D415: First line should end with a period, question mark, \"\n        \"or exclamation point (not 'y')\")\ndef lwnlkjl():\n    \"\"\"Summary\"\"\"\n\n\n@expect(\"D401: First line should be in imperative mood \"\n        \"(perhaps 'Return', not 'Returns')\")\ndef liouiwnlkjl():\n    \"\"\"Returns foo.\"\"\"\n\n\n@expect(\"D401: First line should be in imperative mood; try rephrasing \"\n        \"(found 'Constructor')\")\ndef sdgfsdg23245():\n    \"\"\"Constructor for a foo.\"\"\"\n\n\n@expect(\"D401: First line should be in imperative mood; try rephrasing \"\n        \"(found 'Constructor')\")\ndef sdgfsdg23245777():\n    \"\"\"Constructor.\"\"\"\n\n\n@expect('D402: First line should not be the function\\'s \"signature\"')\ndef foobar():\n    \"\"\"Signature: foobar().\"\"\"\n\n\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef new_209():\n    \"\"\"First line.\n\n    More lines.\n    \"\"\"\n    pass\n\n\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef old_209():\n    \"\"\"One liner.\n\n    Multi-line comments. OK to have extra blank line\n\n    \"\"\"\n\n\n@expect(\"D103: Missing docstring in public function\")\ndef oneliner_d102(): return\n\n\n@expect(\"D400: First line should end with a period (not 'r')\")\n@expect(\"D415: First line should end with a period, question mark,\"\n        \" or exclamation point (not 'r')\")\ndef oneliner_withdoc(): \"\"\"One liner\"\"\"\n\n\ndef ignored_decorator(func):   # noqa: D400,D401,D415\n    \"\"\"Runs something\"\"\"\n    func()\n    pass\n\n\ndef decorator_for_test(func):   # noqa: D400,D401,D415\n    \"\"\"Runs something\"\"\"\n    func()\n    pass\n\n\n@ignored_decorator\ndef oneliner_ignored_decorator(): \"\"\"One liner\"\"\"\n\n\n@decorator_for_test\n@expect(\"D400: First line should end with a period (not 'r')\")\n@expect(\"D415: First line should end with a period, question mark,\"\n        \" or exclamation point (not 'r')\")\ndef oneliner_with_decorator_expecting_errors(): \"\"\"One liner\"\"\"\n\n\n@decorator_for_test\ndef valid_oneliner_with_decorator(): \"\"\"One liner.\"\"\"\n\n\n@expect(\"D207: Docstring is under-indented\")\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef docstring_start_in_same_line(): \"\"\"First Line.\n\n    Second Line\n    \"\"\"\n\n\ndef function_with_lambda_arg(x=lambda y: y):\n    \"\"\"Wrap the given lambda.\"\"\"\n\n\n@expect('D213: Multi-line docstring summary should start at the second line')\ndef a_following_valid_function(x=None):\n    \"\"\"Check for a bug where the previous function caused an assertion.\n\n    The assertion was caused in the next function, so this one is necessary.\n\n    \"\"\"\n\n\ndef outer_function():\n    \"\"\"Do something.\"\"\"\n    def inner_function():\n        \"\"\"Do inner something.\"\"\"\n        return 0\n\n\n@expect(\"D400: First line should end with a period (not 'g')\")\n@expect(\"D401: First line should be in imperative mood \"\n        \"(perhaps 'Run', not 'Runs')\")\n@expect(\"D415: First line should end with a period, question mark, \"\n        \"or exclamation point (not 'g')\")\ndef docstring_bad():\n    \"\"\"Runs something\"\"\"\n    pass\n\n\ndef docstring_bad_ignore_all():  # noqa\n    \"\"\"Runs something\"\"\"\n    pass\n\n\ndef docstring_bad_ignore_one():  # noqa: D400,D401,D415\n    \"\"\"Runs something\"\"\"\n    pass\n\n\n@expect(\"D401: First line should be in imperative mood \"\n        \"(perhaps 'Run', not 'Runs')\")\ndef docstring_ignore_some_violations_but_catch_D401():  # noqa: E501,D400,D415\n    \"\"\"Runs something\"\"\"\n    pass\n\n\n@expect(\n    \"D401: First line should be in imperative mood \"\n    \"(perhaps 'Initiate', not 'Initiates')\"\n)\ndef docstring_initiates():\n    \"\"\"Initiates the process.\"\"\"\n\n\n@expect(\n    \"D401: First line should be in imperative mood \"\n    \"(perhaps 'Initialize', not 'Initializes')\"\n)\ndef docstring_initializes():\n    \"\"\"Initializes the process.\"\"\"\n\n\n@wraps(docstring_bad_ignore_one)\ndef bad_decorated_function():\n    \"\"\"Bad (E501) but decorated\"\"\"\n    pass\n\n\ndef valid_google_string():  # noqa: D400\n    \"\"\"Test a valid something!\"\"\"\n\n\n@expect(\"D415: First line should end with a period, question mark, \"\n        \"or exclamation point (not 'g')\")\ndef bad_google_string():  # noqa: D400\n    \"\"\"Test a valid something\"\"\"\n\n\n# This is reproducing a bug where AttributeError is raised when parsing class\n# parameters as functions for Google / Numpy conventions.\nclass Blah:  # noqa: D203,D213\n    \"\"\"A Blah.\n\n    Parameters\n    ----------\n    x : int\n\n    \"\"\"\n\n    def __init__(self, x):\n        pass\n\n\nexpect(os.path.normcase(__file__ if __file__[-1] != 'c' else __file__[:-1]),\n       'D100: Missing docstring in public module')\n")))
[client-notification] Mon Jan 11 20:29:57 2021:
(:jsonrpc "2.0" :method "workspace/didChangeConfiguration" :params
 (:settings
  (:pyls
   ((:plugins
     (:pydocstyle
      (:enabled . t))
     (:jedi_completion
      (:fuzzy . t)
      (:follow_builtin_imports . :json-false)))))))
[stderr] 2021-01-11 20:29:56,997 UTC - INFO - pyls.config.config - Disabled plugins: [<module 'pyls.plugins.flake8_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/flake8_lint.py'>, <module 'pyls.plugins.pydocstyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pydocstyle_lint.py'>, <module 'pyls.plugins.pylint_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pylint_lint.py'>, <module 'pyls.plugins.rope_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_completion.py'>, <module 'pyls.plugins.rope_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_rename.py'>]
[stderr] 2021-01-11 20:29:57,062 UTC - INFO - pyls.python_ls - Server capabilities: {'codeActionProvider': True, 'codeLensProvider': {'resolveProvider': False}, 'completionProvider': {'resolveProvider': False, 'triggerCharacters': ['.']}, 'documentFormattingProvider': True, 'documentHighlightProvider': True, 'documentRangeFormattingProvider': True, 'documentSymbolProvider': True, 'definitionProvider': True, 'executeCommandProvider': {'commands': []}, 'hoverProvider': True, 'referencesProvider': True, 'renameProvider': True, 'foldingRangeProvider': True, 'signatureHelpProvider': {'triggerCharacters': ['(', ',', '=']}, 'textDocumentSync': {'change': 2, 'save': {'includeText': True}, 'openClose': True}, 'workspace': {'workspaceFolders': {'supported': True, 'changeNotifications': True}}, 'experimental': {}}
[stderr] 2021-01-11 20:29:57,079 UTC - INFO - pyls.config.config - Updated settings to {':plugins': {':pydocstyle': {':enabled': True}, ':jedi_completion': {':fuzzy': True, ':follow_builtin_imports': False}}}
[stderr] 2021-01-11 20:29:57,080 UTC - INFO - pyls.config.config - Disabled plugins: [<module 'pyls.plugins.flake8_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/flake8_lint.py'>, <module 'pyls.plugins.pydocstyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pydocstyle_lint.py'>, <module 'pyls.plugins.pylint_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pylint_lint.py'>, <module 'pyls.plugins.rope_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_completion.py'>, <module 'pyls.plugins.rope_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_rename.py'>]
[stderr] 2021-01-11 20:29:57,080 UTC - INFO - pyls.config.config - Updated settings to {':plugins': {':pydocstyle': {':enabled': True}, ':jedi_completion': {':fuzzy': True, ':follow_builtin_imports': False}}}
[stderr] 2021-01-11 20:29:57,081 UTC - INFO - pyls.config.config - Disabled plugins: [<module 'pyls.plugins.flake8_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/flake8_lint.py'>, <module 'pyls.plugins.pydocstyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pydocstyle_lint.py'>, <module 'pyls.plugins.pylint_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pylint_lint.py'>, <module 'pyls.plugins.rope_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_completion.py'>, <module 'pyls.plugins.rope_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_rename.py'>]
[stderr] 2021-01-11 20:29:57,081 UTC - INFO - pyls.config.config - Updated settings to {':plugins': {':pydocstyle': {':enabled': True}, ':jedi_completion': {':fuzzy': True, ':follow_builtin_imports': False}}}
[stderr] 2021-01-11 20:29:57,081 UTC - INFO - pyls.config.config - Disabled plugins: [<module 'pyls.plugins.flake8_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/flake8_lint.py'>, <module 'pyls.plugins.pydocstyle_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pydocstyle_lint.py'>, <module 'pyls.plugins.pylint_lint' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/pylint_lint.py'>, <module 'pyls.plugins.rope_completion' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_completion.py'>, <module 'pyls.plugins.rope_rename' from '/home/mohkale/.local/lib/python3.9/site-packages/pyls/plugins/rope_rename.py'>]
[server-notification] Mon Jan 11 20:29:57 2021:
(:jsonrpc "2.0" :method "textDocument/publishDiagnostics" :params
 (:uri "file:///home/mohkale/test.py" :diagnostics
  [(:source "pycodestyle" :range
    (:start
     (:line 126 :character 4)
     :end
     (:line 126 :character 25))
    :message "E303 too many blank lines (1)" :code "E303" :severity 2)
   (:source "pycodestyle" :range
    (:start
     (:line 140 :character 4)
     :end
     (:line 140 :character 38))
    :message "E303 too many blank lines (1)" :code "E303" :severity 2)]))
[client-request] (id:2) Mon Jan 11 20:31:25 2021:
(:jsonrpc "2.0" :id 2 :method "textDocument/signatureHelp" :params
 (:textDocument
  (:uri "file:///home/mohkale/test.py")
  :position
  (:line 6 :character 0)))
[client-request] (id:3) Mon Jan 11 20:31:25 2021:
(:jsonrpc "2.0" :id 3 :method "textDocument/hover" :params
 (:textDocument
  (:uri "file:///home/mohkale/test.py")
  :position
  (:line 6 :character 0)))
[server-reply] (id:2) Mon Jan 11 20:31:25 2021:
(:jsonrpc "2.0" :id 2 :result
 (:signatures
  []))
[server-reply] (id:3) Mon Jan 11 20:31:25 2021:
(:jsonrpc "2.0" :id 3 :result
 (:contents ""))

Version Information

  • emacs: GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3) of 2020-08-28
  • eglot: 20210110.1646
  • uname -a: Linux mk-desktop 5.9.14-arch1-1 #1 SMP PREEMPT Sat, 12 Dec 2020 14:37:12 +0000 x86_64 GNU/Linux
@mohkale
Copy link
Contributor Author

mohkale commented Jan 11, 2021

Looks like jsonrpc-connection-send uses jsonrpc--json-encode and running (message (jsonrpc--json-encode eglot-workspace-configuration)) outputs:

{":pyls":{":plugins":{":pydocstyle":{":enabled":true},":jedi_completion":{":fuzzy":true,":follow_builtin_imports":false}}}}

which is what's getting passed to the server and causing the configuration to fail. I'll examine further.

@mohkale
Copy link
Contributor Author

mohkale commented Jan 11, 2021

So turns out the issue is entirely just because I'm using plists (more specifically using keywords for keys). If I change to symbols then everythings working fine.

(setq eglot-workspace-configuration
      '((pyls
         (plugins
          (pydocstyle
           (enabled . t))
          (jedi_completion
           (fuzzy . t)
           (follow_builtin_imports . :json-false))))))

I feel like the README needs to be updated.

@skangas
Copy link
Collaborator

skangas commented Jan 10, 2022

I am unable to reproduce this. I installed all the Python libraries mentioned above on Debian GNU/Linux stable (at a system level), then I did git clone https://github.com/PyCQA/pydocstyle.git, opened the file pydocstyle/src/tests/test_cases/test.py, set this:

(setq eglot-workspace-configuration
      '((:pyls
         (:plugins
          (:pydocstyle
           (:enabled . t))
          (:jedi_completion
           (:fuzzy . t)
           (:follow_builtin_imports . :json-false))))))

And then I ran M-x eglot. Everything seems to be working, at a glance, and the *EGLOT (pydocstyle/python-mode) stderr* buffer is empty.

Are you still seeing this? If yes, could you please tell me what version of pyls, Emacs and eglot you are using? Thanks!

@skangas skangas added the moreinfo More information is needed label Jan 10, 2022
@skangas
Copy link
Collaborator

skangas commented Jan 10, 2022

Here are the packages I installed, if anyone wants to try reproducing this:

sudo apt-get install python3-pyflakes python3-pylint-common python3-autopep8 python3-rope python3-yapf python3-pydocstyle 

@fbergroth
Copy link
Contributor

fbergroth commented Jan 10, 2022

@skangas it should work when flymake reports the same warnings as running pydocstyle file.py.

I tested it with the configuration you posted above, and did not see those warnings via eglot. But when I use symbols instead of keywords (except for the :json-false), I do see the warnings.

@skangas
Copy link
Collaborator

skangas commented Jan 10, 2022

@skangas it should work when flymake reports the same warnings as running pydocstyle file.py.

I don't think I understand this point. Could you explain what you mean by "it should work", more specifically what is "it" and how should it work?

I tested it with the configuration you posted above, and did not see those warnings via eglot. But when I use symbols instead of keywords (except for the :json-false), I do see the warnings.

Thanks for testing! The OP suggests that you should use symbols instead of keywords. If I understand you correctly, you are saying that it is the other way around? In other words: the instructions in README.md are correct as they are now?

@joaotavora
Copy link
Owner

In other words: the instructions in README.md are correct as they are now?

Yup, if they aren't, it's a question of fixing them, I think.

@fbergroth
Copy link
Contributor

I don't think I understand this point. Could you explain what you mean by "it should work", more specifically what is "it" and how should it work?

Sorry, by "it should work" I meant that the configuration for enabling pydocstyle should work. The pydocstyle plugin works when the lsp server is reporting the pydocstyle warnings.

If I understand you correctly, you are saying that it is the other way around?

No. think (:plugins (:pydocstyle (:enabled . t)) is incorrect and (plugins (pydocstyle (enabled . t))) is correct, and probably the readme is wrong.

I think there is a bug when serializing nested keywords:

'((:a (:b . t)))

is being serialized as

{"a": {":b": true}}   <-- notice ":b"

@fbergroth
Copy link
Contributor

fbergroth commented Jan 10, 2022

@joaotavora should the cl-loop be called recursively on the values v here?

eglot/eglot.el

Lines 2013 to 2017 in ea530b6

(cl-loop for (section . v) in eglot-workspace-configuration
collect (if (keywordp section)
section
(intern (format ":%s" section)))
collect v))))

Edit: sorry, that doesn't seem to be the case.

@fbergroth
Copy link
Contributor

Perhaps more clear, with:

(setq-default eglot-workspace-configuration
      '((:pylsp
         (:plugins
          (:pydocstyle
           (:enabled . t))
          (:jedi_completion
           (:fuzzy . t)
           (:follow_builtin_imports . :json-false))))))

(add-to-list 'eglot-server-programs '(python-mode "pylsp" "-vvvvv"))

After starting eglot, I see this in the eglot events buffer:

[stderr] 2022-01-10 13:38:26,734 CET - DEBUG - pylsp_jsonrpc.endpoint - Handling notification from client {'jsonrpc': '2.0', 'method': 'workspace/didChangeConfiguration', 'params': {'settings': {'pylsp': {':plugins': {':pydocstyle': {':enabled': True}, ':jedi_completion': {':fuzzy': True, ':follow_builtin_imports': False}}}}}}

@joaotavora
Copy link
Owner

I think there is a bug when serializing nested keywords:

Yes, this is definitely a bug.

Overall, this is one of the most fragile aspects of Eglot. The syntax in the variable is hard to get right. Partially because it's very LSP-loose by nature, but also there are no safeguards at all in Eglot.

It is also an aspect that should be reasonably easy to fix, by introducing run-time checks on the structure of the variable and/or some automated tests. Thanks for your investigation @fbergroth if you come up with a fix, it'd be awesome. Feel free to fix/overhaul the README.md instructions, too.

fbergroth added a commit to fbergroth/eglot that referenced this issue Jan 10, 2022
…-configuration

* eglot.el (eglot--dump-configuration): Add function
(eglot-signal-didChangeConfiguration): Dump configuration recursively
fbergroth added a commit to fbergroth/eglot that referenced this issue Jan 10, 2022
…guration

* eglot.el (eglot--dump-configuration): Add function
(eglot-signal-didChangeConfiguration): Dump configuration recursively
fbergroth added a commit to fbergroth/eglot that referenced this issue Jan 10, 2022
fbergroth added a commit to fbergroth/eglot that referenced this issue Jan 10, 2022
@skangas skangas linked a pull request Jan 15, 2022 that will close this issue
@skangas skangas removed the moreinfo More information is needed label Jan 16, 2022
joaotavora added a commit that referenced this issue Sep 17, 2022
Also tweak eglot-show-workspace-configuration a bit.

* README.md (Workspace configuration): Rework.

* eglot.el (eglot-show-workspace-configuration): Rework.
joaotavora added a commit that referenced this issue Sep 17, 2022
Also tweak eglot-show-workspace-configuration a bit.

* README.md (Workspace configuration): Rework.

* eglot.el (eglot-show-workspace-configuration): Rework.
(eglot--workspace-configuration-plist): New helper.
joaotavora added a commit that referenced this issue Sep 17, 2022
* README.md (way): Adjust.

* eglot.el (json): Don't require needlessly.
(eglot-show-workspace-configuration): Don't depend on json-mode.
joaotavora added a commit that referenced this issue Sep 17, 2022
* README.md (eglot-workspace-configuration): Rework.
@joaotavora
Copy link
Owner

OK. Here's the current status. I think the README.md and the current eglot-show-workspace-configuration commands do a good job of clarifying how this variable is used (and when to use it at all).

Over at #790, @fbergroth has a WIP pull request that adds some sanity-checking functionality which may be useful.
Over at #1033, @astoff has a WIP pull request that allows eglot-workspace-configuration to be a plist at the top level.

But each of those are tangent functionality in my opinion, and I think this issue (#590) is now resolved.

joaotavora added a commit that referenced this issue Sep 17, 2022
Suggested-by: Augusto Stoffel <arstoffel@gmail.com>

* NEWS.md: Mention change.

* README.md (eglot-workspace-configuration): Update yet again.

* eglot.el (eglot--workspace-configuration-plist): Noop if already
a plist.
(eglot-handle-request workspace/configuration): Use
eglot--workspace-configuration-plist.
joaotavora added a commit that referenced this issue Sep 18, 2022
Suggested-by: Augusto Stoffel <arstoffel@gmail.com>

* NEWS.md: Mention change.

* README.md (eglot-workspace-configuration): Update yet again.  Update
examples to use pylsp.

* eglot.el (eglot--workspace-configuration-plist): Noop if already
a plist.
(eglot-handle-request workspace/configuration): Use
eglot--workspace-configuration-plist.
(eglot-workspace-configuration): Document variable.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
…ion again

Also tweak eglot-show-workspace-configuration a bit.

* README.md (Workspace configuration): Rework.

* eglot.el (eglot-show-workspace-configuration): Rework.
(eglot--workspace-configuration-plist): New helper.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
…out workspace configuration

* README.md (way): Adjust.

* eglot.el (json): Don't require needlessly.
(eglot-show-workspace-configuration): Don't depend on json-mode.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
… Allow eglot-workspace-configuration to be a plist

Suggested-by: Augusto Stoffel <arstoffel@gmail.com>

* NEWS.md: Mention change.

* README.md (eglot-workspace-configuration): Update yet again.  Update
examples to use pylsp.

* eglot.el (eglot--workspace-configuration-plist): Noop if already
a plist.
(eglot-handle-request workspace/configuration): Use
eglot--workspace-configuration-plist.
(eglot-workspace-configuration): Document variable.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
…ion again

Also tweak eglot-show-workspace-configuration a bit.

* README.md (Workspace configuration): Rework.

* eglot.el (eglot-show-workspace-configuration): Rework.
(eglot--workspace-configuration-plist): New helper.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
…out workspace configuration

* README.md (way): Adjust.

* eglot.el (json): Don't require needlessly.
(eglot-show-workspace-configuration): Don't depend on json-mode.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
… Allow eglot-workspace-configuration to be a plist

Suggested-by: Augusto Stoffel <arstoffel@gmail.com>

* NEWS.md: Mention change.

* README.md (eglot-workspace-configuration): Update yet again.  Update
examples to use pylsp.

* eglot.el (eglot--workspace-configuration-plist): Noop if already
a plist.
(eglot-handle-request workspace/configuration): Use
eglot--workspace-configuration-plist.
(eglot-workspace-configuration): Document variable.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
Also tweak eglot-show-workspace-configuration a bit.

* README.md (Workspace configuration): Rework.

* eglot.el (eglot-show-workspace-configuration): Rework.
(eglot--workspace-configuration-plist): New helper.

#590: joaotavora/eglot#590
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
* README.md (way): Adjust.

* eglot.el (json): Don't require needlessly.
(eglot-show-workspace-configuration): Don't depend on json-mode.

#790: joaotavora/eglot#790
#590: joaotavora/eglot#590
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
Suggested-by: Augusto Stoffel <arstoffel@gmail.com>

* NEWS.md: Mention change.

* README.md (eglot-workspace-configuration): Update yet again.  Update
examples to use pylsp.

* eglot.el (eglot--workspace-configuration-plist): Noop if already
a plist.
(eglot-handle-request workspace/configuration): Use
eglot--workspace-configuration-plist.
(eglot-workspace-configuration): Document variable.

#590: joaotavora/eglot#590
#790: joaotavora/eglot#790
#1033: joaotavora/eglot#1033
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
Also tweak eglot-show-workspace-configuration a bit.

* README.md (Workspace configuration): Rework.

* eglot.el (eglot-show-workspace-configuration): Rework.
(eglot--workspace-configuration-plist): New helper.

GitHub-reference: per joaotavora/eglot#590
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
* README.md (way): Adjust.

* eglot.el (json): Don't require needlessly.
(eglot-show-workspace-configuration): Don't depend on json-mode.

GitHub-reference: per joaotavora/eglot#790
GitHub-reference: per joaotavora/eglot#590
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
Suggested-by: Augusto Stoffel <arstoffel@gmail.com>

* NEWS.md: Mention change.

* README.md (eglot-workspace-configuration): Update yet again.  Update
examples to use pylsp.

* eglot.el (eglot--workspace-configuration-plist): Noop if already
a plist.
(eglot-handle-request workspace/configuration): Use
eglot--workspace-configuration-plist.
(eglot-workspace-configuration): Document variable.

GitHub-reference: per joaotavora/eglot#590
GitHub-reference: per joaotavora/eglot#790
GitHub-reference: per joaotavora/eglot#1033
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 20, 2022
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 20, 2022
Also tweak eglot-show-workspace-configuration a bit.

* README.md (Workspace configuration): Rework.

* eglot.el (eglot-show-workspace-configuration): Rework.
(eglot--workspace-configuration-plist): New helper.

GitHub-reference: per joaotavora/eglot#590
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 20, 2022
* README.md (way): Adjust.

* eglot.el (json): Don't require needlessly.
(eglot-show-workspace-configuration): Don't depend on json-mode.

GitHub-reference: per joaotavora/eglot#790
GitHub-reference: per joaotavora/eglot#590
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 20, 2022
Suggested-by: Augusto Stoffel <arstoffel@gmail.com>

* NEWS.md: Mention change.

* README.md (eglot-workspace-configuration): Update yet again.  Update
examples to use pylsp.

* eglot.el (eglot--workspace-configuration-plist): Noop if already
a plist.
(eglot-handle-request workspace/configuration): Use
eglot--workspace-configuration-plist.
(eglot-workspace-configuration): Document variable.

GitHub-reference: per joaotavora/eglot#590
GitHub-reference: per joaotavora/eglot#790
GitHub-reference: per joaotavora/eglot#1033
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants