From 3e5f24a9d5cec26697a75e515bff46de418b32da Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Wed, 14 Apr 2021 15:30:15 +0900 Subject: lsp: support both utf-8 and utf-16 offsets. Still need to implement the clangd encoding negotiation, but it's a start. Should also manually override to utf8 for pyls. --- helix-term/src/ui/editor.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'helix-term/src/ui/editor.rs') diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 8879612c..227ccdaa 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -517,10 +517,11 @@ impl EditorView { pub fn set_completion( &mut self, items: Vec, + offset_encoding: helix_lsp::OffsetEncoding, trigger_offset: usize, size: Rect, ) { - let mut completion = Completion::new(items, trigger_offset); + let mut completion = Completion::new(items, offset_encoding, trigger_offset); // TODO : propagate required size on resize to completion too completion.required_size((size.width, size.height)); self.completion = Some(completion); -- cgit v1.2.3-70-g09d2