Default on-save formatting is still done via lsp-format-buffer, but the
the C-c C-f manual formatting action is overridden to also include
stree-format-buffer.
Since we enable global-company-mode, explicitly enabling it in the setup
for various major modes does nothing. But it does tie the code to
company mode, making it harder to try alternatives like corfu.
Allow individual projects to override the default lsp-mode based
formatting method by setting rubocopfmt-on-save-use-lsp-format-buffer as
a dir-local variable.
This is useful for projects which require older versions of Ruby where
the latest Solargraph version is not supported, and formatting is better
handled by rubocop directly.
As I'm not convinced formatting with rufo is good idea yet, this is
simply so I can play with it when I want to. It is not configured to
automatically format files on save.
Instead of executing lsp-format-buffer on save via the rubocopfmt
package, simply set it up as a buffer-local before-save-hook.
Also simplify the rubocopfmt package configuration, as I rarely use it
anymore, but would still want to be able to manually execute rubocopfmt.
A recent change (https://github.com/raxod502/straight.el/pull/558) to
straight.el's use-package integration led to some of my :straight
definitions throwing errors.
When overriding the package name, do not wrap the real name in parens,
for example:
;; bad (no longer works)
(use-package helm-global-bindings
:straight (helm))
;; good (worked before, still works)
(use-package helm-global-bindings
:straight helm)
This means that each project gets a separate solargraph server, rather
than one server handles all projects. This does mean more memory is
consumed, but it overall it makes lsp-mode perform much faster, and be
more stable.
On my 2016 MacBook Pro correction times are around 200ms with the
daemon, compared to around 3-4 seconds without.
There might be some issues if bundler depends heavily on gems included
in the project, but we'll see how that goes.
I don't use inf-ruby that much, so I'm fine with using it via M-x when
needed. Specially as a bunch of it's keybindings overrides a few global
keybindings I have set.
Spring has changed and is no longer compatible with the way that
rspec-mode implements spring support. Hence we need to disable
rspec-mode's support and attempts at using Spring the wrong way.
Once rspec-mode has been updated to support spring again, we can
re-enable this.
There are a few major modes which are not based on prog-mode, that I
want to behave like prog-mode. Previously each did nearly all the same
setup that's done via the prog-mode hooks. Now instead let's actually
run runs the hooks for prog-mode.
- Switch from highlight-indentation package to highlight-indent-guides.
- Activate visual indentation in a prog-mode hook, rather than doing
within each individual major mode. It was already done within all
major modes based on prog-mode anyway.
- Add new siren-display-indetation module and function as a central way
to enable visual indetation guides. This makes switching the
underlying package at some point in the future much easier.