feat: complete parameters on user functions (#148)

* fix: skip tabs that have no uris for reopening pdf

* dev: lift call analysis

* feat: complete parameters on user functions
This commit is contained in:
Myriad-Dreamin 2024-04-02 17:12:20 +08:00 committed by GitHub
parent 631f6e288c
commit d708bdfe2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 605 additions and 611 deletions

View file

@ -6,7 +6,7 @@ use crate::{
prelude::*,
syntax::{get_deref_target, DerefTarget},
typst_to_lsp::completion_kind,
upstream::{autocomplete_, Completion, CompletionContext, CompletionKind},
upstream::{autocomplete, Completion, CompletionContext, CompletionKind},
LspCompletion, StatefulRequest,
};
@ -111,8 +111,8 @@ impl StatefulRequest for CompletionRequest {
}
let items = completion_result.or_else(|| {
let cc_ctx = CompletionContext::new(ctx.world(), doc, &source, cursor, explicit)?;
let (offset, mut completions) = autocomplete_(cc_ctx)?;
let cc_ctx = CompletionContext::new(ctx, doc, &source, cursor, explicit)?;
let (offset, mut completions) = autocomplete(cc_ctx)?;
let replace_range;
if match_ident.as_ref().is_some_and(|i| i.offset() == offset) {