Repository navigation
fix: honor completion snippet support capability - #1346
Shubham-Padkonde wants to merge 3 commits into
Conversation
Assisted-by: Codex/GPT-6 Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
datho7561
left a comment
There was a problem hiding this comment.
It looks like vscode-snippet-parser is unmaintained (no commits in 9 years). Also, it's not published by the VS Code team, but a seemingly by unmaintained project called onivim. As a result, I don't like adding it as a dependency.
I think this approach in general isn't great, since it's removing the tab stops after the fact rather than avoiding putting them in in the first place. I think the implementation could be much simpler if we wrapped each time we add a tab stop with an if/else. It seems like all the tab stops are added in getInsertTextForGuessedValue or getInsertTextForProperty. Also, we have the helper method this.evaluateTab1Symbol available that can be used to substitute the tab stop with the default value assigned for the tab stop if we want to go the route of pre-evaluating each tab stop.
Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
|
Updated this branch at Validation on Windows / Node 24.15.0: The earlier request to remove CI update: run 41615294245 is awaiting maintainer approval for |
What does this PR do?
Honor
textDocument.completion.completionItem.snippetSupport. When it is missing or false, generate plain-text completions using schema defaults without tab stops or snippet escaping. Preserve literal dollar signs. Snippet-capable clients retain placeholders and choices, and schemadefaultSnippetsremain limited to those clients.Expose the capability in the public type and
LATESTconstant and document the behavior. Following review, generate plain text at insertion points; novscode-snippet-parserdependency is added.The latest update merges main
7e8061c, preserving its nullable-string-default fix and adapting the capability tests to ESM andnode:test. Four added cases cover required nullable defaults with snippet support both enabled and disabled.What issues does this PR fix or reference?
Fixes #161.
Is it tested? How?
At
0265353, on Windows / Node 24.15.0 / npm 12.0.2:npm run build: passes clean, ESLint and TypeScript compilation.npm test: 1,407 passed, one skipped, zero failed across 306 suites, including all 18 capability regressions and upstream nullable-default cases.git diff --check: passes; the merge has no unresolved paths.This is the full repository test command on Windows. No editor-integration run or local macOS/Linux matrix is claimed. Hosted checks for the new commit are separate and must still complete.
AI assistance: Codex prepared the implementation/review follow-ups, conflict recovery, tests and this description. The contributor personally reviewed this recovery update and certified the DCO before publication; no personal execution of the automated tests is claimed.