Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Set configuration on init #2

Open
rossabaker opened this issue Apr 4, 2018 · 5 comments
Open

Set configuration on init #2

rossabaker opened this issue Apr 4, 2018 · 5 comments

Comments

@rossabaker
Copy link
Owner

(defvar lsp-scala--config-options `(:hover (:enabled "true")))

(defun lsp-scala--set-configuration ()
  ;; TODO is this going to irritate everything but metals?
  (lsp--set-configuration `(:metals ,lsp-scala--config-options)))

(add-hook 'lsp-after-initialize-hook 'lsp-scala--set-configuration)

yields

00:45:17.305 INFO  s.m.m.MetalsServices - Configuration updated Configuration(Sbt(false,test:compile),Scalac(ScalacCompletions(false),ScalacDiagnostics(false)),Scalafmt(true,true,1.3.0,None),Scalafix(true,None),Search(true,true),Hover(false),Highlight(false),Rename(false))

I can't figure out the incantation to set hover to true.

@rossabaker
Copy link
Owner Author

Ah, like this:

(defvar lsp-scala--config-options `(:hover (:enabled t)))

@olafurpg
Copy link
Contributor

olafurpg commented Apr 4, 2018

NB, I just opened scalameta/metals#236 to enable hover by default. It used to be disabled when hover relied on the presentation compiler but now it uses SemanticDB, the same as goto definition.

@olafurpg
Copy link
Contributor

olafurpg commented Apr 4, 2018

The VS Code plugin package.json for some reason enabled it by default so I didn't notice it was off in other clients.

@rossabaker
Copy link
Owner Author

I think I'd like to flesh this out with all the options to make it easier for people to customize. But then we might always be a step behind trying to echo metals' defaults. And I want this package to be really dumb, deferring as much as possible to lsp-mode or metals. 🤔

@coreyoconnor
Copy link
Contributor

Could try the route of "nil implies metal's default and nil is default". Which I've seen some emacs packages do. (What? No Option?)
Would still require the schema of options to match tho.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants