feat: prefer to guide coding by signature help (#874)

* feat: prefer to guide coding by signature help

* test: update markdown description

* test: update configuration for testing
This commit is contained in:
Myriad-Dreamin 2024-11-21 13:14:58 +08:00 committed by GitHub
parent 1ba6b6c1e0
commit 67e659a878
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 102 additions and 38 deletions

View file

@ -58,6 +58,15 @@ impl StatefulRequest for CompletionRequest {
ctx: &mut LocalContext,
doc: Option<VersionedDocument>,
) -> Option<Self::Response> {
// These trigger characters are for completion on positional arguments,
// which follows the configuration item
// `tinymist.completion.triggerOnSnippetPlaceholders`.
if matches!(self.trigger_character, Some('(' | ',' | ':'))
&& !ctx.analysis.completion_feat.trigger_on_snippet_placeholders
{
return None;
}
let doc = doc.as_ref().map(|doc| doc.document.as_ref());
let source = ctx.source_by_path(&self.path).ok()?;
let (cursor, deref_target) = ctx.deref_syntax_at_(&source, self.position, 0)?;