diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/code/src/server.ts | 5 | ||||
-rw-r--r-- | editors/emacs/ra.el | 41 |
2 files changed, 45 insertions, 1 deletions
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts index a7a22fa6f..75e273f37 100644 --- a/editors/code/src/server.ts +++ b/editors/code/src/server.ts | |||
@@ -20,7 +20,10 @@ export class Server { | |||
20 | debug: run | 20 | debug: run |
21 | }; | 21 | }; |
22 | const clientOptions: lc.LanguageClientOptions = { | 22 | const clientOptions: lc.LanguageClientOptions = { |
23 | documentSelector: [{ scheme: 'file', language: 'rust' }] | 23 | documentSelector: [{ scheme: 'file', language: 'rust' }], |
24 | initializationOptions: { | ||
25 | publishDecorations: true, | ||
26 | } | ||
24 | }; | 27 | }; |
25 | 28 | ||
26 | Server.client = new lc.LanguageClient( | 29 | Server.client = new lc.LanguageClient( |
diff --git a/editors/emacs/ra.el b/editors/emacs/ra.el index 099f611be..fb73451c1 100644 --- a/editors/emacs/ra.el +++ b/editors/emacs/ra.el | |||
@@ -83,5 +83,46 @@ | |||
83 | "Set selections cache for current buffer state and START END." | 83 | "Set selections cache for current buffer state and START END." |
84 | (setq ra--selections-cache `(,(buffer-modified-tick) 0 ,(ra--selections start end)))) | 84 | (setq ra--selections-cache `(,(buffer-modified-tick) 0 ,(ra--selections start end)))) |
85 | 85 | ||
86 | |||
87 | (require 'eglot) | ||
88 | (require 'ivy) | ||
89 | (require 'counsel) | ||
90 | |||
91 | |||
92 | (defun workspace-symbols () | ||
93 | (interactive) | ||
94 | (let ((buf (current-buffer))) | ||
95 | (ivy-read "Symbol name: " | ||
96 | (lambda (str) | ||
97 | (with-current-buffer buf | ||
98 | (let ((backend (eglot-xref-backend))) | ||
99 | (mapcar | ||
100 | (lambda (xref) | ||
101 | (let ((loc (xref-item-location xref))) | ||
102 | (propertize | ||
103 | (concat | ||
104 | (when (xref-file-location-p loc) | ||
105 | (with-slots (file line column) loc | ||
106 | (format "%s:%s:%s:" | ||
107 | (propertize (file-relative-name file) | ||
108 | 'face 'compilation-info) | ||
109 | (propertize (format "%s" line) | ||
110 | 'face 'compilation-line | ||
111 | ) | ||
112 | column))) | ||
113 | (xref-item-summary xref)) | ||
114 | 'xref xref))) | ||
115 | (xref-backend-apropos backend str)) | ||
116 | ))) | ||
117 | :dynamic-collection t | ||
118 | :action (lambda (item) | ||
119 | (xref--pop-to-location (get-text-property 0 'xref item)))))) | ||
120 | |||
121 | (add-to-list 'eglot-server-programs '(rust-mode . ("ra_lsp_server"))) | ||
122 | |||
123 | ; (require 'rust-mode) | ||
124 | ; (define-key rust-mode-map (kbd "C-n") 'workspace-symbols) | ||
125 | |||
126 | (define-key) | ||
86 | (provide 'ra) | 127 | (provide 'ra) |
87 | ;;; ra.el ends here | 128 | ;;; ra.el ends here |