[gnome-builder/bilelmoussaoui/rust-analyzer] r-a: Opt-in for the proc-macro expansion feature
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/bilelmoussaoui/rust-analyzer] r-a: Opt-in for the proc-macro expansion feature
- Date: Thu, 3 Feb 2022 22:47:03 +0000 (UTC)
commit 95b04d48d7d3110f12f1db06579407e388dbddbb
Author: Bilal Elmoussaoui <belmouss redhat com>
Date: Thu Feb 3 21:27:30 2022 +0100
r-a: Opt-in for the proc-macro expansion feature
The proc-macro feature in r-a is still experimental, although without
it the experience with code that uses proc macros is sub-optimal.
As gtk-rs apps (the most common use case for Builder/Rust) make heavy use of macros
let us opt-in for that by default
src/plugins/rust-analyzer/rust-analyzer-service.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/src/plugins/rust-analyzer/rust-analyzer-service.c
b/src/plugins/rust-analyzer/rust-analyzer-service.c
index 118a8c5f7..06fb8dc68 100644
--- a/src/plugins/rust-analyzer/rust-analyzer-service.c
+++ b/src/plugins/rust-analyzer/rust-analyzer-service.c
@@ -152,6 +152,7 @@ rust_analyzer_service_supervisor_spawned_cb (RustAnalyzerService *self,
GInputStream *input;
const gchar *workdir;
IdeContext *context;
+ g_autoptr(GVariant) params = NULL;
IDE_ENTRY;
@@ -172,6 +173,15 @@ rust_analyzer_service_supervisor_spawned_cb (RustAnalyzerService *self,
self->client = ide_lsp_client_new (io_stream);
+ // Opt-in for the experimental proc-macro feature
+ // See https://rust-analyzer.github.io/manual.html#configuration for details
+ params = JSONRPC_MESSAGE_NEW (
+ "procMacro", "{",
+ "enable", JSONRPC_MESSAGE_PUT_BOOLEAN(TRUE),
+ "}"
+ );
+ ide_lsp_client_set_initialization_options (self->client, params);
+
g_object_set (self->client,
"use-markdown-in-diagnostics", TRUE,
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]