[gnome-builder] rust: implement buffer reformatting for Rust



commit 5eb206ab8aebc73929955709701d866c8500483e
Author: Christian Hergert <chergert redhat com>
Date:   Thu Mar 30 18:56:02 2017 -0600

    rust: implement buffer reformatting for Rust
    
    This will use rls to reformat the text buffer. Currently, only Vim has a
    keybinding for this (gq).

 plugins/rust-langserv/rust-langserv.plugin    |    1 +
 plugins/rust-langserv/rust_langserv_plugin.py |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/plugins/rust-langserv/rust-langserv.plugin b/plugins/rust-langserv/rust-langserv.plugin
index 141403b..5092d86 100644
--- a/plugins/rust-langserv/rust-langserv.plugin
+++ b/plugins/rust-langserv/rust-langserv.plugin
@@ -8,6 +8,7 @@ Copyright=Copyright © 2016 Christian Hergert
 Builtin=true
 X-Completion-Provider-Languages=rust
 X-Diagnostic-Provider-Languages=rust
+X-Formatter-Languages=rust
 X-Highlighter-Languages=rust
 X-Rename-Provider-Languages=rust
 X-Symbol-Resolver-Languages=rust
diff --git a/plugins/rust-langserv/rust_langserv_plugin.py b/plugins/rust-langserv/rust_langserv_plugin.py
index 4955534..7d7ea34 100644
--- a/plugins/rust-langserv/rust_langserv_plugin.py
+++ b/plugins/rust-langserv/rust_langserv_plugin.py
@@ -188,3 +188,7 @@ class RustSymbolResolver(Ide.LangservSymbolResolver):
 class RustHighlighter(Ide.LangservHighlighter):
     def do_load(self):
         RustService.bind_client(self)
+
+class RustFormatter(Ide.LangservFormatter):
+    def do_load(self):
+        RustService.bind_client(self)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]