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

Lsp-mode sends per-project config to Serenata incorrectly #2259

Open
apergos opened this issue Oct 16, 2020 · 1 comment
Open

Lsp-mode sends per-project config to Serenata incorrectly #2259

apergos opened this issue Oct 16, 2020 · 1 comment

Comments

@apergos
Copy link
Contributor

apergos commented Oct 16, 2020

lsp-php.el , in lsp-serenata-init-options sends the config settings in a group labelled "config", but Serenata expects it to be labelled "configuration", so per-project configuration never works.

Versions:

  • lsp-mode: master and 20201011.1353
  • Serenata: master and 5.4.0

I verified this by creating a .dir-locals.el file in my project repo, adding the hack-local-variables hook, doing M-x debug-entry for lsp, and seeing the following sent:

   "initializationOptions": {
    "config": {
      "uris": [
        "file:///home/ariel/src/wmf/mediawiki/core/core"
      ],
      "indexDatabaseUri": "file:///home/ariel/.emacs.d/serenata-cache/mwcore-index.sqlite",
      "phpVersion": 7.3,
      "excludedPathExpressions": [
        "/.+Test.php$/"
      ],
      "fileExtensions": [
        "php"
      ]
    }

But I got the following error message from Serenata:

No explicit project configuration found, automatically generating one and using the system's temp folder to store the index database. (etc)

Digging around in Serenata, one finds the following:
https://gitlab.com/Serenata/Serenata/-/blob/master/src/UserInterface/JsonRpcQueueItemHandler/InitializeJsonRpcQueueItemHandler.php#L180

I then edited lsp-php.el locally to change the string to ":configuration", closed and restarted emacs with a php file from the project repo, and then Serenata re-indexed the project, writing the sqlite project index file into my specified location. Previously it had written the file into /tmp, which is the behavior when Serenata has no configuration information passed to it.

@kiennq
Copy link
Member

kiennq commented Oct 17, 2020

Nice, can you open a PR for that?

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

No branches or pull requests

2 participants