diff --git a/lang/source.abl.js b/lang/source.abl.js index 9cf34d5..7e10a09 100644 --- a/lang/source.abl.js +++ b/lang/source.abl.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.p', '.cls', '.w'], + extensions: ['.w'], names: ['openedge-abl', 'progress', 'openedge', 'abl'], patterns: [{include: '#procedure-definition'}, {include: '#statements'}], repository: { diff --git a/lang/source.ada.js b/lang/source.ada.js index a9e3581..add5153 100644 --- a/lang/source.ada.js +++ b/lang/source.ada.js @@ -3,7 +3,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.adb', '.ada', '.ads'], + extensions: ['.ada', '.ads'], + extensionsWithDot: ['.adb'], names: ['ada', 'ada95', 'ada2005'], patterns: [ { diff --git a/lang/source.angelscript.js b/lang/source.angelscript.js index e1f0674..4433296 100644 --- a/lang/source.angelscript.js +++ b/lang/source.angelscript.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.as', '.angelscript'], + extensions: ['.angelscript'], names: ['angelscript'], patterns: [ { diff --git a/lang/source.assembly.js b/lang/source.assembly.js index 1815061..d2f7689 100644 --- a/lang/source.assembly.js +++ b/lang/source.assembly.js @@ -5,7 +5,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.asm', '.a51', '.i', '.inc', '.nas', '.nasm'], + extensions: ['.asm', '.a51', '.i', '.nas', '.nasm'], + extensionsWithDot: ['.inc'], names: ['assembly', 'asm', 'nasm'], patterns: [ { diff --git a/lang/source.befunge.js b/lang/source.befunge.js index 5135567..8c649c1 100644 --- a/lang/source.befunge.js +++ b/lang/source.befunge.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.befunge', '.bf'], + extensions: ['.befunge'], names: ['befunge'], patterns: [ {match: '[0-9]', name: 'constant.numberic.bf'}, diff --git a/lang/source.bf.js b/lang/source.bf.js index db61205..08691a4 100644 --- a/lang/source.bf.js +++ b/lang/source.bf.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.b', '.bf'], + extensions: ['.b'], names: ['brainfuck'], patterns: [ {match: '[+-]', name: 'constant.character.modify-value.bf'}, diff --git a/lang/source.brs.js b/lang/source.brs.js index 52e6721..05a80d6 100644 --- a/lang/source.brs.js +++ b/lang/source.brs.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.brs', '.bs'], + extensions: ['.brs'], names: ['brighterscript', 'brightscript'], patterns: [{include: '#entire_language'}], repository: { diff --git a/lang/source.c++.js b/lang/source.c++.js index 4e3e5b0..277515c 100644 --- a/lang/source.c++.js +++ b/lang/source.c++.js @@ -17,13 +17,10 @@ const grammar = { '.cxx', '.edc', '.gml', - '.h', '.h++', '.hh', '.hpp', '.hxx', - '.i', - '.inc', '.inl', '.ino', '.ipp', diff --git a/lang/source.c.js b/lang/source.c.js index 23073a3..d8cfc70 100644 --- a/lang/source.c.js +++ b/lang/source.c.js @@ -8,14 +8,10 @@ const grammar = { extensions: [ '.c', '.cats', - '.cl', - '.d', '.h', '.idc', '.opencl', - '.pm', '.upc', - '.x', '.xbm', '.xpm', '.xs' diff --git a/lang/source.clojure.js b/lang/source.clojure.js index 16993b3..5d1467c 100644 --- a/lang/source.clojure.js +++ b/lang/source.clojure.js @@ -6,7 +6,6 @@ /** @type {import('../lib/index.js').Grammar} */ const grammar = { extensions: [ - '.bb', '.boot', '.cl2', '.clj', diff --git a/lang/source.coffee.js b/lang/source.coffee.js index 80a7e0a..3e25c7e 100644 --- a/lang/source.coffee.js +++ b/lang/source.coffee.js @@ -7,7 +7,6 @@ const grammar = { extensions: [ '._coffee', - '.cake', '.cjsx', '.coffee', '.cson', diff --git a/lang/source.cool.js b/lang/source.cool.js index cb48bbd..bcd6139 100644 --- a/lang/source.cool.js +++ b/lang/source.cool.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.cl'], + extensions: [], names: ['cool'], patterns: [ {match: '--(.*)\\n', name: 'comment.line.double-dash'}, diff --git a/lang/source.coq.js b/lang/source.coq.js index c1103a2..8cf626c 100644 --- a/lang/source.coq.js +++ b/lang/source.coq.js @@ -3,7 +3,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.coq', '.v'], + extensions: ['.coq'], + extensionsWithDot: ['.v'], names: ['coq'], patterns: [ {include: '#multilinecomment'}, diff --git a/lang/source.cuesheet.js b/lang/source.cuesheet.js index dfe8cfb..82c3ae9 100644 --- a/lang/source.cuesheet.js +++ b/lang/source.cuesheet.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.cue'], + extensions: [], names: ['cue-sheet'], patterns: [ { diff --git a/lang/source.denizenscript.js b/lang/source.denizenscript.js index be1bd31..0c38bd2 100644 --- a/lang/source.denizenscript.js +++ b/lang/source.denizenscript.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.dsc'], + extensions: [], names: ['denizenscript'], patterns: [ {include: '#comments'}, diff --git a/lang/source.euphoria.js b/lang/source.euphoria.js index 42de14a..55da9a6 100644 --- a/lang/source.euphoria.js +++ b/lang/source.euphoria.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.e', '.ex'], + extensions: [], names: ['euphoria'], patterns: [ {include: '#comments'}, diff --git a/lang/source.forth.js b/lang/source.forth.js index 2304a6f..abd2feb 100644 --- a/lang/source.forth.js +++ b/lang/source.forth.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.fth', '.4th', '.f', '.for', '.forth', '.fr', '.frt', '.fs'], + extensions: ['.fth', '.4th', '.f', '.for', '.forth', '.fr', '.frt'], names: ['forth'], patterns: [ { diff --git a/lang/source.fortran.js b/lang/source.fortran.js index 7fd9659..2d8b9d6 100644 --- a/lang/source.fortran.js +++ b/lang/source.fortran.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.f', '.f77', '.for', '.fpp'], + extensions: ['.f77', '.fpp'], injections: { 'source.fortran - (source.fortran.modern)': { patterns: [ diff --git a/lang/source.ftl.js b/lang/source.ftl.js index b9cc250..26d8a8c 100644 --- a/lang/source.ftl.js +++ b/lang/source.ftl.js @@ -5,7 +5,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.ftl'], + extensions: [], + extensionsWithDot: ['.ftl'], names: ['fluent'], patterns: [ {include: '#comment'}, diff --git a/lang/source.gap.js b/lang/source.gap.js index 69ff046..087a9be 100644 --- a/lang/source.gap.js +++ b/lang/source.gap.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.g', '.gap', '.gd', '.gi', '.tst'], + extensions: ['.gap', '.gd', '.gi', '.tst'], names: ['gap'], patterns: [ {match: '^\\s*(end|fi|od)$', name: 'invalid.illegal.end-statement.gap'}, diff --git a/lang/source.gdscript.js b/lang/source.gdscript.js index 2b3bfe0..14b6c8b 100644 --- a/lang/source.gdscript.js +++ b/lang/source.gdscript.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.gd'], + extensions: [], names: ['gdscript'], patterns: [ {include: '#nodepath_object'}, diff --git a/lang/source.gerber.js b/lang/source.gerber.js index 51614e5..a2aab93 100644 --- a/lang/source.gerber.js +++ b/lang/source.gerber.js @@ -13,16 +13,15 @@ const grammar = { '.gbp', '.gbs', '.gko', - '.gml', '.gpb', '.gpt', '.gtl', '.gto', '.gtp', '.gts', - '.ncl', '.sol' ], + extensionsWithDot: ['.ncl'], names: ['gerber-image', 'rs-274x'], patterns: [ { diff --git a/lang/source.gfm.js b/lang/source.gfm.js index d05f4c6..9c94710 100644 --- a/lang/source.gfm.js +++ b/lang/source.gfm.js @@ -8,7 +8,6 @@ const grammar = { extensions: [ '.livemd', '.markdown', - '.md', '.mdown', '.mdwn', '.mdx', diff --git a/lang/source.glsl.js b/lang/source.glsl.js index e46e396..e4a7e41 100644 --- a/lang/source.glsl.js +++ b/lang/source.glsl.js @@ -10,7 +10,6 @@ const grammar = { '.fp', '.frag', '.frg', - '.fs', '.fsh', '.fshader', '.geo', diff --git a/lang/source.gosu.2.js b/lang/source.gosu.2.js index 7f8f728..c0b871c 100644 --- a/lang/source.gosu.2.js +++ b/lang/source.gosu.2.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.gs', '.gst', '.gsx', '.vark'], + extensions: ['.gst', '.gsx', '.vark'], names: ['gosu'], patterns: [ {match: '\\b(List|Map)\\b', name: 'support.class.gosu.2'}, diff --git a/lang/source.hack.js b/lang/source.hack.js index 2c71e00..7da1cd3 100644 --- a/lang/source.hack.js +++ b/lang/source.hack.js @@ -5,7 +5,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.hack', '.hh', '.hhi', '.php'], + extensions: ['.hack', '.hhi'], + extensionsWithDot: ['.php'], names: ['hack'], patterns: [{include: 'text.html.basic'}, {include: '#language'}], repository: { diff --git a/lang/source.haskell.js b/lang/source.haskell.js index f59759e..821c9bc 100644 --- a/lang/source.haskell.js +++ b/lang/source.haskell.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.chs', '.dhall', '.fr', '.hs', '.hs-boot', '.hsc'], + extensions: ['.chs', '.dhall', '.hs', '.hs-boot', '.hsc'], names: ['c2hs', 'c2hs-haskell', 'dhall', 'frege', 'haskell'], patterns: [{include: '#haskell_source'}], repository: { diff --git a/lang/source.hql.js b/lang/source.hql.js index aeb1cfd..9a1d847 100644 --- a/lang/source.hql.js +++ b/lang/source.hql.js @@ -3,7 +3,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.q', '.hql'], + extensions: ['.hql'], + extensionsWithDot: ['.q'], names: ['hiveql'], patterns: [ {include: '#comments'}, diff --git a/lang/source.ini.js b/lang/source.ini.js index 1526f00..9897262 100644 --- a/lang/source.ini.js +++ b/lang/source.ini.js @@ -4,7 +4,6 @@ /** @type {import('../lib/index.js').Grammar} */ const grammar = { extensions: [ - '.cfg', '.cnf', '.dof', '.ini', @@ -13,7 +12,6 @@ const grammar = { '.pcbdoc', '.prefs', '.prjpcb', - '.pro', '.properties', '.schdoc', '.url' diff --git a/lang/source.jasmin.js b/lang/source.jasmin.js index 2ba9682..f8f9852 100644 --- a/lang/source.jasmin.js +++ b/lang/source.jasmin.js @@ -3,7 +3,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.j'], + extensions: [], + extensionsWithDot: ['.j'], names: ['jasmin'], patterns: [ {include: '#class-def'}, diff --git a/lang/source.java-properties.js b/lang/source.java-properties.js index bdc428f..f76f4fc 100644 --- a/lang/source.java-properties.js +++ b/lang/source.java-properties.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.properties'], + extensions: [], names: ['java-properties'], patterns: [ {match: '^\\s*$'}, diff --git a/lang/source.jflex.js b/lang/source.jflex.js index fd87594..b8db379 100644 --- a/lang/source.jflex.js +++ b/lang/source.jflex.js @@ -3,7 +3,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.flex', '.jflex'], + extensions: ['.jflex'], + extensionsWithDot: ['.flex'], names: ['jflex'], patterns: [ { diff --git a/lang/source.jq.js b/lang/source.jq.js index 9b5686b..0b3175c 100644 --- a/lang/source.jq.js +++ b/lang/source.jq.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.jq'], + extensions: [], names: ['jq'], patterns: [{include: '#main'}], repository: { diff --git a/lang/source.js.js b/lang/source.js.js index 065b987..2683db7 100644 --- a/lang/source.js.js +++ b/lang/source.js.js @@ -11,10 +11,7 @@ const grammar = { '.cjs', '.code-snippets', '.cy', - '.es', '.es6', - '.frag', - '.gs', '.jake', '.javascript', '.js', @@ -33,7 +30,6 @@ const grammar = { '.mjs', '.njs', '.pac', - '.qs', '.sjs', '.ssjs', '.sublime-build', diff --git a/lang/source.js.objj.js b/lang/source.js.objj.js index bc881e5..e45aa0b 100644 --- a/lang/source.js.objj.js +++ b/lang/source.js.objj.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.j', '.sj'], + extensions: ['.sj'], names: ['objective-j', 'obj-j', 'objectivej', 'objj'], patterns: [ { diff --git a/lang/source.jsoniq.js b/lang/source.jsoniq.js index 5d38e8f..9d5f225 100644 --- a/lang/source.jsoniq.js +++ b/lang/source.jsoniq.js @@ -5,7 +5,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.jq'], + extensions: [], + extensionsWithDot: ['.jq'], names: ['jsoniq'], patterns: [{include: '#main'}], repository: { diff --git a/lang/source.kickstart.js b/lang/source.kickstart.js index eaddf47..c7e0a0d 100644 --- a/lang/source.kickstart.js +++ b/lang/source.kickstart.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.ks'], + extensions: [], names: ['kickstart'], patterns: [ { diff --git a/lang/source.lex.js b/lang/source.lex.js index a3def58..fccdab1 100644 --- a/lang/source.lex.js +++ b/lang/source.lex.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.l', '.lex'], + extensions: ['.lex'], names: ['lex', 'flex'], patterns: [{include: '#main'}], repository: { diff --git a/lang/source.loomscript.js b/lang/source.loomscript.js index 866542e..57a03bc 100644 --- a/lang/source.loomscript.js +++ b/lang/source.loomscript.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.ls'], + extensions: [], names: ['loomscript'], patterns: [ {include: '#comments'}, diff --git a/lang/source.ltspice.symbol.js b/lang/source.ltspice.symbol.js index 7b9ad6e..0f9ea80 100644 --- a/lang/source.ltspice.symbol.js +++ b/lang/source.ltspice.symbol.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.asy'], + extensions: [], names: ['ltspice-symbol'], patterns: [{include: '#main'}], repository: { diff --git a/lang/source.m68k.js b/lang/source.m68k.js index 0338288..2b333e1 100644 --- a/lang/source.m68k.js +++ b/lang/source.m68k.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.asm', '.i', '.inc', '.s', '.x68'], + extensions: ['.s', '.x68'], names: ['motorola-68k-assembly', 'm68k'], patterns: [ {match: '(;|\\B\\*).*$', name: 'comment.m68k'}, diff --git a/lang/source.makefile.js b/lang/source.makefile.js index d76c6e7..700ee62 100644 --- a/lang/source.makefile.js +++ b/lang/source.makefile.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.mak', '.d', '.make', '.makefile', '.mk', '.mkfile'], + extensions: ['.mak', '.make', '.makefile', '.mk', '.mkfile'], names: ['makefile', 'bsdmake', 'make', 'mf'], patterns: [ {include: '#comment'}, diff --git a/lang/source.mathematica.js b/lang/source.mathematica.js index 8702837..2814463 100644 --- a/lang/source.mathematica.js +++ b/lang/source.mathematica.js @@ -8,7 +8,6 @@ const grammar = { extensions: [ '.mathematica', '.cdf', - '.m', '.ma', '.mt', '.nb', diff --git a/lang/source.mc.js b/lang/source.mc.js index a4020f9..eab69c0 100644 --- a/lang/source.mc.js +++ b/lang/source.mc.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.mc'], + extensions: [], names: ['monkey-c'], patterns: [{include: '#statements'}], repository: { diff --git a/lang/source.mercury.js b/lang/source.mercury.js index 08551e6..e906b4b 100644 --- a/lang/source.mercury.js +++ b/lang/source.mercury.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.m', '.moo'], + extensions: ['.moo'], names: ['mercury'], patterns: [ {include: '#number'}, diff --git a/lang/source.miniyaml.js b/lang/source.miniyaml.js index 1460004..f6027c7 100644 --- a/lang/source.miniyaml.js +++ b/lang/source.miniyaml.js @@ -5,7 +5,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.yaml', '.yml'], + extensions: [], + extensionsWithDot: ['.yaml', '.yml'], names: ['miniyaml'], patterns: [{include: '#comment'}, {include: '#node'}], repository: { diff --git a/lang/source.ml.js b/lang/source.ml.js index 3c898ab..e84de1d 100644 --- a/lang/source.ml.js +++ b/lang/source.ml.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.ml', '.fun', '.sig', '.sml'], + extensions: ['.fun', '.sig', '.sml'], names: ['standard-ml', 'sml'], patterns: [ {include: '#comments'}, diff --git a/lang/source.mo.js b/lang/source.mo.js index 9f4b4ef..7acb0ea 100644 --- a/lang/source.mo.js +++ b/lang/source.mo.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.mo'], + extensions: [], names: ['motoko'], patterns: [ {include: '#shebang-line'}, diff --git a/lang/source.modula2.js b/lang/source.modula2.js index 5eea64b..96d4c0a 100644 --- a/lang/source.modula2.js +++ b/lang/source.modula2.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.mod'], + extensions: [], names: ['modula-2'], patterns: [ { diff --git a/lang/source.nasl.js b/lang/source.nasl.js index fe1ab43..5944154 100644 --- a/lang/source.nasl.js +++ b/lang/source.nasl.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.nasl', '.inc'], + extensions: ['.nasl'], names: ['nasl'], patterns: [ {include: '#line_comment'}, diff --git a/lang/source.ncl.js b/lang/source.ncl.js index 8258d81..cd20efb 100644 --- a/lang/source.ncl.js +++ b/lang/source.ncl.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.ncl'], + extensions: [], names: ['ncl'], patterns: [ {match: ';.*$', name: 'comment.line.source.ncl'}, diff --git a/lang/source.nginx.js b/lang/source.nginx.js index 57012c0..945684e 100644 --- a/lang/source.nginx.js +++ b/lang/source.nginx.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.nginx', '.nginxconf', '.vhost'], + extensions: ['.nginx', '.nginxconf'], names: ['nginx', 'nginx-configuration-file'], patterns: [ {match: '\\#.*', name: 'comment.line.number-sign'}, diff --git a/lang/source.objc.js b/lang/source.objc.js index 7958199..8ca6000 100644 --- a/lang/source.objc.js +++ b/lang/source.objc.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.m', '.h'], + extensions: [], names: ['objective-c', 'obj-c', 'objc', 'objectivec'], patterns: [ { diff --git a/lang/source.objectscript.js b/lang/source.objectscript.js index fa9c727..cd040ef 100644 --- a/lang/source.objectscript.js +++ b/lang/source.objectscript.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.cls'], + extensions: [], names: ['objectscript'], patterns: [ {include: '#comments'}, diff --git a/lang/source.odin-ehr.js b/lang/source.odin-ehr.js index b435c49..9e7c8c6 100644 --- a/lang/source.odin-ehr.js +++ b/lang/source.odin-ehr.js @@ -5,7 +5,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.odin'], + extensions: [], + extensionsWithDot: ['.odin'], names: ['object-data-instance-notation'], patterns: [{include: '#main'}], repository: { diff --git a/lang/source.odin.js b/lang/source.odin.js index f35b18e..df1301b 100644 --- a/lang/source.odin.js +++ b/lang/source.odin.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.odin'], + extensions: [], names: ['odin', 'odinlang', 'odin-lang'], patterns: [ {include: '#comments'}, diff --git a/lang/source.pascal.js b/lang/source.pascal.js index 834e8f7..f6ef2da 100644 --- a/lang/source.pascal.js +++ b/lang/source.pascal.js @@ -3,17 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: [ - '.cp', - '.cps', - '.dfm', - '.dpr', - '.inc', - '.lpr', - '.pas', - '.pascal', - '.pp' - ], + extensions: ['.cps', '.dfm', '.dpr', '.lpr', '.pas', '.pascal', '.pp'], names: ['component-pascal', 'delphi', 'objectpascal', 'pascal'], patterns: [ { diff --git a/lang/source.pawn.js b/lang/source.pawn.js index 02a27fb..7dbd06f 100644 --- a/lang/source.pawn.js +++ b/lang/source.pawn.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.pwn', '.inc', '.sma'], + extensions: ['.pwn', '.sma'], names: ['pawn'], patterns: [{include: '#translation_unit'}], repository: { diff --git a/lang/source.pcb.board.js b/lang/source.pcb.board.js index 6ef284a..e377d50 100644 --- a/lang/source.pcb.board.js +++ b/lang/source.pcb.board.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.brd'], + extensions: [], names: ['kicad-legacy-layout'], patterns: [ { diff --git a/lang/source.pcb.schematic.js b/lang/source.pcb.schematic.js index 2401065..0f25fa0 100644 --- a/lang/source.pcb.schematic.js +++ b/lang/source.pcb.schematic.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.kicad_sch', '.sch'], + extensions: ['.kicad_sch'], names: ['kicad-schematic', 'eeschema-schematic'], patterns: [ { diff --git a/lang/source.perl.js b/lang/source.perl.js index 8d7e3c6..e4ef235 100644 --- a/lang/source.perl.js +++ b/lang/source.perl.js @@ -5,18 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: [ - '.pl', - '.al', - '.cgi', - '.fcgi', - '.perl', - '.ph', - '.plx', - '.pm', - '.psgi', - '.t' - ], + extensions: ['.pl', '.cgi', '.perl', '.ph', '.plx', '.pm', '.psgi', '.t'], names: ['perl', 'cperl'], patterns: [ {include: '#line_comment'}, diff --git a/lang/source.pov-ray sdl.js b/lang/source.pov-ray sdl.js index 23cf46c..119b3cd 100644 --- a/lang/source.pov-ray sdl.js +++ b/lang/source.pov-ray sdl.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.pov', '.inc'], + extensions: ['.pov'], names: ['pov-ray-sdl', 'pov-ray', 'povray'], patterns: [ { diff --git a/lang/source.prolog.eclipse.js b/lang/source.prolog.eclipse.js index 27881dd..f391120 100644 --- a/lang/source.prolog.eclipse.js +++ b/lang/source.prolog.eclipse.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.ecl'], + extensions: [], names: ['eclipse'], patterns: [ {include: '#comments'}, diff --git a/lang/source.prolog.js b/lang/source.prolog.js index 92f914a..3846cf1 100644 --- a/lang/source.prolog.js +++ b/lang/source.prolog.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.pl', '.plt', '.pro', '.prolog', '.yap'], + extensions: ['.prolog', '.yap'], names: ['prolog'], patterns: [ {include: '#comments'}, diff --git a/lang/source.puppet.js b/lang/source.puppet.js index 0caef96..77f18e0 100644 --- a/lang/source.puppet.js +++ b/lang/source.puppet.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.pp'], + extensions: [], names: ['puppet'], patterns: [ {include: '#line_comment'}, diff --git a/lang/source.python.js b/lang/source.python.js index 18fc5ae..1f68098 100644 --- a/lang/source.python.js +++ b/lang/source.python.js @@ -7,9 +7,7 @@ const grammar = { extensions: [ '.bzl', - '.cgi', '.eb', - '.fcgi', '.gyp', '.gypi', '.lmi', @@ -26,7 +24,6 @@ const grammar = { '.smk', '.snakefile', '.spec', - '.star', '.tac', '.wsgi', '.xpy', diff --git a/lang/source.q.js b/lang/source.q.js index ef6c576..b365857 100644 --- a/lang/source.q.js +++ b/lang/source.q.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.q'], + extensions: [], names: ['q'], patterns: [ { diff --git a/lang/source.qmake.js b/lang/source.qmake.js index b4b2851..e056c85 100644 --- a/lang/source.qmake.js +++ b/lang/source.qmake.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.pro', '.pri'], + extensions: ['.pri'], names: ['qmake'], patterns: [ { diff --git a/lang/source.raku.js b/lang/source.raku.js index 3a15b83..e2c6724 100644 --- a/lang/source.raku.js +++ b/lang/source.raku.js @@ -12,15 +12,12 @@ const grammar = { '.p6', '.p6l', '.p6m', - '.pl', '.pl6', - '.pm', '.pm6', '.pod', '.pod6', '.raku', - '.rakumod', - '.t' + '.rakumod' ], names: ['perl-6', 'perl6', 'pod-6', 'raku'], patterns: [ diff --git a/lang/source.reason.js b/lang/source.reason.js index e65ced5..ac4b81b 100644 --- a/lang/source.reason.js +++ b/lang/source.reason.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.re', '.rei'], + extensions: ['.rei'], names: ['reason'], patterns: [ {include: '#structure-expression-block-item'}, diff --git a/lang/source.rebol.js b/lang/source.rebol.js index 97c2528..cf46dde 100644 --- a/lang/source.rebol.js +++ b/lang/source.rebol.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.reb', '.r', '.r2', '.r3', '.rebol'], + extensions: ['.reb', '.r2', '.r3', '.rebol'], names: ['rebol'], patterns: [ {include: '#comments'}, diff --git a/lang/source.renpy.js b/lang/source.renpy.js index d5dc2b4..99d9f56 100644 --- a/lang/source.renpy.js +++ b/lang/source.renpy.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.rpy'], + extensions: [], names: ["ren'py", 'renpy'], patterns: [ { diff --git a/lang/source.rpm-spec.js b/lang/source.rpm-spec.js index ca540dc..4f13194 100644 --- a/lang/source.rpm-spec.js +++ b/lang/source.rpm-spec.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.spec'], + extensions: [], names: ['rpm-spec', 'specfile'], patterns: [ {match: '^# norootforbuild', name: 'keyword.rpm-spec'}, diff --git a/lang/source.ruby.js b/lang/source.ruby.js index 105627f..9bb0309 100644 --- a/lang/source.ruby.js +++ b/lang/source.ruby.js @@ -10,7 +10,6 @@ const grammar = { '.druby', '.duby', '.eye', - '.fcgi', '.gemspec', '.god', '.jbuilder', @@ -28,7 +27,6 @@ const grammar = { '.rbx', '.ru', '.ruby', - '.spec', '.thor', '.watchr' ], diff --git a/lang/source.scheme.js b/lang/source.scheme.js index a0389ab..54ab8dc 100644 --- a/lang/source.scheme.js +++ b/lang/source.scheme.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.scm', '.sch', '.sld', '.sls', '.sps', '.ss'], + extensions: ['.scm', '.sld', '.sps', '.ss'], names: ['scheme'], patterns: [ {include: '#comment'}, diff --git a/lang/source.scilab.js b/lang/source.scilab.js index ffde4ce..d1930f5 100644 --- a/lang/source.scilab.js +++ b/lang/source.scilab.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.sci', '.sce', '.tst'], + extensions: ['.sci', '.sce'], names: ['scilab'], patterns: [ { diff --git a/lang/source.shaderlab.js b/lang/source.shaderlab.js index e43dd36..49c6cb6 100644 --- a/lang/source.shaderlab.js +++ b/lang/source.shaderlab.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.shader'], + extensions: [], names: ['shaderlab'], patterns: [ {begin: '//', end: '$', name: 'comment.line.double-slash.shaderlab'}, diff --git a/lang/source.shell.js b/lang/source.shell.js index 28457f9..8c1c3c9 100644 --- a/lang/source.shell.js +++ b/lang/source.shell.js @@ -8,12 +8,10 @@ const grammar = { extensions: [ '.bash', '.bats', - '.cgi', '.command', '.csh', '.ebuild', '.eclass', - '.fcgi', '.ksh', '.sh', '.sh.in', diff --git a/lang/source.slice.js b/lang/source.slice.js index ad70d0d..a62f316 100644 --- a/lang/source.slice.js +++ b/lang/source.slice.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.ice'], + extensions: [], names: ['slice'], patterns: [ {include: '#comment'}, diff --git a/lang/source.smalltalk.js b/lang/source.smalltalk.js index 5f54513..298120e 100644 --- a/lang/source.smalltalk.js +++ b/lang/source.smalltalk.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.cs', '.st', '.ston'], + extensions: ['.st', '.ston'], names: ['smalltalk', 'squeak', 'ston'], patterns: [ {match: '\\b(class)\\b', name: 'storage.type.$1.smalltalk'}, diff --git a/lang/source.solidity.js b/lang/source.solidity.js index e1efba1..300e849 100644 --- a/lang/source.solidity.js +++ b/lang/source.solidity.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.sol'], + extensions: [], names: ['solidity'], patterns: [ { diff --git a/lang/source.sourcepawn.js b/lang/source.sourcepawn.js index 49e3ff8..759076c 100644 --- a/lang/source.sourcepawn.js +++ b/lang/source.sourcepawn.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.sp', '.inc'], + extensions: ['.sp'], names: ['sourcepawn', 'sourcemod'], patterns: [ {include: '#keywords'}, diff --git a/lang/source.sql.js b/lang/source.sql.js index f432e0a..1d3e2e6 100644 --- a/lang/source.sql.js +++ b/lang/source.sql.js @@ -7,7 +7,6 @@ const grammar = { '.cql', '.db2', '.ddl', - '.inc', '.mysql', '.pgsql', '.prc', diff --git a/lang/source.string-template.js b/lang/source.string-template.js index 88eb2a0..efa9c0a 100644 --- a/lang/source.string-template.js +++ b/lang/source.string-template.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.st'], + extensions: [], injections: { 'L:source.string-template meta.document.dollar-delimiters.string-template - comment': {patterns: [{match: '<|>'}, {include: '#main$'}]} diff --git a/lang/source.supercollider.js b/lang/source.supercollider.js index a295169..58bd1af 100644 --- a/lang/source.supercollider.js +++ b/lang/source.supercollider.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.sc', '.scd'], + extensions: [], names: ['supercollider'], patterns: [ { diff --git a/lang/source.terra.js b/lang/source.terra.js index 045bfce..a265c6c 100644 --- a/lang/source.terra.js +++ b/lang/source.terra.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.t'], + extensions: [], names: ['terra'], patterns: [ { diff --git a/lang/source.toc.js b/lang/source.toc.js index f385953..da9eb26 100644 --- a/lang/source.toc.js +++ b/lang/source.toc.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.toc'], + extensions: [], names: ['world-of-warcraft-addon-data'], patterns: [ { diff --git a/lang/source.tsql.js b/lang/source.tsql.js index 816c6ac..9b860ef 100644 --- a/lang/source.tsql.js +++ b/lang/source.tsql.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.sql'], + extensions: [], names: ['tsql'], patterns: [ {match: '((? for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.t', '.tu'], + extensions: ['.tu'], names: ['turing'], patterns: [{include: '#main'}], repository: { diff --git a/lang/source.v.js b/lang/source.v.js index f6f1e80..0af2ed7 100644 --- a/lang/source.v.js +++ b/lang/source.v.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.v'], + extensions: [], names: ['v', 'vlang'], patterns: [ {include: '#comments'}, diff --git a/lang/source.vbnet.js b/lang/source.vbnet.js index bc50740..de9e0f8 100644 --- a/lang/source.vbnet.js +++ b/lang/source.vbnet.js @@ -6,11 +6,7 @@ /** @type {import('../lib/index.js').Grammar} */ const grammar = { extensions: [ - '.bas', - '.bas', '.bi', - '.cls', - '.cls', '.ctl', '.dsr', '.frm', diff --git a/lang/source.verilog.js b/lang/source.verilog.js index d7639d9..c475e8a 100644 --- a/lang/source.verilog.js +++ b/lang/source.verilog.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.v', '.veo'], + extensions: ['.veo'], names: ['verilog'], patterns: [ {include: '#comments'}, diff --git a/lang/source.vim-snippet.js b/lang/source.vim-snippet.js index 8626591..710a825 100644 --- a/lang/source.vim-snippet.js +++ b/lang/source.vim-snippet.js @@ -5,7 +5,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.snip', '.snippet', '.snippets'], + extensions: ['.snip', '.snippets'], + extensionsWithDot: ['.snippet'], names: ['vim-snippet', 'snipmate', 'ultisnip', 'ultisnips', 'neosnippet'], patterns: [{include: '#main'}], repository: { diff --git a/lang/source.viml.js b/lang/source.viml.js index 4d1fa1b..2bf0a22 100644 --- a/lang/source.viml.js +++ b/lang/source.viml.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.vim', '.vba', '.vimrc', '.vmb'], + extensions: ['.vim', '.vimrc', '.vmb'], names: ['vim-script', 'vim', 'viml', 'nvim'], patterns: [ { diff --git a/lang/source.win32-messages.js b/lang/source.win32-messages.js index 5b4cf06..fab04f5 100644 --- a/lang/source.win32-messages.js +++ b/lang/source.win32-messages.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.mc'], + extensions: [], names: ['win32-message-file'], patterns: [{include: '#main'}], repository: { diff --git a/lang/source.x86.js b/lang/source.x86.js index 311c6b8..0c0e3f8 100644 --- a/lang/source.x86.js +++ b/lang/source.x86.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.s', '.ms'], + extensions: [], names: ['unix-assembly', 'gas', 'gnu-asm', 'unix-asm'], patterns: [ { diff --git a/lang/source.yacc.js b/lang/source.yacc.js index bc4c221..305c0af 100644 --- a/lang/source.yacc.js +++ b/lang/source.yacc.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.bison', '.y', '.yacc', '.yy'], + extensions: ['.bison', '.y', '.yacc'], names: ['bison', 'yacc'], patterns: [{include: '#main'}], repository: { diff --git a/lang/source.yaml.js b/lang/source.yaml.js index 648af29..fbf88fd 100644 --- a/lang/source.yaml.js +++ b/lang/source.yaml.js @@ -10,7 +10,6 @@ const grammar = { '.asset', '.ksy', '.lookml', - '.mask', '.mat', '.meta', '.mir', @@ -23,14 +22,8 @@ const grammar = { '.syntax', '.unity', '.view.lkml', - '.yaml', - '.yaml', - '.yaml', '.yaml-tmlanguage', '.yaml.sed', - '.yml', - '.yml', - '.yml', '.yml.mysql' ], names: [ diff --git a/lang/text.html.asciidoc.js b/lang/text.html.asciidoc.js index 493b194..2d522f8 100644 --- a/lang/text.html.asciidoc.js +++ b/lang/text.html.asciidoc.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.asciidoc', '.adoc', '.asc'], + extensions: ['.asciidoc', '.adoc'], names: ['asciidoc'], patterns: [ {include: '#heading_inline'}, diff --git a/lang/text.html.basic.js b/lang/text.html.basic.js index 583c263..1babec6 100644 --- a/lang/text.html.basic.js +++ b/lang/text.html.basic.js @@ -5,17 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: [ - '.hta', - '.htm', - '.html', - '.html.hl', - '.inc', - '.kit', - '.mtml', - '.xht', - '.xhtml' - ], + extensions: ['.hta', '.htm', '.html.hl', '.kit', '.mtml', '.xht', '.xhtml'], names: ['html', 'kit', 'mtml', 'xhtml'], patterns: [ { diff --git a/lang/text.html.ecmarkup.js b/lang/text.html.ecmarkup.js index c5af609..a1e638e 100644 --- a/lang/text.html.ecmarkup.js +++ b/lang/text.html.ecmarkup.js @@ -5,7 +5,8 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.html'], + extensions: [], + extensionsWithDot: ['.html'], injections: { 'L:(source.embedded.yaml.front-matter.ecmarkup - (comment | embedded))': { patterns: [{include: 'text.html.basic#character-reference'}] diff --git a/lang/text.html.ftl.js b/lang/text.html.ftl.js index cbf6ffa..dfcef3b 100644 --- a/lang/text.html.ftl.js +++ b/lang/text.html.ftl.js @@ -3,7 +3,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.ftl'], + extensions: [], names: ['freemarker', 'ftl'], patterns: [ { diff --git a/lang/text.html.php.js b/lang/text.html.php.js index 592894d..3a942d4 100644 --- a/lang/text.html.php.js +++ b/lang/text.html.php.js @@ -6,9 +6,6 @@ const grammar = { extensions: [ '.aw', '.ctp', - '.fcgi', - '.inc', - '.php', '.php3', '.php4', '.php5', diff --git a/lang/text.roff.js b/lang/text.roff.js index ad8da0e..7174c50 100644 --- a/lang/text.roff.js +++ b/lang/text.roff.js @@ -42,16 +42,12 @@ const grammar = { '.8', '.9', '.9', - '.l', '.man', '.man', '.mdoc', '.mdoc', '.me', - '.ms', - '.n', '.nr', - '.rno', '.roff', '.tmac' ], diff --git a/lang/text.srt.js b/lang/text.srt.js index fd32b5f..7facc1f 100644 --- a/lang/text.srt.js +++ b/lang/text.srt.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.srt'], + extensions: [], names: ['subrip-text'], patterns: [{include: '#main'}], repository: { diff --git a/lang/text.tex.latex.js b/lang/text.tex.latex.js index d9bc780..e8bc6f3 100644 --- a/lang/text.tex.latex.js +++ b/lang/text.tex.latex.js @@ -10,7 +10,6 @@ const grammar = { '.aux', '.bbx', '.cbx', - '.cls', '.dtx', '.ins', '.lbx', diff --git a/lang/text.vim-help.js b/lang/text.vim-help.js index 17973e0..3141d92 100644 --- a/lang/text.vim-help.js +++ b/lang/text.vim-help.js @@ -5,7 +5,7 @@ // See for more info. /** @type {import('../lib/index.js').Grammar} */ const grammar = { - extensions: ['.txt'], + extensions: [], names: ['vim-help-file', 'help', 'vimhelp'], patterns: [ { diff --git a/lang/text.xml.js b/lang/text.xml.js index 0e493b0..e24455e 100644 --- a/lang/text.xml.js +++ b/lang/text.xml.js @@ -17,7 +17,6 @@ const grammar = { '.cproject', '.cscfg', '.csdef', - '.csl', '.csproj', '.ct', '.dae', @@ -31,10 +30,8 @@ const grammar = { '.fsproj', '.fxml', '.glade', - '.gml', '.gmx', '.grxml', - '.gst', '.hzp', '.iml', '.ivy', @@ -47,11 +44,8 @@ const grammar = { '.lvproj', '.mdpolicy', '.mjml', - '.mm', - '.mod', '.mxml', '.natvis', - '.ncl', '.ndproj', '.nproj', '.nuspec', @@ -59,7 +53,6 @@ const grammar = { '.osm', '.owl', '.pkgproj', - '.pluginspec', '.proj', '.props', '.ps1xml', @@ -67,9 +60,7 @@ const grammar = { '.pt', '.qhelp', '.rdf', - '.res', '.resx', - '.rs', '.rss', '.sch', '.sch', @@ -79,11 +70,8 @@ const grammar = { '.srdf', '.storyboard', '.sublime-snippet', - '.sw', '.targets', '.tml', - '.ts', - '.tsx', '.ui', '.urdf', '.ux', @@ -94,7 +82,6 @@ const grammar = { '.vstemplate', '.vxml', '.wixproj', - '.workflow', '.wsdl', '.wsf', '.wxi', diff --git a/lang/text.xml.plist.js b/lang/text.xml.plist.js index 1c73fe9..a6507e6 100644 --- a/lang/text.xml.plist.js +++ b/lang/text.xml.plist.js @@ -6,7 +6,6 @@ /** @type {import('../lib/index.js').Grammar} */ const grammar = { extensions: [ - '.plist', '.sttheme', '.tmcommand', '.tmlanguage', diff --git a/lib/index.js b/lib/index.js index f6e831d..2c63deb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -7,6 +7,7 @@ * @property {string} scopeName * @property {Array} names * @property {Array} extensions + * @property {Array} [extensionsWithDot] * @property {Array} patterns * @property {Record} [repository] * @property {Record} [injections] @@ -89,6 +90,8 @@ export async function createStarryNight(grammars, options) { const names = new Map() /** @type {Map} */ const extensions = new Map() + /** @type {Map} */ + const extensionsWithDot = new Map() let currentRegistry = await createRegistry(grammars, options) return {flagToScope, scopes, register, highlight} @@ -102,7 +105,7 @@ export async function createStarryNight(grammars, options) { /** * Get the grammar scope (such as `source.gfm`) associated with a grammar name - * (such as `markdown` or `pandoc`) or grammar extension (such as `.md` or + * (such as `markdown` or `pandoc`) or grammar extension (such as `.mdwn` or * `.rmd`). * Note that grammars can use the same extensions. * Importantly, `.md` is registeded by a lisp-like language instead of @@ -110,7 +113,7 @@ export async function createStarryNight(grammars, options) { * * @param {string} flag * Grammar name (such as `'markdown'` or `'pandoc'`) or grammar extension - * (such as `'.md'` or `'.rmd'`). + * (such as `'.mdwn'` or `'.rmd'`). * @returns {string | undefined} * Grammar scope (such as `'source.gfm'`). */ @@ -126,8 +129,9 @@ export async function createStarryNight(grammars, options) { return ( names.get(normal) || - extensions.get(normal) || - extensions.get('.' + normal) + (normal.charAt(0) === '.' + ? extensionsWithDot.get(normal) || extensions.get(normal) + : extensions.get('.' + normal)) ) } @@ -189,6 +193,9 @@ export async function createStarryNight(grammars, options) { for (const grammar of grammars) { const scope = grammar.scopeName for (const d of grammar.extensions) extensions.set(d, scope) + if (grammar.extensionsWithDot) + for (const d of grammar.extensionsWithDot) + extensionsWithDot.set(d, scope) for (const d of grammar.names) names.set(d, scope) registered.set(scope, grammar) } diff --git a/package.json b/package.json index 26cf39d..861cb24 100644 --- a/package.json +++ b/package.json @@ -102,6 +102,7 @@ "lang/" ], "rules": { + "max-depth": "off", "no-bitwise": "off", "no-template-curly-in-string": "off", "unicorn/prefer-top-level-await": "off" diff --git a/readme.md b/readme.md index e938080..aa81f61 100644 --- a/readme.md +++ b/readme.md @@ -300,17 +300,18 @@ Yields: ### `starryNight.flagToScope(flag)` Get the grammar scope (such as `source.gfm`) associated with a grammar name -(such as `markdown` or `pandoc`) or grammar extension (such as `.md` or `.rmd`). +(such as `markdown` or `pandoc`) or grammar extension (such as `.mdwn` or +`.rmd`). Note that grammars can use the same extensions, in which case GitHub chooses the first. -Notably, `.md` is registered by a lisp-like language instead of markdown. +Notably, `.md` is registered by a Lisp-like language instead of markdown. 🤷‍♂️ ###### Parameters * `flag` (`string`) — grammar name (such as `'markdown'` or `'pandoc'`) or grammar extension - (such as `'.md'` or `'.rmd'`) + (such as `'.mdwn'` or `'.rmd'`) ###### Returns diff --git a/script/build.js b/script/build.js index 6235e41..8b9ca07 100644 --- a/script/build.js +++ b/script/build.js @@ -3,6 +3,12 @@ * @typedef {import('../lib/index.js').Rule} Rule */ +/** + * @typedef Info + * @property {Array} names + * @property {Array} extensions + */ + import process from 'node:process' import assert from 'node:assert' import fs from 'node:fs/promises' @@ -52,22 +58,78 @@ const prettierConfig = await prettier.resolveConfig( const gemBase = new URL(linguistBasename + '/', gemsBase) const languagesUrl = new URL('lib/linguist/languages.json', gemBase) + +const ignore = new Set( + // This one actually turns into two classes on GH, which must be a bug. + ['source.pov-ray sdl'] +) + /** @type {Record, extensions?: Array, tm_scope: string}>} */ // @ts-expect-error: TS is wrong, `JSON.parse` accepts buffers. const languages = JSON.parse(await fs.readFile(languagesUrl)) /** @type {string} */ let name -/** - * @typedef Info - * @property {Array} names - * @property {Array} extensions - */ +/** @type {Map} */ +const uniqueIdentifiers = new Map() +/** @type {Map>} */ +const duplicates = new Map() + +// Order is important, so we need to run it several times. +for (const [name, language] of Object.entries(languages)) { + const scope = language.tm_scope + + if (scope === 'none') { + continue + } + + const names = (language.aliases || []).map((d) => normalizeLinguistName(d)) + const defaultId = normalizeLinguistName(name) + + if (!names.includes(defaultId)) { + names.push(defaultId) + } + + for (const alias of names) { + const existing = uniqueIdentifiers.get(alias) + + if (existing) { + assert( + existing === scope, + 'expected duplicate names to refer to same language' + ) + } + + uniqueIdentifiers.set(alias, scope) + } +} + +// Order is important, so we need to run it several times. +for (const [name, language] of Object.entries(languages)) { + const scope = language.tm_scope + + if (scope === 'none') { + continue + } + + const extnames = (language.extensions || []).map((d) => + normalizeLinguistExtension(d) + ) + + for (const extname of extnames) { + const existing = uniqueIdentifiers.get(extname) + + if (existing) { + const dupes = duplicates.get(extname) || new Set() + dupes.add(existing) + dupes.add(name) + duplicates.set(extname, dupes) + } else { + uniqueIdentifiers.set(extname, scope) + } + } +} -const ignore = new Set( - // This one actually turns into two classes on GH, which must be a bug. - ['source.pov-ray sdl'] -) /** @type {Map} */ const linguistInfo = new Map() @@ -82,22 +144,13 @@ for (name in languages) { continue } - let names = [name, ...(rawInfo.aliases || [])].map((d) => { - const normal = d.toLowerCase().replace(/ /g, '-') - assert(/^[-a-z\d.#+'*()/]+$/.test(normal), normal) - return normal - }) + let names = [name, ...(rawInfo.aliases || [])].map((d) => + normalizeLinguistName(d) + ) - let extensions = (rawInfo.extensions || []).map((d) => { - const normal = d.toLowerCase().replace(/ /g, '-') - assert( - normal.charAt(0) === '.', - 'extension `' + normal + '` should start w/ a `.`' - ) - // Same as names but w/o these values: `#'*()/`. - assert(/^[-a-z\d.+_]+$/.test(normal), normal) - return normal - }) + let extensions = (rawInfo.extensions || []).map((d) => + normalizeLinguistExtension(d) + ) const info = linguistInfo.get(scope) @@ -157,6 +210,58 @@ await Promise.all( const grammar = cleanGrammar(JSON.parse(await fs.readFile(inputUrl)), scope) assert(grammar.scopeName === scope, 'expected scopes to match') + const info = linguistInfo.get(scope) + assert(info, 'expected info') + + for (const name of info.names) { + const mappedScope = uniqueIdentifiers.get(name) + assert(mappedScope, 'expected mapping') + assert(mappedScope === scope, 'expected names to be unique') + } + + /** + * List of extensions that can be used with and without dots. + * + * To illustrate, `yaml` can be used like ` ```yaml ` and like ` ```.yaml `. + * + * @type {Array} + */ + const extensions = [] + /** + * List of extensions that can only be used with a dot. + * + * To illustrate, ` ```adb ` maps to `Adblock Filter List`, whereas + * ` ```.adb ` maps to `Ada`. + * + * @type {Array} + */ + const extensionsWithDot = [] + + for (const name of info.extensions) { + const mappedScopeDot = uniqueIdentifiers.get(name) + const short = name.slice(1) + assert(mappedScopeDot, 'expected mapping') + const mappedScopeDotless = uniqueIdentifiers.get(short) || mappedScopeDot + + if (mappedScopeDot === scope) { + if (mappedScopeDotless === scope) { + extensions.push(name) + } else { + extensionsWithDot.push(name) + } + } else if (mappedScopeDotless === scope) { + // Only allowed without a dot (`html`), because with a dot, it maps to + // something else (`.html` weirdly maps to `ecmarkup`). + // That means, the short form must be in names. + // It might not currently be though, because we’re still looping! + assert( + info.names.includes(short), + 'expected extension (w/o dot) in names' + ) + // Otherwise, ignore the extension: it maps to something else in all cases! + } + } + await fs.writeFile( outputUrl, prettier.format( @@ -165,7 +270,10 @@ await Promise.all( 'const grammar = ' + jsonStableStringify({ ...grammar, - ...linguistInfo.get(scope) + names: info.names, + extensions, + extensionsWithDot: + extensionsWithDot.length === 0 ? undefined : extensionsWithDot }), '', 'export default grammar', @@ -364,3 +472,32 @@ function scopeToId(value) { ) ) } + +/** + * @param {string} d + * @returns {string} + */ +function normalizeLinguistName(d) { + // Names are case-insensitive, so we lowercase. + // For an example, see `SnipMate` which is included as an alias, but using + // `snipmate` or `SNIPMATE` also highlights. + // + // Spaces in names are turned into dashes. + // For example `DNS zone` can be used as `dns-zone`, not as `dns` or + // `dns_zone`. + const normal = d.toLowerCase().replace(/ /g, '-') + assert(/^[-a-z\d.#+'*()/]+$/.test(normal), normal) + return normal +} + +/** + * @param {string} d + * @returns {string} + */ +function normalizeLinguistExtension(d) { + // Extensions are case-insensitive (example: for `.OutJob`, `.outjob` also works). + // They can also contain dots, dashes, plusses, etc. + const normal = d.toLowerCase() + assert(/^\.[\w+.-]+$/.test(normal), normal) + return normal +} diff --git a/test.js b/test.js index a002256..c788422 100644 --- a/test.js +++ b/test.js @@ -3,6 +3,8 @@ import test from 'node:test' import {toHtml} from 'hast-util-to-html' import sourceGfm from './lang/source.gfm.js' import sourceCss from './lang/source.css.js' +import sourceAssembly from './lang/source.assembly.js' +import textPhp from './lang/text.html.php.js' import {createStarryNight, common} from './index.js' test('.flagToScope(flag)', async () => { @@ -33,6 +35,29 @@ test('.flagToScope(flag)', async () => { 'should support extensions (w/ dot)' ) assert.equal(starryNight.flagToScope('whatever'), undefined) + + const phpThenAssembly = await createStarryNight([textPhp, sourceAssembly]) + assert.equal( + phpThenAssembly.flagToScope('.inc'), + sourceAssembly.scopeName, + 'should support the scope that GH uses for an extension w/ dot (1)' + ) + assert.equal( + phpThenAssembly.flagToScope('inc'), + textPhp.scopeName, + 'should support the scope that GH uses for an extension w/o dot (1)' + ) + const assemblyThenPhp = await createStarryNight([sourceAssembly, textPhp]) + assert.equal( + sourceAssembly.scopeName, + 'source.assembly', + 'should support the scope that GH uses for an extension w/ dot (2)' + ) + assert.equal( + assemblyThenPhp.flagToScope('inc'), + textPhp.scopeName, + 'should support the scope that GH uses for an extension w/o dot (2)' + ) }) test('.createStarryNight with options', () => {