fix(completion): stop offering status once its quote is closed
The pattern's trailing optional quote let a complete `status = "x"` match, so the popup reopened after the closing quote. Drop it so the match ends with the value, while still typing remains supported.
This commit is contained in:
@@ -63,8 +63,8 @@ export function getCompletions(
|
||||
const lineStart = source.lastIndexOf("\n", caret - 1) + 1
|
||||
const linePrefix = source.slice(lineStart, caret)
|
||||
|
||||
// ── value: status = "<here>" ──────────────────────────────────────────────
|
||||
const status = /^(\s*status\s*=\s*)"?([A-Za-z-]*)"?$/.exec(linePrefix)
|
||||
// ── value: status = "<here>" — while typing, not once the quote is closed ──
|
||||
const status = /^(\s*status\s*=\s*)"?([A-Za-z-]*)$/.exec(linePrefix)
|
||||
if (status) {
|
||||
const items = filter(
|
||||
STATUSES.map((s) => ({ label: s, insert: `"${s}"` })),
|
||||
|
||||
Reference in New Issue
Block a user