Stream: t-compiler/wg-rls-2.0

Topic: emacs semantic highlighting performance


Florian Diebold (Jul 15 2020 at 14:59, on Zulip):

I haven't... wasn't really planning to do it before the upgrade :grimacing:

Jake Goulding (Jul 15 2020 at 14:59, on Zulip):

I have not; largely because I didn't know about it until I read your message and I don't yet even know how to enable it :wink:

Jake Goulding (Jul 15 2020 at 15:04, on Zulip):

Any hints on how to turn it on? :embarrassed:

matklad (Jul 15 2020 at 15:09, on Zulip):

https://github.com/emacs-lsp/lsp-mode/pull/1721/files#diff-b1e9bc82c3b6bd6e95470e18ee41a19bR173

Jake Goulding (Jul 15 2020 at 15:10, on Zulip):

well, clicking that link killed that Chrome tab...

Florian Diebold (Jul 15 2020 at 15:12, on Zulip):

(setq lsp-semantic-highlighting :semantic-tokens) I guess

Florian Diebold (Jul 15 2020 at 15:13, on Zulip):

ah no it's (setq lsp-enable-semantic-highlighting t) with current versions

Jake Goulding (Jul 15 2020 at 15:42, on Zulip):

Heh, it looks like the current effect of that is that I only get highlighting on the first screen of a file :upside_down:

Jake Goulding (Jul 15 2020 at 15:42, on Zulip):

Or maybe it was just slow... it's there now.

Jake Goulding (Jul 15 2020 at 15:44, on Zulip):

Well, I'll give it a whirl — updated RA to tip, updated emacs to tip, so what's one more change on the pile

Leo Le Bouter (Jul 18 2020 at 19:19, on Zulip):

@Jake Goulding unrelated, did you publish your emacs config somewhere?
@matklad what is missing compared to vscode in emacs integration?

I would really love to use Emacs instead of VS Codium

Jake Goulding (Jul 18 2020 at 19:21, on Zulip):
;; Language server
(setq lsp-keymap-prefix "C-x l")
(setq lsp-enable-semantic-highlighting t)
(require 'lsp-mode)

;; Rust
(load "ra-emacs-lsp")
(load "asf-rustdoc-edit")

(add-hook 'rust-mode-hook 'cargo-minor-mode)
(add-hook 'rust-mode-hook #'lsp)

;; Wrap error messages in cargo minor mode
(add-hook 'cargo-process-mode-hook 'turn-on-visual-line-mode)

I don't, but that's the Rust-related parts. I'm almost certain that I've got stuff in there that doesn't work (e.g. the lsp-keymap-prefix)

apiraino (Jul 19 2020 at 08:38, on Zulip):

Leo Le Bouter said:

I would really love to use Emacs instead of VS Codium

Hi @Leo Le Bouter if you're looking for another example, you might want to have a look also at mine:
https://gitlab.com/apiraino/dotfiles/-/blob/master/emacs/.emacs.d/init.el#L34-84

Same caveat applies: work-in-progress and some things might be broken :-)

(btw - happy to receive feedback and suggestions)

Leo Le Bouter (Jul 19 2020 at 20:43, on Zulip):

@Jake Goulding @apiraino Thanks a lot to you both! I'll have a look - do you feel productive with Rust and Emacs right now?

apiraino (Jul 19 2020 at 21:57, on Zulip):

Leo Le Bouter said:

do you feel productive with Rust and Emacs right now?

that's probably a general question about feeling productive with Emacs compared to other tools. As far as I am concerned, I feel that my skills in Rust (or lack thereof) are the limiting factor, Emacs certainly does not get in the way. But the game changer for me was using rust-analyzer, I feel much more at ease when writing code, it's a godsend.
My topmost used feature is the type hinting. I used to provoke compiler error on purpose to understand what some function parameter was expected to be, or what a certain function returned :laughing:
Clearly, learning Emacs is not easy. You might also have a look at Spacemacs (that's an alternative version of Emacs, more "vim-like") and install LSP there

Leo Le Bouter (Jul 20 2020 at 13:39, on Zulip):

@apiraino I am interested by Emacs because it is one of the rare tools that can provide a unified, integrated and coherent keyboard driven experience for all software

Wojciech Polak (Jul 20 2020 at 14:22, on Zulip):

Relation between Spacemacs and Emacs is similar to Debian and Linux. I'd also recommend Doom Emacs as its blazingly fast (at least on my projects, i didnt open RA) and has RA support.

Leo Le Bouter (Jul 20 2020 at 16:20, on Zulip):

@Wojciech Polak I do know Spacemacs isnt Emacs even if Emacs's elisp implementation is also slow as a known fact - Doom Emacs looks interesting thanks!

Last update: Sep 27 2020 at 14:00UTC