[gnome-builder] plugins/rust-analyzer: port to IdeLspService
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins/rust-analyzer: port to IdeLspService
- Date: Tue, 6 Sep 2022 01:53:05 +0000 (UTC)
commit 97a58c44773d011d899d7ef411fcb2ec80c3c98d
Author: Christian Hergert <chergert redhat com>
Date: Mon Sep 5 18:33:33 2022 -0700
plugins/rust-analyzer: port to IdeLspService
This is just the first part of porting to LSP service, but we still need
to apply various configurations and commands.
.../gbp-rust-analyzer-code-action-provider.c | 65 +++
.../gbp-rust-analyzer-code-action-provider.h | 31 ++
.../gbp-rust-analyzer-completion-provider.c | 61 +++
...r.h => gbp-rust-analyzer-completion-provider.h} | 8 +-
.../gbp-rust-analyzer-diagnostic-provider.c | 65 +++
...r.h => gbp-rust-analyzer-diagnostic-provider.h} | 9 +-
.../rust-analyzer/gbp-rust-analyzer-formatter.c | 65 +++
...highlighter.h => gbp-rust-analyzer-formatter.h} | 8 +-
.../rust-analyzer/gbp-rust-analyzer-highlighter.c | 65 +++
...-provider.h => gbp-rust-analyzer-highlighter.h} | 8 +-
.../gbp-rust-analyzer-hover-provider.c | 66 +++
.../gbp-rust-analyzer-hover-provider.h | 31 ++
.../gbp-rust-analyzer-rename-provider.c | 65 +++
.../gbp-rust-analyzer-rename-provider.h | 31 ++
.../gbp-rust-analyzer-search-provider.c | 85 ++++
.../gbp-rust-analyzer-search-provider.h | 31 ++
.../rust-analyzer/gbp-rust-analyzer-service.c | 79 ++++
...zer-formatter.h => gbp-rust-analyzer-service.h} | 8 +-
.../gbp-rust-analyzer-symbol-resolver.c | 65 +++
.../gbp-rust-analyzer-symbol-resolver.h | 31 ++
...ks-addin.c => gbp-rust-analyzer-tweaks-addin.c} | 14 +-
...ks-addin.h => gbp-rust-analyzer-tweaks-addin.h} | 6 +-
src/plugins/rust-analyzer/meson.build | 23 +-
.../rust-analyzer-code-action-provider.c | 64 ---
.../rust-analyzer-completion-provider.c | 57 ---
.../rust-analyzer-diagnostic-provider.c | 64 ---
.../rust-analyzer-diagnostic-provider.h | 31 --
.../rust-analyzer/rust-analyzer-formatter.c | 64 ---
.../rust-analyzer/rust-analyzer-highlighter.c | 68 ---
.../rust-analyzer/rust-analyzer-hover-provider.c | 64 ---
.../rust-analyzer/rust-analyzer-pipeline-addin.c | 402 -----------------
.../rust-analyzer/rust-analyzer-pipeline-addin.h | 33 --
src/plugins/rust-analyzer/rust-analyzer-plugin.c | 51 +--
.../rust-analyzer/rust-analyzer-rename-provider.c | 64 ---
.../rust-analyzer/rust-analyzer-rename-provider.h | 31 --
.../rust-analyzer/rust-analyzer-search-provider.c | 72 ---
.../rust-analyzer/rust-analyzer-search-provider.h | 31 --
src/plugins/rust-analyzer/rust-analyzer-service.c | 490 ---------------------
src/plugins/rust-analyzer/rust-analyzer-service.h | 38 --
.../rust-analyzer/rust-analyzer-symbol-resolver.c | 64 ---
.../rust-analyzer/rust-analyzer-symbol-resolver.h | 31 --
src/plugins/rust-analyzer/rust-analyzer.plugin | 2 +-
42 files changed, 900 insertions(+), 1741 deletions(-)
---
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-code-action-provider.c
b/src/plugins/rust-analyzer/gbp-rust-analyzer-code-action-provider.c
new file mode 100644
index 000000000..1a0b6de54
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-code-action-provider.c
@@ -0,0 +1,65 @@
+/* gbp-rust-analyzer-code-action-provider.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-rust-analyzer-code-action-provider"
+
+#include "config.h"
+
+#include "gbp-rust-analyzer-code-action-provider.h"
+#include "gbp-rust-analyzer-service.h"
+
+struct _GbpRustAnalyzerCodeActionProvider
+{
+ IdeLspCodeActionProvider parent_instance;
+};
+
+static void
+gbp_rust_analyzer_code_action_provider_load (IdeCodeActionProvider *provider)
+{
+ g_autoptr(IdeLspServiceClass) klass = NULL;
+
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_RUST_ANALYZER_CODE_ACTION_PROVIDER (provider));
+
+ klass = g_type_class_ref (GBP_TYPE_RUST_ANALYZER_SERVICE);
+ ide_lsp_service_class_bind_client (klass, IDE_OBJECT (provider));
+
+ IDE_EXIT;
+}
+
+static void
+code_action_provider_iface_init (IdeCodeActionProviderInterface *iface)
+{
+ iface->load = gbp_rust_analyzer_code_action_provider_load;
+}
+
+G_DEFINE_FINAL_TYPE_WITH_CODE (GbpRustAnalyzerCodeActionProvider, gbp_rust_analyzer_code_action_provider,
IDE_TYPE_LSP_CODE_ACTION_PROVIDER,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_CODE_ACTION_PROVIDER,
code_action_provider_iface_init))
+
+static void
+gbp_rust_analyzer_code_action_provider_class_init (GbpRustAnalyzerCodeActionProviderClass *klass)
+{
+}
+
+static void
+gbp_rust_analyzer_code_action_provider_init (GbpRustAnalyzerCodeActionProvider *self)
+{
+}
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-code-action-provider.h
b/src/plugins/rust-analyzer/gbp-rust-analyzer-code-action-provider.h
new file mode 100644
index 000000000..92ddb7133
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-code-action-provider.h
@@ -0,0 +1,31 @@
+/* gbp-rust_analyzer-code-action-provider.h
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <libide-lsp.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_RUST_ANALYZER_CODE_ACTION_PROVIDER (gbp_rust_analyzer_code_action_provider_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpRustAnalyzerCodeActionProvider, gbp_rust_analyzer_code_action_provider, GBP,
RUST_ANALYZER_CODE_ACTION_PROVIDER, IdeLspCodeActionProvider)
+
+G_END_DECLS
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-completion-provider.c
b/src/plugins/rust-analyzer/gbp-rust-analyzer-completion-provider.c
new file mode 100644
index 000000000..778e25fbc
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-completion-provider.c
@@ -0,0 +1,61 @@
+/* gbp-rust-analyzer-completion-provider.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-rust-analyzer-completion-provider"
+
+#include "config.h"
+
+#include "gbp-rust-analyzer-completion-provider.h"
+#include "gbp-rust-analyzer-service.h"
+
+struct _GbpRustAnalyzerCompletionProvider
+{
+ IdeLspCompletionProvider parent_instance;
+};
+
+static void
+gbp_rust_analyzer_completion_provider_load (IdeLspCompletionProvider *provider)
+{
+ g_autoptr(IdeLspServiceClass) klass = NULL;
+
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_RUST_ANALYZER_COMPLETION_PROVIDER (provider));
+
+ klass = g_type_class_ref (GBP_TYPE_RUST_ANALYZER_SERVICE);
+ ide_lsp_service_class_bind_client (klass, IDE_OBJECT (provider));
+
+ IDE_EXIT;
+}
+
+G_DEFINE_FINAL_TYPE (GbpRustAnalyzerCompletionProvider, gbp_rust_analyzer_completion_provider,
IDE_TYPE_LSP_COMPLETION_PROVIDER)
+
+static void
+gbp_rust_analyzer_completion_provider_class_init (GbpRustAnalyzerCompletionProviderClass *klass)
+{
+ IdeLspCompletionProviderClass *lsp_completion_provider_class = IDE_LSP_COMPLETION_PROVIDER_CLASS (klass);
+
+ lsp_completion_provider_class->load = gbp_rust_analyzer_completion_provider_load;
+}
+
+static void
+gbp_rust_analyzer_completion_provider_init (GbpRustAnalyzerCompletionProvider *self)
+{
+}
diff --git a/src/plugins/rust-analyzer/rust-analyzer-code-action-provider.h
b/src/plugins/rust-analyzer/gbp-rust-analyzer-completion-provider.h
similarity index 67%
rename from src/plugins/rust-analyzer/rust-analyzer-code-action-provider.h
rename to src/plugins/rust-analyzer/gbp-rust-analyzer-completion-provider.h
index f7f974b49..8a700b8a7 100644
--- a/src/plugins/rust-analyzer/rust-analyzer-code-action-provider.h
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-completion-provider.h
@@ -1,6 +1,6 @@
-/* rust-analyzer-code-action-provider.h
+/* gbp-rust_analyzer-completion-provider.h
*
- * Copyright 2021 Georg Vienna <georg vienna himbarsoft com>
+ * Copyright 2022 Christian Hergert <chergert redhat com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,8 +24,8 @@
G_BEGIN_DECLS
-#define RUST_TYPE_ANALYZER_CODE_ACTION_PROVIDER (rust_analyzer_code_action_provider_get_type())
+#define GBP_TYPE_RUST_ANALYZER_COMPLETION_PROVIDER (gbp_rust_analyzer_completion_provider_get_type())
-G_DECLARE_FINAL_TYPE (RustAnalyzerCodeActionProvider, rust_analyzer_code_action_provider, RUST,
ANALYZER_CODE_ACTION_PROVIDER, IdeLspCodeActionProvider)
+G_DECLARE_FINAL_TYPE (GbpRustAnalyzerCompletionProvider, gbp_rust_analyzer_completion_provider, GBP,
RUST_ANALYZER_COMPLETION_PROVIDER, IdeLspCompletionProvider)
G_END_DECLS
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-diagnostic-provider.c
b/src/plugins/rust-analyzer/gbp-rust-analyzer-diagnostic-provider.c
new file mode 100644
index 000000000..89f5d5b49
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-diagnostic-provider.c
@@ -0,0 +1,65 @@
+/* gbp-rust-analyzer-diagnostic-provider.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-rust-analyzer-diagnostic-provider"
+
+#include "config.h"
+
+#include "gbp-rust-analyzer-diagnostic-provider.h"
+#include "gbp-rust-analyzer-service.h"
+
+struct _GbpRustAnalyzerDiagnosticProvider
+{
+ IdeLspDiagnosticProvider parent_instance;
+};
+
+static void
+gbp_rust_analyzer_diagnostic_provider_load (IdeDiagnosticProvider *provider)
+{
+ g_autoptr(IdeLspServiceClass) klass = NULL;
+
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_RUST_ANALYZER_DIAGNOSTIC_PROVIDER (provider));
+
+ klass = g_type_class_ref (GBP_TYPE_RUST_ANALYZER_SERVICE);
+ ide_lsp_service_class_bind_client (klass, IDE_OBJECT (provider));
+
+ IDE_EXIT;
+}
+
+static void
+diagnostic_provider_iface_init (IdeDiagnosticProviderInterface *iface)
+{
+ iface->load = gbp_rust_analyzer_diagnostic_provider_load;
+}
+
+G_DEFINE_FINAL_TYPE_WITH_CODE (GbpRustAnalyzerDiagnosticProvider, gbp_rust_analyzer_diagnostic_provider,
IDE_TYPE_LSP_DIAGNOSTIC_PROVIDER,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_DIAGNOSTIC_PROVIDER,
diagnostic_provider_iface_init))
+
+static void
+gbp_rust_analyzer_diagnostic_provider_class_init (GbpRustAnalyzerDiagnosticProviderClass *klass)
+{
+}
+
+static void
+gbp_rust_analyzer_diagnostic_provider_init (GbpRustAnalyzerDiagnosticProvider *self)
+{
+}
diff --git a/src/plugins/rust-analyzer/rust-analyzer-completion-provider.h
b/src/plugins/rust-analyzer/gbp-rust-analyzer-diagnostic-provider.h
similarity index 67%
rename from src/plugins/rust-analyzer/rust-analyzer-completion-provider.h
rename to src/plugins/rust-analyzer/gbp-rust-analyzer-diagnostic-provider.h
index f06faaff5..019472454 100644
--- a/src/plugins/rust-analyzer/rust-analyzer-completion-provider.h
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-diagnostic-provider.h
@@ -1,6 +1,6 @@
-/* rust-analyzer-completion-provider.h
+/* gbp-rust_analyzer-diagnostic-provider.h
*
- * Copyright 2020 Günther Wagner <info gunibert de>
+ * Copyright 2022 Christian Hergert <chergert redhat com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,13 +20,12 @@
#pragma once
-#include <glib-object.h>
#include <libide-lsp.h>
G_BEGIN_DECLS
-#define RUST_TYPE_ANALYZER_COMPLETION_PROVIDER (rust_analyzer_completion_provider_get_type())
+#define GBP_TYPE_RUST_ANALYZER_DIAGNOSTIC_PROVIDER (gbp_rust_analyzer_diagnostic_provider_get_type())
-G_DECLARE_FINAL_TYPE (RustAnalyzerCompletionProvider, rust_analyzer_completion_provider, RUST,
ANALYZER_COMPLETION_PROVIDER, IdeLspCompletionProvider)
+G_DECLARE_FINAL_TYPE (GbpRustAnalyzerDiagnosticProvider, gbp_rust_analyzer_diagnostic_provider, GBP,
RUST_ANALYZER_DIAGNOSTIC_PROVIDER, IdeLspDiagnosticProvider)
G_END_DECLS
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-formatter.c
b/src/plugins/rust-analyzer/gbp-rust-analyzer-formatter.c
new file mode 100644
index 000000000..b2f3fab4a
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-formatter.c
@@ -0,0 +1,65 @@
+/* gbp-rust-analyzer-formatter.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-rust-analyzer-formatter"
+
+#include "config.h"
+
+#include "gbp-rust-analyzer-formatter.h"
+#include "gbp-rust-analyzer-service.h"
+
+struct _GbpRustAnalyzerFormatter
+{
+ IdeLspFormatter parent_instance;
+};
+
+static void
+gbp_rust_analyzer_formatter_load (IdeFormatter *provider)
+{
+ g_autoptr(IdeLspServiceClass) klass = NULL;
+
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_RUST_ANALYZER_FORMATTER (provider));
+
+ klass = g_type_class_ref (GBP_TYPE_RUST_ANALYZER_SERVICE);
+ ide_lsp_service_class_bind_client (klass, IDE_OBJECT (provider));
+
+ IDE_EXIT;
+}
+
+static void
+formatter_iface_init (IdeFormatterInterface *iface)
+{
+ iface->load = gbp_rust_analyzer_formatter_load;
+}
+
+G_DEFINE_FINAL_TYPE_WITH_CODE (GbpRustAnalyzerFormatter, gbp_rust_analyzer_formatter, IDE_TYPE_LSP_FORMATTER,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_FORMATTER, formatter_iface_init))
+
+static void
+gbp_rust_analyzer_formatter_class_init (GbpRustAnalyzerFormatterClass *klass)
+{
+}
+
+static void
+gbp_rust_analyzer_formatter_init (GbpRustAnalyzerFormatter *self)
+{
+}
diff --git a/src/plugins/rust-analyzer/rust-analyzer-highlighter.h
b/src/plugins/rust-analyzer/gbp-rust-analyzer-formatter.h
similarity index 72%
rename from src/plugins/rust-analyzer/rust-analyzer-highlighter.h
rename to src/plugins/rust-analyzer/gbp-rust-analyzer-formatter.h
index dcadbf34d..7b18f82fb 100644
--- a/src/plugins/rust-analyzer/rust-analyzer-highlighter.h
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-formatter.h
@@ -1,6 +1,6 @@
-/* rust-analyzer-highlighter.h
+/* gbp-rust_analyzer-formatter.h
*
- * Copyright 2020 Günther Wagner <info gunibert de>
+ * Copyright 2022 Christian Hergert <chergert redhat com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,8 +24,8 @@
G_BEGIN_DECLS
-#define RUST_TYPE_ANALYZER_HIGHLIGHTER (rust_analyzer_highlighter_get_type())
+#define GBP_TYPE_RUST_ANALYZER_FORMATTER (gbp_rust_analyzer_formatter_get_type())
-G_DECLARE_FINAL_TYPE (RustAnalyzerHighlighter, rust_analyzer_highlighter, RUST, ANALYZER_HIGHLIGHTER,
IdeLspHighlighter)
+G_DECLARE_FINAL_TYPE (GbpRustAnalyzerFormatter, gbp_rust_analyzer_formatter, GBP, RUST_ANALYZER_FORMATTER,
IdeLspFormatter)
G_END_DECLS
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-highlighter.c
b/src/plugins/rust-analyzer/gbp-rust-analyzer-highlighter.c
new file mode 100644
index 000000000..60235342c
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-highlighter.c
@@ -0,0 +1,65 @@
+/* gbp-rust-analyzer-highlighter.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-rust-analyzer-highlighter"
+
+#include "config.h"
+
+#include "gbp-rust-analyzer-highlighter.h"
+#include "gbp-rust-analyzer-service.h"
+
+struct _GbpRustAnalyzerHighlighter
+{
+ IdeLspHighlighter parent_instance;
+};
+
+static void
+gbp_rust_analyzer_highlighter_load (IdeHighlighter *provider)
+{
+ g_autoptr(IdeLspServiceClass) klass = NULL;
+
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_RUST_ANALYZER_HIGHLIGHTER (provider));
+
+ klass = g_type_class_ref (GBP_TYPE_RUST_ANALYZER_SERVICE);
+ ide_lsp_service_class_bind_client (klass, IDE_OBJECT (provider));
+
+ IDE_EXIT;
+}
+
+static void
+highlighter_iface_init (IdeHighlighterInterface *iface)
+{
+ iface->load = gbp_rust_analyzer_highlighter_load;
+}
+
+G_DEFINE_FINAL_TYPE_WITH_CODE (GbpRustAnalyzerHighlighter, gbp_rust_analyzer_highlighter,
IDE_TYPE_LSP_HIGHLIGHTER,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_HIGHLIGHTER, highlighter_iface_init))
+
+static void
+gbp_rust_analyzer_highlighter_class_init (GbpRustAnalyzerHighlighterClass *klass)
+{
+}
+
+static void
+gbp_rust_analyzer_highlighter_init (GbpRustAnalyzerHighlighter *self)
+{
+}
diff --git a/src/plugins/rust-analyzer/rust-analyzer-hover-provider.h
b/src/plugins/rust-analyzer/gbp-rust-analyzer-highlighter.h
similarity index 71%
rename from src/plugins/rust-analyzer/rust-analyzer-hover-provider.h
rename to src/plugins/rust-analyzer/gbp-rust-analyzer-highlighter.h
index a9d426733..493ebc122 100644
--- a/src/plugins/rust-analyzer/rust-analyzer-hover-provider.h
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-highlighter.h
@@ -1,6 +1,6 @@
-/* rust-analyzer-hover-provider.h
+/* gbp-rust_analyzer-highlighter.h
*
- * Copyright 2020 Günther Wagner <info gunibert de>
+ * Copyright 2022 Christian Hergert <chergert redhat com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,8 +24,8 @@
G_BEGIN_DECLS
-#define RUST_TYPE_ANALYZER_HOVER_PROVIDER (rust_analyzer_hover_provider_get_type())
+#define GBP_TYPE_RUST_ANALYZER_HIGHLIGHTER (gbp_rust_analyzer_highlighter_get_type())
-G_DECLARE_FINAL_TYPE (RustAnalyzerHoverProvider, rust_analyzer_hover_provider, RUST,
ANALYZER_HOVER_PROVIDER, IdeLspHoverProvider)
+G_DECLARE_FINAL_TYPE (GbpRustAnalyzerHighlighter, gbp_rust_analyzer_highlighter, GBP,
RUST_ANALYZER_HIGHLIGHTER, IdeLspHighlighter)
G_END_DECLS
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-hover-provider.c
b/src/plugins/rust-analyzer/gbp-rust-analyzer-hover-provider.c
new file mode 100644
index 000000000..7b8febf56
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-hover-provider.c
@@ -0,0 +1,66 @@
+/* gbp-rust-analyzer-hover-provider.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-rust-analyzer-hover-provider"
+
+#include "config.h"
+
+#include "gbp-rust-analyzer-hover-provider.h"
+#include "gbp-rust-analyzer-service.h"
+
+struct _GbpRustAnalyzerHoverProvider
+{
+ IdeLspHoverProvider parent_instance;
+};
+
+static void
+gbp_rust_analyzer_hover_provider_prepare (IdeLspHoverProvider *provider)
+{
+ g_autoptr(IdeLspServiceClass) klass = NULL;
+
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_RUST_ANALYZER_HOVER_PROVIDER (provider));
+
+ g_object_set (provider,
+ "category", "Typescript",
+ "priority", 200,
+ NULL);
+
+ klass = g_type_class_ref (GBP_TYPE_RUST_ANALYZER_SERVICE);
+ ide_lsp_service_class_bind_client (klass, IDE_OBJECT (provider));
+
+ IDE_EXIT;
+}
+
+G_DEFINE_FINAL_TYPE (GbpRustAnalyzerHoverProvider, gbp_rust_analyzer_hover_provider,
IDE_TYPE_LSP_HOVER_PROVIDER)
+
+static void
+gbp_rust_analyzer_hover_provider_class_init (GbpRustAnalyzerHoverProviderClass *klass)
+{
+ IdeLspHoverProviderClass *lsp_hover_provider_class = IDE_LSP_HOVER_PROVIDER_CLASS (klass);
+
+ lsp_hover_provider_class->prepare = gbp_rust_analyzer_hover_provider_prepare;
+}
+
+static void
+gbp_rust_analyzer_hover_provider_init (GbpRustAnalyzerHoverProvider *self)
+{
+}
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-hover-provider.h
b/src/plugins/rust-analyzer/gbp-rust-analyzer-hover-provider.h
new file mode 100644
index 000000000..1e820a0ce
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-hover-provider.h
@@ -0,0 +1,31 @@
+/* gbp-rust_analyzer-hover-provider.h
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <libide-lsp.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_RUST_ANALYZER_HOVER_PROVIDER (gbp_rust_analyzer_hover_provider_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpRustAnalyzerHoverProvider, gbp_rust_analyzer_hover_provider, GBP,
RUST_ANALYZER_HOVER_PROVIDER, IdeLspHoverProvider)
+
+G_END_DECLS
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-rename-provider.c
b/src/plugins/rust-analyzer/gbp-rust-analyzer-rename-provider.c
new file mode 100644
index 000000000..d62296b56
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-rename-provider.c
@@ -0,0 +1,65 @@
+/* gbp-rust-analyzer-rename-provider.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-rust-analyzer-rename-provider"
+
+#include "config.h"
+
+#include "gbp-rust-analyzer-rename-provider.h"
+#include "gbp-rust-analyzer-service.h"
+
+struct _GbpRustAnalyzerRenameProvider
+{
+ IdeLspRenameProvider parent_instance;
+};
+
+static void
+gbp_rust_analyzer_rename_provider_load (IdeRenameProvider *provider)
+{
+ g_autoptr(IdeLspServiceClass) klass = NULL;
+
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_RUST_ANALYZER_RENAME_PROVIDER (provider));
+
+ klass = g_type_class_ref (GBP_TYPE_RUST_ANALYZER_SERVICE);
+ ide_lsp_service_class_bind_client (klass, IDE_OBJECT (provider));
+
+ IDE_EXIT;
+}
+
+static void
+rename_provider_iface_init (IdeRenameProviderInterface *iface)
+{
+ iface->load = gbp_rust_analyzer_rename_provider_load;
+}
+
+G_DEFINE_FINAL_TYPE_WITH_CODE (GbpRustAnalyzerRenameProvider, gbp_rust_analyzer_rename_provider,
IDE_TYPE_LSP_RENAME_PROVIDER,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_RENAME_PROVIDER, rename_provider_iface_init))
+
+static void
+gbp_rust_analyzer_rename_provider_class_init (GbpRustAnalyzerRenameProviderClass *klass)
+{
+}
+
+static void
+gbp_rust_analyzer_rename_provider_init (GbpRustAnalyzerRenameProvider *self)
+{
+}
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-rename-provider.h
b/src/plugins/rust-analyzer/gbp-rust-analyzer-rename-provider.h
new file mode 100644
index 000000000..cfbf8e338
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-rename-provider.h
@@ -0,0 +1,31 @@
+/* gbp-rust_analyzer-rename-provider.h
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <libide-lsp.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_RUST_ANALYZER_RENAME_PROVIDER (gbp_rust_analyzer_rename_provider_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpRustAnalyzerRenameProvider, gbp_rust_analyzer_rename_provider, GBP,
RUST_ANALYZER_RENAME_PROVIDER, IdeLspRenameProvider)
+
+G_END_DECLS
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-search-provider.c
b/src/plugins/rust-analyzer/gbp-rust-analyzer-search-provider.c
new file mode 100644
index 000000000..6382f60ae
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-search-provider.c
@@ -0,0 +1,85 @@
+/* gbp-rust-analyzer-search-provider.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-rust-analyzer-search-provider"
+
+#include "config.h"
+
+#include <libide-foundry.h>
+#include <libide-search.h>
+
+#include "gbp-rust-analyzer-search-provider.h"
+#include "gbp-rust-analyzer-service.h"
+
+struct _GbpRustAnalyzerSearchProvider
+{
+ IdeLspSearchProvider parent_instance;
+};
+
+static void
+gbp_rust_analyzer_search_provider_load (IdeSearchProvider *provider)
+{
+ g_autoptr(IdeLspServiceClass) klass = NULL;
+ IdeBuildSystem *build_system;
+ IdeContext *context;
+
+ IDE_ENTRY;
+
+ g_assert (IDE_IS_MAIN_THREAD ());
+ g_assert (GBP_IS_RUST_ANALYZER_SEARCH_PROVIDER (provider));
+
+ context = ide_object_get_context (IDE_OBJECT (provider));
+
+ if (!ide_context_has_project (context))
+ IDE_EXIT;
+
+ build_system = ide_build_system_from_context (context);
+
+ if (!ide_build_system_supports_language (build_system, "rust"))
+ {
+ g_debug ("%s does not advertise use of Rust in project. Searches will be ignored.",
+ G_OBJECT_TYPE_NAME (build_system));
+ IDE_EXIT;
+ }
+
+ klass = g_type_class_ref (GBP_TYPE_RUST_ANALYZER_SERVICE);
+ ide_lsp_service_class_bind_client_lazy (klass, IDE_OBJECT (provider));
+
+ IDE_EXIT;
+}
+
+static void
+search_provider_iface_init (IdeSearchProviderInterface *iface)
+{
+ iface->load = gbp_rust_analyzer_search_provider_load;
+}
+
+G_DEFINE_FINAL_TYPE_WITH_CODE (GbpRustAnalyzerSearchProvider, gbp_rust_analyzer_search_provider,
IDE_TYPE_LSP_SEARCH_PROVIDER,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_SEARCH_PROVIDER, search_provider_iface_init))
+
+static void
+gbp_rust_analyzer_search_provider_class_init (GbpRustAnalyzerSearchProviderClass *klass)
+{
+}
+
+static void
+gbp_rust_analyzer_search_provider_init (GbpRustAnalyzerSearchProvider *self)
+{
+}
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-search-provider.h
b/src/plugins/rust-analyzer/gbp-rust-analyzer-search-provider.h
new file mode 100644
index 000000000..6a10b48b5
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-search-provider.h
@@ -0,0 +1,31 @@
+/* gbp-rust-analyzer-search-provider.h
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <libide-lsp.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_RUST_ANALYZER_SEARCH_PROVIDER (gbp_rust_analyzer_search_provider_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpRustAnalyzerSearchProvider, gbp_rust_analyzer_search_provider, GBP,
RUST_ANALYZER_SEARCH_PROVIDER, IdeLspSearchProvider)
+
+G_END_DECLS
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-service.c
b/src/plugins/rust-analyzer/gbp-rust-analyzer-service.c
new file mode 100644
index 000000000..de3c477f3
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-service.c
@@ -0,0 +1,79 @@
+/* gbp-rust-analyzer-service.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-rust-analyzer-service"
+
+#include "config.h"
+
+#include <jsonrpc-glib.h>
+
+#include <libide-threading.h>
+
+#include "gbp-rust-analyzer-service.h"
+
+struct _GbpRustAnalyzerService
+{
+ IdeLspService parent_instance;
+};
+
+G_DEFINE_FINAL_TYPE (GbpRustAnalyzerService, gbp_rust_analyzer_service, IDE_TYPE_LSP_SERVICE)
+
+static void
+gbp_rust_analyzer_service_configure_client (IdeLspService *service,
+ IdeLspClient *client)
+{
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_RUST_ANALYZER_SERVICE (service));
+ g_assert (IDE_IS_LSP_CLIENT (client));
+
+ ide_lsp_client_add_language (client, "rust");
+
+ IDE_EXIT;
+}
+
+static void
+gbp_rust_analyzer_service_configure_launcher (IdeLspService *service,
+ IdePipeline *pipeline,
+ IdeSubprocessLauncher *launcher)
+{
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_RUST_ANALYZER_SERVICE (service));
+ g_assert (IDE_IS_PIPELINE (pipeline));
+ g_assert (IDE_IS_SUBPROCESS_LAUNCHER (launcher));
+
+ IDE_EXIT;
+}
+
+static void
+gbp_rust_analyzer_service_class_init (GbpRustAnalyzerServiceClass *klass)
+{
+ IdeLspServiceClass *lsp_service_class = IDE_LSP_SERVICE_CLASS (klass);
+
+ lsp_service_class->configure_client = gbp_rust_analyzer_service_configure_client;
+ lsp_service_class->configure_launcher = gbp_rust_analyzer_service_configure_launcher;
+}
+
+static void
+gbp_rust_analyzer_service_init (GbpRustAnalyzerService *self)
+{
+ ide_lsp_service_set_program (IDE_LSP_SERVICE (self), "rust-analyzer");
+}
diff --git a/src/plugins/rust-analyzer/rust-analyzer-formatter.h
b/src/plugins/rust-analyzer/gbp-rust-analyzer-service.h
similarity index 73%
rename from src/plugins/rust-analyzer/rust-analyzer-formatter.h
rename to src/plugins/rust-analyzer/gbp-rust-analyzer-service.h
index cd1640631..6235e7837 100644
--- a/src/plugins/rust-analyzer/rust-analyzer-formatter.h
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-service.h
@@ -1,6 +1,6 @@
-/* rust-analyzer-formatter.h
+/* gbp-rust_analyzer-service.h
*
- * Copyright 2020 Günther Wagner <info gunibert de>
+ * Copyright 2022 Christian Hergert <chergert redhat com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,8 +24,8 @@
G_BEGIN_DECLS
-#define RUST_TYPE_ANALYZER_FORMATTER (rust_analyzer_formatter_get_type())
+#define GBP_TYPE_RUST_ANALYZER_SERVICE (gbp_rust_analyzer_service_get_type())
-G_DECLARE_FINAL_TYPE (RustAnalyzerFormatter, rust_analyzer_formatter, RUST, ANALYZER_FORMATTER,
IdeLspFormatter)
+G_DECLARE_FINAL_TYPE (GbpRustAnalyzerService, gbp_rust_analyzer_service, GBP, RUST_ANALYZER_SERVICE,
IdeLspService)
G_END_DECLS
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-symbol-resolver.c
b/src/plugins/rust-analyzer/gbp-rust-analyzer-symbol-resolver.c
new file mode 100644
index 000000000..6a429e00f
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-symbol-resolver.c
@@ -0,0 +1,65 @@
+/* gbp-rust-analyzer-symbol-resolver.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-rust-analyzer-symbol-resolver"
+
+#include "config.h"
+
+#include "gbp-rust-analyzer-symbol-resolver.h"
+#include "gbp-rust-analyzer-service.h"
+
+struct _GbpRustAnalyzerSymbolResolver
+{
+ IdeLspSymbolResolver parent_instance;
+};
+
+static void
+gbp_rust_analyzer_symbol_provider_load (IdeSymbolResolver *provider)
+{
+ g_autoptr(IdeLspServiceClass) klass = NULL;
+
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_RUST_ANALYZER_SYMBOL_RESOLVER (provider));
+
+ klass = g_type_class_ref (GBP_TYPE_RUST_ANALYZER_SERVICE);
+ ide_lsp_service_class_bind_client (klass, IDE_OBJECT (provider));
+
+ IDE_EXIT;
+}
+
+static void
+symbol_provider_iface_init (IdeSymbolResolverInterface *iface)
+{
+ iface->load = gbp_rust_analyzer_symbol_provider_load;
+}
+
+G_DEFINE_FINAL_TYPE_WITH_CODE (GbpRustAnalyzerSymbolResolver, gbp_rust_analyzer_symbol_provider,
IDE_TYPE_LSP_SYMBOL_RESOLVER,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_SYMBOL_RESOLVER, symbol_provider_iface_init))
+
+static void
+gbp_rust_analyzer_symbol_provider_class_init (GbpRustAnalyzerSymbolResolverClass *klass)
+{
+}
+
+static void
+gbp_rust_analyzer_symbol_provider_init (GbpRustAnalyzerSymbolResolver *self)
+{
+}
diff --git a/src/plugins/rust-analyzer/gbp-rust-analyzer-symbol-resolver.h
b/src/plugins/rust-analyzer/gbp-rust-analyzer-symbol-resolver.h
new file mode 100644
index 000000000..99ab51def
--- /dev/null
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-symbol-resolver.h
@@ -0,0 +1,31 @@
+/* gbp-rust_analyzer-symbol-resolver.h
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <libide-lsp.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_RUST_ANALYZER_SYMBOL_RESOLVER (gbp_rust_analyzer_symbol_provider_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpRustAnalyzerSymbolResolver, gbp_rust_analyzer_symbol_provider, GBP,
RUST_ANALYZER_SYMBOL_RESOLVER, IdeLspSymbolResolver)
+
+G_END_DECLS
diff --git a/src/plugins/rust-analyzer/rust-analyzer-tweaks-addin.c
b/src/plugins/rust-analyzer/gbp-rust-analyzer-tweaks-addin.c
similarity index 70%
rename from src/plugins/rust-analyzer/rust-analyzer-tweaks-addin.c
rename to src/plugins/rust-analyzer/gbp-rust-analyzer-tweaks-addin.c
index eadd1069b..4a9e4aed9 100644
--- a/src/plugins/rust-analyzer/rust-analyzer-tweaks-addin.c
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-tweaks-addin.c
@@ -1,4 +1,4 @@
-/* rust-analyzer-tweaks-addin.c
+/* gbp-rust-analyzer-tweaks-addin.c
*
* Copyright 2022 Christian Hergert <chergert redhat com>
*
@@ -18,26 +18,26 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
-#define G_LOG_DOMAIN "rust-analyzer-tweaks-addin"
+#define G_LOG_DOMAIN "gbp-rust-analyzer-tweaks-addin"
#include "config.h"
-#include "rust-analyzer-tweaks-addin.h"
+#include "gbp-rust-analyzer-tweaks-addin.h"
-struct _RustAnalyzerTweaksAddin
+struct _GbpRustAnalyzerTweaksAddin
{
IdeTweaksAddin parent_instance;
};
-G_DEFINE_FINAL_TYPE (RustAnalyzerTweaksAddin, rust_analyzer_tweaks_addin, IDE_TYPE_TWEAKS_ADDIN)
+G_DEFINE_FINAL_TYPE (GbpRustAnalyzerTweaksAddin, gbp_rust_analyzer_tweaks_addin, IDE_TYPE_TWEAKS_ADDIN)
static void
-rust_analyzer_tweaks_addin_class_init (RustAnalyzerTweaksAddinClass *klass)
+gbp_rust_analyzer_tweaks_addin_class_init (GbpRustAnalyzerTweaksAddinClass *klass)
{
}
static void
-rust_analyzer_tweaks_addin_init (RustAnalyzerTweaksAddin *self)
+gbp_rust_analyzer_tweaks_addin_init (GbpRustAnalyzerTweaksAddin *self)
{
ide_tweaks_addin_set_resource_paths (IDE_TWEAKS_ADDIN (self),
IDE_STRV_INIT ("/plugins/rust-analyzer/tweaks.ui"));
diff --git a/src/plugins/rust-analyzer/rust-analyzer-tweaks-addin.h
b/src/plugins/rust-analyzer/gbp-rust-analyzer-tweaks-addin.h
similarity index 76%
rename from src/plugins/rust-analyzer/rust-analyzer-tweaks-addin.h
rename to src/plugins/rust-analyzer/gbp-rust-analyzer-tweaks-addin.h
index 333d6830a..22ef385d9 100644
--- a/src/plugins/rust-analyzer/rust-analyzer-tweaks-addin.h
+++ b/src/plugins/rust-analyzer/gbp-rust-analyzer-tweaks-addin.h
@@ -1,4 +1,4 @@
-/* rust-analyzer-tweaks-addin.h
+/* gbp-rust-analyzer-tweaks-addin.h
*
* Copyright 2022 Christian Hergert <chergert redhat com>
*
@@ -24,8 +24,8 @@
G_BEGIN_DECLS
-#define RUST_TYPE_ANALYZER_TWEAKS_ADDIN (rust_analyzer_tweaks_addin_get_type())
+#define GBP_TYPE_RUST_ANALYZER_TWEAKS_ADDIN (gbp_rust_analyzer_tweaks_addin_get_type())
-G_DECLARE_FINAL_TYPE (RustAnalyzerTweaksAddin, rust_analyzer_tweaks_addin, RUST, ANALYZER_TWEAKS_ADDIN,
IdeTweaksAddin)
+G_DECLARE_FINAL_TYPE (GbpRustAnalyzerTweaksAddin, gbp_rust_analyzer_tweaks_addin, GBP,
RUST_ANALYZER_TWEAKS_ADDIN, IdeTweaksAddin)
G_END_DECLS
diff --git a/src/plugins/rust-analyzer/meson.build b/src/plugins/rust-analyzer/meson.build
index 1ab7775df..eea43bba4 100644
--- a/src/plugins/rust-analyzer/meson.build
+++ b/src/plugins/rust-analyzer/meson.build
@@ -1,19 +1,18 @@
if get_option('plugin_rust_analyzer')
plugins_sources += files([
- 'rust-analyzer-code-action-provider.c',
- 'rust-analyzer-completion-provider.c',
- 'rust-analyzer-diagnostic-provider.c',
- 'rust-analyzer-formatter.c',
- 'rust-analyzer-highlighter.c',
- 'rust-analyzer-hover-provider.c',
- 'rust-analyzer-pipeline-addin.c',
+ 'gbp-rust-analyzer-code-action-provider.c',
+ 'gbp-rust-analyzer-completion-provider.c',
+ 'gbp-rust-analyzer-diagnostic-provider.c',
+ 'gbp-rust-analyzer-formatter.c',
+ 'gbp-rust-analyzer-highlighter.c',
+ 'gbp-rust-analyzer-hover-provider.c',
+ 'gbp-rust-analyzer-rename-provider.c',
+ 'gbp-rust-analyzer-search-provider.c',
+ 'gbp-rust-analyzer-service.c',
+ 'gbp-rust-analyzer-symbol-resolver.c',
+ 'gbp-rust-analyzer-tweaks-addin.c',
'rust-analyzer-plugin.c',
- 'rust-analyzer-rename-provider.c',
- 'rust-analyzer-search-provider.c',
- 'rust-analyzer-service.c',
- 'rust-analyzer-symbol-resolver.c',
- 'rust-analyzer-tweaks-addin.c',
])
plugin_rust_analyzer_resources = gnome.compile_resources(
diff --git a/src/plugins/rust-analyzer/rust-analyzer-plugin.c
b/src/plugins/rust-analyzer/rust-analyzer-plugin.c
index 53a43edcb..a130c46b8 100644
--- a/src/plugins/rust-analyzer/rust-analyzer-plugin.c
+++ b/src/plugins/rust-analyzer/rust-analyzer-plugin.c
@@ -24,56 +24,49 @@
#include <libide-lsp.h>
#include <libide-gui.h>
-#include "rust-analyzer-code-action-provider.h"
-#include "rust-analyzer-completion-provider.h"
-#include "rust-analyzer-diagnostic-provider.h"
-#include "rust-analyzer-formatter.h"
-#include "rust-analyzer-highlighter.h"
-#include "rust-analyzer-hover-provider.h"
-#include "rust-analyzer-pipeline-addin.h"
-#include "rust-analyzer-rename-provider.h"
-#include "rust-analyzer-search-provider.h"
-#include "rust-analyzer-service.h"
-#include "rust-analyzer-symbol-resolver.h"
-#include "rust-analyzer-tweaks-addin.h"
+#include "gbp-rust-analyzer-code-action-provider.h"
+#include "gbp-rust-analyzer-completion-provider.h"
+#include "gbp-rust-analyzer-diagnostic-provider.h"
+#include "gbp-rust-analyzer-formatter.h"
+#include "gbp-rust-analyzer-highlighter.h"
+#include "gbp-rust-analyzer-hover-provider.h"
+#include "gbp-rust-analyzer-rename-provider.h"
+#include "gbp-rust-analyzer-search-provider.h"
+#include "gbp-rust-analyzer-service.h"
+#include "gbp-rust-analyzer-symbol-resolver.h"
+#include "gbp-rust-analyzer-tweaks-addin.h"
_IDE_EXTERN void
-_rust_analyzer_register_types (PeasObjectModule *module)
+_gbp_rust_analyzer_register_types (PeasObjectModule *module)
{
- peas_object_module_register_extension_type (module,
- IDE_TYPE_WORKBENCH_ADDIN,
- RUST_TYPE_ANALYZER_SERVICE);
- peas_object_module_register_extension_type (module,
- IDE_TYPE_PIPELINE_ADDIN,
- RUST_TYPE_ANALYZER_PIPELINE_ADDIN);
peas_object_module_register_extension_type (module,
GTK_SOURCE_TYPE_COMPLETION_PROVIDER,
- RUST_TYPE_ANALYZER_COMPLETION_PROVIDER);
+ GBP_TYPE_RUST_ANALYZER_COMPLETION_PROVIDER);
peas_object_module_register_extension_type (module,
IDE_TYPE_SYMBOL_RESOLVER,
- RUST_TYPE_ANALYZER_SYMBOL_RESOLVER);
+ GBP_TYPE_RUST_ANALYZER_SYMBOL_RESOLVER);
peas_object_module_register_extension_type (module,
IDE_TYPE_DIAGNOSTIC_PROVIDER,
- RUST_TYPE_ANALYZER_DIAGNOSTIC_PROVIDER);
+ GBP_TYPE_RUST_ANALYZER_DIAGNOSTIC_PROVIDER);
peas_object_module_register_extension_type (module,
IDE_TYPE_FORMATTER,
- RUST_TYPE_ANALYZER_FORMATTER);
+ GBP_TYPE_RUST_ANALYZER_FORMATTER);
peas_object_module_register_extension_type (module,
IDE_TYPE_HIGHLIGHTER,
- RUST_TYPE_ANALYZER_HIGHLIGHTER);
+ GBP_TYPE_RUST_ANALYZER_HIGHLIGHTER);
peas_object_module_register_extension_type (module,
GTK_SOURCE_TYPE_HOVER_PROVIDER,
- RUST_TYPE_ANALYZER_HOVER_PROVIDER);
+ GBP_TYPE_RUST_ANALYZER_HOVER_PROVIDER);
peas_object_module_register_extension_type (module,
IDE_TYPE_RENAME_PROVIDER,
- RUST_TYPE_ANALYZER_RENAME_PROVIDER);
+ GBP_TYPE_RUST_ANALYZER_RENAME_PROVIDER);
peas_object_module_register_extension_type (module,
IDE_TYPE_SEARCH_PROVIDER,
- RUST_TYPE_ANALYZER_SEARCH_PROVIDER);
+ GBP_TYPE_RUST_ANALYZER_SEARCH_PROVIDER);
peas_object_module_register_extension_type (module,
IDE_TYPE_CODE_ACTION_PROVIDER,
- RUST_TYPE_ANALYZER_CODE_ACTION_PROVIDER);
+ GBP_TYPE_RUST_ANALYZER_CODE_ACTION_PROVIDER);
peas_object_module_register_extension_type (module,
IDE_TYPE_TWEAKS_ADDIN,
- RUST_TYPE_ANALYZER_TWEAKS_ADDIN);
+ GBP_TYPE_RUST_ANALYZER_TWEAKS_ADDIN);
}
diff --git a/src/plugins/rust-analyzer/rust-analyzer.plugin b/src/plugins/rust-analyzer/rust-analyzer.plugin
index ef9dc55d3..ce5517576 100644
--- a/src/plugins/rust-analyzer/rust-analyzer.plugin
+++ b/src/plugins/rust-analyzer/rust-analyzer.plugin
@@ -5,7 +5,7 @@ Copyright=Copyright © 2020 Günther Wagner
Depends=buildui;
Description=Provides integration with the rust-analyzer language server
Module=rust-analyzer
-Embedded=_rust_analyzer_register_types
+Embedded=_gbp_rust_analyzer_register_types
Name=Rust Language Server
X-Category=lsps
X-Code-Action-Languages=rust
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]