diff --git a/crates/tinymist-query/src/completion.rs b/crates/tinymist-query/src/completion.rs index b6dadc4f..a8178045 100644 --- a/crates/tinymist-query/src/completion.rs +++ b/crates/tinymist-query/src/completion.rs @@ -16,9 +16,7 @@ impl CompletionRequest { ) -> Option { let doc = doc.as_deref(); let source = get_suitable_source_in_workspace(world, &self.path).ok()?; - let offset = lsp_to_typst::position(self.position, position_encoding, &source)?; - // the typst's cursor is 1-based, so we need to add 1 to the offset - let cursor = offset + 1; + let cursor = lsp_to_typst::position(self.position, position_encoding, &source)?; let (offset, completions) = typst_ide::autocomplete(world, doc, &source, cursor, self.explicit)?;