-
Notifications
You must be signed in to change notification settings - Fork 199
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 example? #59
Comments
Indeed this is very lightly tested.
You can add more configuration parameters in parallel with |
Unfortunately this doesn't seem to work for me. The eglot STDERR buffer shows this:
It seems like we're passing the settings as a list when the server expects a dictionary? |
Right. Try this instead for .dir-locals
This uses a plist instead of an alist. If you were using the latest emacs it would probably work with the alist-based version I gave you before. If it works then this is a bug and |
Ha that worked! FYI my emacs version:
|
Woops actually it errors:
|
Can we have a backtrace? use |
|
Argh, sorry, my bad. Try with this third variation instead (just add a colon to the first version): ((nil
(eglot-workspace-configuration
.
((:pyls.configurationSources . ["flake8"] )))))
|
Now I think this is what I had originally. This definitely doesn't error and this is what I get in the events buffer:
I don't see the setting properly reflected in the server's behavior after that, so I'm not sure whether the settings are not coming across in the expected format or if it's some other issue on the server. |
It's not, though. It's subtly different. But I will make it so that the first version also works (meaning there is something to change in Eglot, but only after I understand the problem) Do you still get the python error in the eglot stderr buffer? If you don't then whatever python is seeing is now a dictionary, and the question is now server-specific. |
No more errors with the last config, but the server doesn't seem to take the settings into account, could be entirely pyls specific... I'll try to make a minimal repro. |
Good idea. Tell me exactly what to install and what to look for in a minimal python project with and without the dir-locals file. |
Can we have a command which will read a name of configuration option and it's json value and append it to |
You have Also, what we need really are project-local variables, something possibly worth proposing to Emacs. |
I don't get it. The command would be just modifying existing value of |
Well you can set it via a hook as well. Wouldn't an eglot-specific command have to take that in account? But if you want have a stab at it. Let's see how much more convenient you can make it than |
* eglot.el (eglot-signal-didChangeConfiguration): Convert alist keys into a json-compatible plist.
Anyone reading this for the pyls config part: took me a while to realize the settings as "documented" here are actually a short-form object notation, the server actually expects a nested object. So in elisp, with the latest eglot changes, ((nil (eglot-workspace-configuration . ((pyls . ((configurationSources . ["flake8"]))))))) |
… be keywords * eglot.el (eglot-signal-didChangeConfiguration): Convert alist keys into a json-compatible plist.
… be keywords * eglot.el (eglot-signal-didChangeConfiguration): Convert alist keys into a json-compatible plist.
* eglot.el (eglot-signal-didChangeConfiguration): Convert alist keys into a json-compatible plist. #59: joaotavora/eglot#59
* eglot.el (eglot-signal-didChangeConfiguration): Convert alist keys into a json-compatible plist. GitHub-reference: per joaotavora/eglot#59
Can I use this somehow to set |
I'm trying to use
eglot-workspace-configuration
andeglot-signal-didChangeConfiguration
to configure pyls as described hereCould you give an example of how to translate the setting
pyls.configurationSources
set to['flake8']
to a valid config alist?The text was updated successfully, but these errors were encountered: