mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-24 13:13:43 +00:00
feat: enrich all type completions consistently (#964)
This commit is contained in:
parent
0464af6acf
commit
a54bc5d80c
2 changed files with 8 additions and 9 deletions
|
@ -17,7 +17,7 @@ snapshot_kind: text
|
|||
},
|
||||
"sortText": "173",
|
||||
"textEdit": {
|
||||
"newText": "raw(${1:})",
|
||||
"newText": " raw(${1:})",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 10,
|
||||
|
@ -38,7 +38,7 @@ snapshot_kind: text
|
|||
},
|
||||
"sortText": "174",
|
||||
"textEdit": {
|
||||
"newText": "raw.with(${1:})",
|
||||
"newText": " raw.with(${1:})",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 10,
|
||||
|
@ -59,7 +59,7 @@ snapshot_kind: text
|
|||
},
|
||||
"sortText": "175",
|
||||
"textEdit": {
|
||||
"newText": "read(${1:})",
|
||||
"newText": " read(${1:})",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 10,
|
||||
|
@ -80,7 +80,7 @@ snapshot_kind: text
|
|||
},
|
||||
"sortText": "176",
|
||||
"textEdit": {
|
||||
"newText": "read.with(${1:})",
|
||||
"newText": " read.with(${1:})",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 10,
|
||||
|
@ -98,7 +98,7 @@ snapshot_kind: text
|
|||
"label": "replacement",
|
||||
"sortText": "187",
|
||||
"textEdit": {
|
||||
"newText": "[${1:content}]",
|
||||
"newText": " [${1:content}]",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 10,
|
||||
|
|
|
@ -1412,10 +1412,6 @@ pub(crate) fn complete_type(ctx: &mut CompletionContext) -> Option<()> {
|
|||
type_completion(ctx, &ty, None);
|
||||
}
|
||||
|
||||
if ctx.before.ends_with(',') || ctx.before.ends_with(':') {
|
||||
ctx.enrich(" ", "");
|
||||
}
|
||||
|
||||
let mut completions = std::mem::take(&mut ctx.completions);
|
||||
let explicit = ctx.explicit;
|
||||
ctx.explicit = true;
|
||||
|
@ -1526,6 +1522,9 @@ pub(crate) fn complete_type(ctx: &mut CompletionContext) -> Option<()> {
|
|||
}
|
||||
}
|
||||
|
||||
if ctx.before.ends_with(',') || ctx.before.ends_with(':') {
|
||||
ctx.enrich(" ", "");
|
||||
}
|
||||
match scope {
|
||||
SurroundingSyntax::Regular => {}
|
||||
SurroundingSyntax::ImportList => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue