Skip to content

VS Code panel fixes and copy controls (0.7.0), with the core changes they need - #19

Merged
rahulmahadik merged 4 commits into
mainfrom
develop
Aug 8, 2026
Merged

VS Code panel fixes and copy controls (0.7.0), with the core changes they need#19
rahulmahadik merged 4 commits into
mainfrom
develop

Conversation

@rahulmahadik

@rahulmahadik rahulmahadik commented Aug 8, 2026

Copy link
Copy Markdown
Owner

VS Code extension 0.7.0, plus the @asksql/core changes it depends on.

The core commit is here because src/engine.ts imports resolveMongoGuardPolicy from
@asksql/core/mongo; splitting them left the extension importing an export that did not exist yet.
The npm packages publish from their own v* tag, so this PR lands the code only.

VS Code, fixed

Cancel left the panel unusable. Stopping a turn cleared the in-flight state only when the engine
unwound, so the composer stayed locked and the button dead for as long as that took. A late event
from the abandoned turn could also paint into the turn that replaced it.

Result-store errors landed in the wrong turn. An error about a result no longer in memory was
handled as a general error, which deleted the live turn's progress row, rendered its query in the
wrong place, and put the message under the wrong question.

Plan progress and turn progress deleted each other. With approval on, asking for a query plan
during the pause left whichever lost the race looking stalled.

Fenced code had no CSS rule at all, so it was unstyled and a long line scrolled the whole
transcript sideways.

The row-limit notice named the raw setting rather than the cap actually applied.

VS Code, added

Copy controls on the query, the explanation, a schema answer, a corrected query and each fenced
block, each confirming only once the host reports the clipboard was written. A corrected query can
be run directly; it re-enters through the normal ask path, so the guard and approval still apply.

Core

The MongoDB row cap was never clamped. A maxRows that was fractional, zero or negative went
straight into $limit, which MongoDB rejects outright, so the query failed rather than returning
fewer rows. Above the ceiling it was injected unclamped while the warning named the capped number.
Both engines now resolve through one shared function.

The grounding floor treated anything in backticks as an identifier, so `?`, a date or
:param were reported as names missing from the schema.

The adapters peer-depend on core rather than depending on it. A consumer pinned to a different
core got a second copy under the adapter, so instanceof AskSqlError silently returned false. The
range is >= and not ^, because a caret on a 0.x package excludes the next minor and would
major-bump every adapter on a core release. A committed test packs a real tarball and asserts npm
reports ERESOLVE instead of installing a second copy.

Note the trade-off: yarn and legacy-peer-deps do not auto-install peers, so installing an adapter
alone now fails there. The documented npm i @asksql/core @asksql/<adapter> is unaffected, and each
adapter README says so.

Tests

1730 passing across core, vscode and the shared tests. VS Code typecheck clean.

Cancel cleared the in-flight state only when the engine unwound, so the
composer stayed locked and the button dead for as long as that took. A late
event from the abandoned turn could also paint into the turn that replaced it.

An error about a result no longer held in memory was handled as a general
error: it deleted the live turn's progress row, rendered its query in the
wrong place, and put the message under the wrong question. Those errors now
carry the id of the result whose button was clicked and land in that turn.

Copy controls on the query, the explanation, a schema answer, a corrected
query and each fenced block, each confirming only once the host reports the
clipboard was written. A corrected query can be run directly; it re-enters
through the normal ask path, so the guard and the approval step still apply.

Fenced code had no CSS rule at all, which left it unstyled and made a long
line scroll the whole transcript sideways. The automatic row-limit notice
names the cap the engine applied rather than the raw setting, which could be
above the ceiling or fractional.
… names

A maxRows that was fractional, zero or negative went straight into $limit,
which MongoDB rejects outright, so the query failed rather than returning
fewer rows. Above the ceiling it was injected unclamped while the surrounding
warning named the capped number. Both engines now resolve the cap through one
shared function, so the prompt, the injected limit and the warning agree.

The grounding floor treated anything in backticks as an identifier, so `?`,
a date, or `:param` were reported as names missing from the schema. Hyphens
are legal inside backticks and are still checked.

The adapters peer-depend on @asksql/core rather than depending on it. A
consumer pinned to a different core got a second copy installed under the
adapter, so instanceof AskSqlError silently returned false for them. The
range is >= and not ^: a caret on a 0.x package excludes the next minor,
which would major-bump every adapter on a core release.
@rahulmahadik rahulmahadik changed the title Free the VS Code panel after Cancel, and make answers copyable (0.7.0) VS Code panel fixes and copy controls (0.7.0), with the core changes they need Aug 8, 2026
A regular dependency let npm install a second copy of core under the adapter
whenever the consumer pinned a different version, and instanceof AskSqlError
then returned false for them. Only a peer makes npm resolve one shared core.

The range is >= rather than ^: a caret on a 0.x package excludes the next
minor, and with onlyUpdatePeerDependentsWhenOutOfRange a core minor would
then major-bump all nine.

yarn and legacy-peer-deps do not auto-install peers, so installing an adapter
on its own now fails there. Each README names core in the install line and
says so.

React gains copy controls on prose and the result grid, streamed output while
a local model works, cell tooltips, export feedback, and a fix for the red
error shown while a schema answer was still being written.
@rahulmahadik
rahulmahadik merged commit 58198f2 into main Aug 8, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant