emacs-lsp / lsp-haskell

lsp-mode :heart: haskell
https://emacs-lsp.github.io/lsp-haskell
GNU General Public License v3.0
233 stars 63 forks source link

Update customisation options to match the vscode extension #173

Closed alanz closed 1 year ago

alanz commented 1 year ago

In particular, add the ability to turn on the new cabal plugin and completion for it.

alanz commented 1 year ago

I am not able to get this working locally, so probably not a good idea to merge yet.

michaelpj commented 1 year ago

BTW you want to use the schema produced by haskell-language-server vscode-extension-schema, not the one from vscode-haskell. They add a bunch of options that are actually specific to the vscode extension rather than HLS.

alanz commented 1 year ago

And it struck me I need to ensure it actually gets used too.

Where is the best place to document this update process?

michaelpj commented 1 year ago

And it struck me I need to ensure it actually gets used too.

I believe lsp-defcustom handles this for us.

Where is the best place to document this update process?

Start a CONTRIBUTING.md?

alanz commented 1 year ago

Take two. Turns out if you run the update script with lsp-haskell already active, it only presents settings for the items not already present.

alanz commented 1 year ago

I find it now works, in that it starts up correctly, and the config settings are sent. But for me completions do not work.

[Trace - 12:38:28 pm] Sending notification 'workspace/didChangeConfiguration'.
Params: {
  "settings": {
    "haskell": {
      "formattingProvider": "fourmolu",
      "checkProject": true,
      "maxCompletions": 40,
      "plugin": {
        "importLens": {
          "codeActionsOn": false,
          "codeLensOn": false
        },
        "hlint": {
          "codeActionsOn": true,
          "diagnosticsOn": true
        },
        "eval": {
          "globalOn": true
        },
        "moduleName": {
          "globalOn": true
        },
        "splice": {
          "globalOn": true
        },
        "haddockComments": {
          "globalOn": true
        },
        "class": {
          "globalOn": true
        },
        "retrie": {
          "globalOn": true
        },
        "stan": {
          "globalOn": true
        },
        "tactics": {
          "globalOn": true,
          "config": {
            "auto_gas": 4,
            "max_use_ctor_actions": 5,
            "timeout_duration": 2,
            "proofstate_styling": true
          }
        },
        "pragmas": {
          "codeActionsOn": true,
          "completionsOn": true
        },
        "ghcide-completions": {
          "config": {
            "autoExtendOn": true,
            "snippetsOn": true
          }
        },
        "ghcide-type-lenses": {
          "globalOn": false,
          "config": {
            "mode": "diagnostics"
          }
        },
        "refineImports": {
          "globalOn": false
        },
        "cabal": {
          "codeActionsOn": true,
          "completionOn": true
        },
        "overloaded-record-dot": {
          "globalOn": true
        },
        "pragmas-completion": {
          "globalOn": true
        },
        "pragmas-disable": {
          "globalOn": true
        },
        "pragmas-suggest": {
          "globalOn": true
        }
      }
    }
  }
}
michaelpj commented 1 year ago

We should debug what's going on with cabal files. Is the mode definitely activating? Do you see lsp-mode sending messages to HLS when you're in a cabal file?