The Nix grammar package imports @codemirror/autocomplete at the top level for its keyword snippets, but only declares it as a peer dependency. electron-builder packs node_modules by walking declared production dependencies, so it omitted the package from app.asar and the desktop daemon died on startup with ERR_MODULE_NOT_FOUND. Dev and CI never saw it because the workspace hoists everything. This is the same failure that just shipped for Svelte, and the previous fix removed @codemirror/autocomplete on the assumption Svelte was its only consumer. Vendoring both remaining grammars removes the class of bug rather than the current instance: these packages are interactive editor extensions, so importing one drags a DOM editor runtime into a headless token highlighter. The vendored language modules keep upstream's indent and fold props. The web file editor consumes getLanguageForFile().extension, so dropping them would have silently degraded editing for .nix and .cs. The new dependency-closure test replicates electron-builder's traversal statically and would have failed both PRs. It is scoped to @getpaseo/highlight because that tree is small and pure; the same walk over the server tree is dominated by false positives from optional dependencies loaded behind try/catch.
25 lines
910 B
TypeScript
25 lines
910 B
TypeScript
import { styleTags, tags as t } from "@lezer/highlight";
|
|
|
|
export const csharpHighlighting = styleTags({
|
|
"Keyword ContextualKeyword SimpleType": t.keyword,
|
|
"NullLiteral BooleanLiteral": t.bool,
|
|
IntegerLiteral: t.integer,
|
|
RealLiteral: t.float,
|
|
'StringLiteral CharacterLiteral InterpolatedRegularString InterpolatedVerbatimString $" @$" $@"':
|
|
t.string,
|
|
"LineComment BlockComment": t.comment,
|
|
". .. : Astrisk Slash % + - ++ -- Not ~ << & | ^ && || < > <= >= == NotEq = += -= *= SlashEq %= &= |= ^= ? ?? ??= =>":
|
|
t.operator,
|
|
PP_Directive: t.keyword,
|
|
TypeIdentifier: t.typeName,
|
|
"ArgumentName AttrsNamedArg": t.variableName,
|
|
ConstName: t.constant(t.variableName),
|
|
MethodName: t.function(t.variableName),
|
|
ParamName: [t.emphasis, t.variableName],
|
|
VarName: t.variableName,
|
|
"FieldName PropertyName": t.propertyName,
|
|
"( )": t.paren,
|
|
"{ }": t.brace,
|
|
"[ ]": t.squareBracket,
|
|
});
|