- Introduced a new command cargo-process-outdated
- Certain commands are known to change Cargo.toml and needs to reload workspace,
wrapper functions that automatically reload workspace are added.
- spacemacs/cargo-process-add
- spacemacs/cargo-process-rm
- spacemacs/cargo-process-outdated
- Added a layer variable for rust layer, cargo-process-reload-on-modify,
which toggle the aforementioned behaviour.
- Added a new utility function in LSP layer, which returns server ID associated
with current project.
- spacemacs//lsp-client-server-id
- Rearranged keybindings for rust layers (see table below for details)
Commands wrapped with auto-reload functionality:
|Command |Binding |
|-------------------------|-------------|
|`cargo-process-repeat` |`SPC m c .` |
|`cargo-process-add` |`SPC m c a` |
|`cargo-process-rm` |`SPC m c r` |
|`cargo-process-upgrade` |`SPC m c U` |
Commands with new bindings:
|Command |Old Binding |New Binding |
|-----------------------------------|------------|------------|
|`cargo-process-search` |`SPC m c s` |`SPC m c /` |
|`cargo-process-fmt` |`SPC m c f` |`SPC m c =` |
|`cargo-process-current-file-tests` |`SPC m c o` |`SPC m t b` |
|`cargo-process-current-test` |`SPC m c t` |`SPC m t t` |
|`cargo-process-test` |`SPC m t` |`SPC m t a` |
- Moved backend determination to `config.el`
- Replaced unnecessary backquote construct with simple quotation
- Replaced `pcase` form with only one-arm with `when` or `unless` form
Allows you to pick up new Cargo dependencies without a (slooow)
full server restart.
See https://github.com/emacs-lsp/lsp-mode/pull/2728
Add diagnostic messages when trying to reload RA workspace
No point restarting when trying to reload RLS
Currently, when `lsp` backend is used for `rust` layer, `SPC m s s` is bound to
`lsp-rust-switch-server`, which temporarily changes the preferred LSP server
for `rust-mode`, but it DOES NOT switch the running LSP server. Users need to
call `lsp-workspace-restart` to finish the switching.
This PR introduced a new function `spacemacs//lsp-rust-switch-server`, which is
a wrapper for the two aforementioned functions
Missing parentheses around:
"\\.ron\\'" . ron-mode
in the line:
:mode "\\.ron\\'" . ron-mode
Updated the rust readme to mention the .ron support.
And added a changelog.develop entry.
The previous way of adding dap to a layer did add the mode
unconditionally to `spacemacs--dap-supported-modes` causing
dap bindings to be added also when no lsp backend was used.
Instructoins on the following external dependencies required by certain
functions are added/updated to the README file:
- `cargo-edit`
- `cargo-audit`
- `rustfmt`
- `clippy`
Signed-off-by: Lucius Hu <lebensterben@users.noreply.github.com>
This is a squashed commit it contains:
- Added new sections on `cargo-edit`, `cargo-audit`, and `Clippy`,
which are used for several key-bindings in this layer.
- Re-ordered the `Key bindings` section, added entries for new bidings,
and improved description.
- ~SPC m c a~ for =cargo add=
- ~SPC m c r~ for =cargo rm=
- ~SPC m c U~ for =cargo upgrade=
- ~SPC m c A~ for =cargo audit=
- ~SPC m c X~ is for =cargo run --bin= now, instead of =cargo run --example=,
which is bound to ~SPC m c E~
`lsp-mode` supports two LSP server backend for Rust language, i.e.
`rls` and `rust-analyzer`.
`rust-analyzer` is experimental and lacks certain functionalities
such as `DAP` support.
`lsp-mode` provides a function `lsp-rust-switch-server` that changes
the priority of LSP server backend for *new* LSP session.
This commit adds a key binding `SPC m s s` to `lsp-rust-switch-server`.
removing the `lexical-let` caused the intended closure to be invalid. the
filename being compiled was nil when the compilation-finish-function was
run.
this adds a special var to hold the temp file being compiled instead, and
tries to narrow down the compilation-finish-function to only run when the
compilation buffer includes the "rustc -o /tmp" regexp
An older PR reintroduced a dependency on lexical let.
There is no proper replacement for this in cl-lib therefore
I have changed it to a normal let which works the same
way.
In future we should think of making the entire file lexically bound
and only mark the exceptions to be dynamically bound.
This allows to use quick run when the default shell is not bash-compatible.
I also fixed the output name by using a digest of the filename rather
than always a new file as I noted that my /tmp got cluttered with 4MiB
files pretty quickly, and I was just using a hello-world like file.
There was a edge case with the declaration of the `lsp` layer in `layers.el`
files.
The `hy` layer depends on the `python` layer which in turn depends on the `lsp`
layer if and only if the `python-backend` layer variable is set to `lsp`.
When the `hy` layer was declared first then it declares the `python` layer
without its layer variables, thus the `lsp` layer was not declared because the
`python-backend` variable was not set.
The fix is to gather all the layer dependencies and resolve them only after all
the used layers have been declared.
* new function `configuration-layer/declare-layer-dependencies`
* replace all calls to `configuration-layer/declare-layer` by the new function
except for distribution layers (we declare layer dependencies right away in
distribution layers)
* use local-vars-hook coupled to setup function for dap
* define new private layer variable `spacemacs--dap-supported-modes` to
configure key bindings. This allows to move the key bindings definition from
`funcs.el` to `packages.el`
* remove duplication of DAP key bindings in READMEs by pointing to the dap layer
documentation
* alphabetically sort package configuration
problem:
some layer packages lists have the open and closing parentheses on the same line
as the first and last listed package, but most seem to have them on a separate
lines.
solution:
put the open and close parentheses on separate lines, except for lists with only
a single package, they are written on the same line as the variable name and
parentheses.
fix the lists indentation