Commit Graph

115 Commits

Author SHA1 Message Date
Arif Er 00f9ab19ac chore: update copyright headers to 2022
The script used to identify and update the change is added into the GitHub
workflows script directory. A workflow action can be created to trigger the
script to update the headers on the first of every new year. Possibly a task for
a consequent PR.
2022-06-03 17:32:20 +02:00
Thanh Vuong 11277c517c [Rust] fix dap mode toggle logic
rust layer doesn't own dap-mode so toggle is ignored
2022-06-01 11:13:40 +02:00
Maxi Wolff 712aa31870
[Rust] Move package loading conditions to package list 2022-05-29 14:11:43 +02:00
Dav1d23 e9f09cde48 Enable racer only when it is selected as a backend
When using LSP, there is little to no need to use Racer as well. So, this patch
conditionally enables Racer, only when it is selected as a backend.
2022-05-29 14:06:13 +02:00
Lucius Hu d2b566406a
rust: respect `lsp-use-upstream-bindings`
This is needed after 1d45278a71
2022-01-31 04:14:59 +00:00
Maximilian Wolff 500e58341c
Defer loading of lsp servers up to when the buffer is visible 2021-06-06 22:26:31 +02:00
Lucius Hu 49d1eaed50 rust and lsp: better integration of lsp-rust-analyzer-reload-workspace
- 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` |
2021-04-09 21:56:22 +02:00
Lucius Hu 8f47d285a6 rust: refactor
- 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
2021-04-04 12:48:21 +02:00
syl20bnr 97cd83e169 Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
syl20bnr d55a9e2e67 Update header for year 2021 2021-03-25 22:59:32 -04:00
Teo Klestrup Röijezon 170e4a9852 Add keybind to reload Rust-Analyzer workspace
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
2021-03-20 20:14:40 +00:00
Lucius Hu d6eb0f9fe6 rust: Improved LSP Rust server switch functionality
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
2021-03-19 12:54:41 +01:00
Robert O'Connor 82ba73a1c0
update copyright to 2020 2020-09-23 21:25:01 +02:00
Daniel Hutzley ca2f776056 Switch from nabero's ron mode to my own custom ron-mode (hosted on MELPA) 2020-08-26 22:51:08 +02:00
duianto c6dc8fad47 [rust] Fix .ron support
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.
2020-08-09 11:30:00 +02:00
Daniel Hutzley c8f7752dfe Add Rusty Object Notation (RON) support to the Rust crate, predominantly used by the Amethyst Game Engine 2020-08-09 11:18:46 +02:00
Robert Roland d98cccaa2f [rust] Small typo fix
This fixes a small typo, switching ` for =
2020-07-24 10:54:02 +02:00
Maximilian Wolff 1fd90fc1dc
Update instructions for dap integration and update existing layers
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.
2020-05-16 23:40:38 +02:00
Ivan Yonchovski c3f13d0391 Removed company-lsp in favour of company-capf
- Also removed some cquery artifacts which accidentally ended up in this PR
instead of in https://github.com/syl20bnr/spacemacs/pull/13446
2020-04-04 08:24:44 +02:00
Lucius Hu 82e5387cd9
rust: Updated README for external dependencies
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>
2020-03-01 00:16:35 +01:00
emacspace 7536239f9e
documentation formatting: Wed Feb 26 16:43:02 UTC 2020 2020-02-26 19:14:35 +01:00
Lucius Hu 70efaaae59
[rust] Added key bindings for cargo-edit, cargo-audit and Clippy
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~
2020-02-26 16:40:12 +00:00
emacspace 546f626be9
documentation formatting: Sat Feb 22 10:39:46 UTC 2020 2020-02-22 11:44:35 +01:00
Lucius Hu 24d9c3f7ee
[rust] Add key binding to switch lsp rust server
`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`.
2020-02-13 19:27:32 +00:00
Keiichi Watanabe 0e48bac272 rust: Fix a broken code block in README 2020-01-31 23:23:53 +09:00
emacspace 75cfd40d3c
documentation formatting: Mon Jan 27 22:19:54 UTC 2020 2020-01-27 23:35:09 +01:00
syl20bnr 52d1b0f323 Revert "[clojure] Add sesman keybindings"
This breaks Spacemacs convention:
https://github.com/syl20bnr/spacemacs/blob/develop/doc/CONVENTIONS.org#repls

