mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-03 17:58:17 +00:00
dev: filter settable parameter if is in set context (#857)
This commit is contained in:
parent
e95e4284b1
commit
37ea3b8d3d
3 changed files with 40 additions and 4 deletions
|
@ -223,10 +223,6 @@ impl<'a> PostTypeChecker<'a> {
|
|||
log::debug!("post check call sig: {target:?} {sig:?}");
|
||||
let mut resp = SignatureReceiver::default();
|
||||
|
||||
// if set && !param.attrs.settable {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
match &target {
|
||||
ParamTarget::Named(n) => {
|
||||
let ident = n.cast::<ast::Ident>()?.into();
|
||||
|
@ -256,6 +252,10 @@ impl<'a> PostTypeChecker<'a> {
|
|||
|
||||
// names
|
||||
for field in sig.primary().named() {
|
||||
if is_set && !field.attrs.settable {
|
||||
continue;
|
||||
}
|
||||
|
||||
resp.insert(Ty::Param(field.clone()), false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
/// contains: body, fill
|
||||
#set text(/* range 0..1 */ )
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: Completion on / (35..36)
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/set_param.typ
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": [
|
||||
{
|
||||
"kind": 5,
|
||||
"label": "fill",
|
||||
"labelDetails": {
|
||||
"description": "color"
|
||||
},
|
||||
"sortText": "010",
|
||||
"textEdit": {
|
||||
"newText": "fill: ${1:}",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 10,
|
||||
"line": 1
|
||||
},
|
||||
"start": {
|
||||
"character": 10,
|
||||
"line": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue