Put plain text last in the snippet format order, and make a language earn a snippet - #105
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Salesis a DAX table expression and a KQL query, so with plain text last a one-word note would have become code. Each engine gainsLooksLike: 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.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