Need to add session management under an unused prefix, I suggest SPC m S

This reverts commit e47494229b.
2020-01-25 10:17:08 -05:00
emacspace ff5b3ae291 documentation formatting: Thu Jan 23 11:14:51 UTC 2020 2020-01-23 12:18:03 +01:00
Lucius Hu d7e9a803fd rust: Guides to use rust-analyzer; fix link 2020-01-20 15:59:28 +01:00
duianto 010ede8c30 [rust] Update backend
Refactor duplicate "lsp layer not installed ..." strings, into a function.
Add line breaks to limit lines to 80 chars.
2019-12-28 16:17:51 +01:00
Grant Shangreaux 2e30b9bb09 [rust] remove compilation buffer string match on rust-quick-run 2019-12-28 15:44:42 +01:00
Maximilian Wolff 0dc0820d62
Make rust-quick-run properly remove temp compilation function 2019-12-23 14:28:25 +01:00
Grant Shangreaux 59976dc688
Fix: broken rust-quick-run command
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
2019-12-23 14:22:32 +01:00
Maximilian Wolff beff6ec914
Replace lexical-let with normal let
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.
2019-12-20 10:24:17 +01:00
Maximilian Wolff fabbb5bf73
Update changelog and format new code to be more elisp like 2019-12-15 22:27:24 +00:00
Dietrich Daroch 3d0661a38d
Make `rust-quick-run` shell agnostic
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.
2019-12-15 22:22:36 +00:00
Tommi Komulainen 50c48bc301
rust: fix LSP/DAP integration so it doesn't depend on java layer
Fixes error with rust files when java layer isn't loaded:
```
File local-variables error: (void-function spacemacs//java-setup-lsp-dap)
```
2019-11-23 20:39:11 +01:00
syl20bnr 584392bd92 [core] Fix layer dependencies based on layer variables
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)
2019-09-30 02:00:48 -04:00
syl20bnr ac30247811 [lsp] When used, make LSP the default backend for all supported lang
* Added a new function to each language to select the backend
* Use these new functions in all `pcase`.
2019-09-30 00:49:44 -04:00
syl20bnr 9606dd344e [dap] Refactor configuration dap config in 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
2019-09-30 00:34:26 -04:00
Anton-Latukha f6660f82d4
Switch to the new layers generator 2019-05-15 21:08:21 +03:00
Anton-Latukha ba074bc908 layers: lang: new structure: general: add pure, multi-paradigm (&js) 2019-05-15 21:04:48 +03:00
JAremko 77c680160e Add placeholder tags 2019-05-05 20:40:47 +03:00
Ivan Yonchovski e80a4fa0ab [rust] dap layer integration 2019-04-18 21:32:32 +02:00
Justin f8bb6997a9 Remove lsp-javascript-typescript package for lsp built in.
Remove lsp-go package for lsp built in.
Changed go/react/typescript lsp-*-enable hooks to lsp
Update go/typescript/rust layer docs for lsp-mode installation command.
Remove unused rust layer variable
2019-01-15 00:41:30 +02:00
JAremko c5ae487b89 Fix links 2019-01-13 20:27:35 +02:00
Ivan Yonchovski f346ae0683 Fix java/python/javascript/rust lsp backends 2018-12-22 12:51:05 +02:00
emacspace 45276bd96f documentation formatting: Wed Dec 5 03:03:03 UTC 2018 2018-12-04 22:06:14 -05:00
duianto ee811f7b13 Unify packages list parentheses style
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
2018-11-21 21:35:38 +00:00
Justin f70ebe6f9e Add: rust-lsp
Add rust lsp completion with company and bindings
2018-11-05 22:58:28 +00:00