feat: align grammar, snippets, and diagnostics with upstream Sigil #1
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/v0.2.0-syntax-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Catch the extension up to the current Sigil language. Adds grammar support for keywords/types/operators/decorators added upstream, expands snippets, hardens diagnostics parsing, and splits declaration keywords from their bindings so they render distinctly in color themes like Catppuccin.
Grammar (
syntaxes/sigil.tmLanguage.json)New syntax
b'...'..and..=int32(x),float64(x), … (with lookbehind so.method()calls aren't misclassified)@decorator operatorlinear,affine,count,at_leastSelf,None,Object,CallablePerson,Calculator,Result,Option,Union, …) render in the same color asNoneNew keywords
class,record,protocol,enum,struct,union,effect,module,fn/functionvar,live,global,local,async,reloadableawait,yield,defer,errdefer,raise,throw,catch,finally,assert,goto,handle,using,perform,resume,abort,untilregion,alloc,to_heap,to_region,migrate,literalmacro,quote,case,comptimeMath unicode aliases
∈,∧,∨,¬,∃,∀(in addition to existingλ/Λ)Visual fixes (theme parity)
let/const→keyword.declaration(wasvariable.other.assignment, uncolored in Catppuccin)fn/function→keyword.declaration(was insideentity.name.function, same color issue)class/record/protocol/enum/struct/union/effect/module→keyword.declarationentity.name.variable,entity.name.function,entity.name.type)support.typeInternal
0..10) tokenize correctlyentity.name.type.classconsolidated intoentity.name.type+ lookbehindstorage.modifierto drop keywords now handled bykeyword.declarationSnippets (
snippets/sigil.json)18 new:
match,matchexpr,try,tryexpr,import,importas,from,pubfn,decorator,lambda_kw,lambda_typed,record,protocol,enum,struct,union,effect,range,rangei,assert.Language config (
language-configuration.json)catchadded todecreaseIndentPatternonEnterRulesforcatch/finally(outdent)Diagnostics (
src/extension.ts,package.json)infoandhint(compiler can now emit non-error severities)test:grammarscript (.mjs→.cjs)0.1.0→0.2.0Housekeeping
.gitignore: droppedbun.lock(unused) andpackage-lock.json(npm-based project; lockfile should be tracked)