想新写一个LSP Mode

Most likely it wont. Dynamic modules are extremelly inefficient when there are elisp calls from rust also converting RUST datastructures to elisp datastructures should happen in the emacs thread - you cannot call elisp methods not being in emacs thread.

See [Discussion] json dynamic module · Issue #676 · emacs-lsp/lsp-mode · GitHub

IMO ATM the easiest way to achieve what OP is describing is to rework emacs core to allow memory allocation to happen on multiple threads(we were discussing that with Eli Zaretskii) and then implement async JSONRPC either in core or in dynamic module(assuming async support is exposed in dynamic modules). But recently. Eli Zaretskii optimized the json parsing with 30-40% and also the JSONRPC layer in lsp-mode was rewritten and optimized (~2times faster) I cannot find a scenario in which lsp-mode is not reponsive when using latest Emacs 27. Before that I was planning to open a discussion with Eli in emacs-devel but now I do not have performance report to backup my request - everything is fast enough.

4 个赞