Skip to content

Put plain text last in the snippet format order, and make a language earn a snippet - #105

Merged
marcosqlbi merged 3 commits into
mainfrom
feature/snippet-order-text-last
Sep 6, 2026
Merged

Put plain text last in the snippet format order, and make a language earn a snippet#105
marcosqlbi merged 3 commits into
mainfrom
feature/snippet-order-text-last

Conversation

@marcosqlbi

Copy link
Copy Markdown
Collaborator

Why

Snippet format order decides which language a paste becomes: the first that accepts the text wins, and plain text accepts everything. With plain text first, the shipped default since 1.0, every paste was a note until someone found the setting, and a language added by an update (KQL in #103) joined the end of the list, behind plain text, and never applied. The goal is that a new language works on the day it ships, with no visit to Preferences. Decision 28 records the reasoning, including why the checkbox that was considered was not added.

What changes

  • The default order is DAX, SQL, KQL, Plain text.
  • Upgrades. A saved order equal to a default the application ever shipped (plain text first, with or without KQL) was never chosen by anyone and takes the new default once, keyed on the settings version moving to 16. A chosen order is kept, and a language it does not know joins it in front of plain text wherever plain text sits; only an order that starts with plain text, which means "keep my pastes plain", gets new languages last.
  • A language must earn a snippet. Every parser accepts a bare name or a number: Sales is a DAX table expression and a KQL query, so with plain text last a one-word note would have become code. Each engine gains LooksLike: DAX needs a function, operator, keyword, column reference, or variable; T-SQL a keyword or function; KQL a pipe, query operator, keyword, command, or function. The parser still decides after the signal.
  • Preferences text, README, the guide, and the 1.3.0 release notes say how it works now.

Tests

Smoke tests cover the new default, insertion in front of plain text, the plain-first exception, the version-15 migration of both shipped defaults, a customized version-15 order kept, a version-16 plain-first order left alone, and the three gates with bare words, numbers, prose, and real snippets.

Not to be merged yet.

🤖 Generated with Claude Code

marcosqlbi and others added 3 commits September 6, 2026 05:49
…earn a snippet

With plain text first, the default since 1.0, every paste was a note
until someone found the setting, and a language added by an update
joined the list behind plain text and never applied. The default is now
DAX, SQL, KQL, Plain text. A saved order equal to a default the
application ever shipped was never chosen, so an upgrade replaces it; a
chosen order is kept, and a language it does not know joins in front of
plain text unless plain text is first, the one order that means "keep
my pastes plain".

What makes that safe: every parser accepts a bare name or a number, so
"Sales" would have become DAX. A language now claims a snippet only
when it carries a signal of its own: a function, operator, keyword,
column reference, or variable for DAX; a keyword or function for T-SQL;
a pipe, query operator, keyword, command, or function for KQL. The
parser still has the last word after the signal.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@marcosqlbi
marcosqlbi merged commit 2de3258 into main Sep 6, 2026
5 checks passed
@marcosqlbi
marcosqlbi deleted the feature/snippet-order-text-last branch September 6, 2026 04:08
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