Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hkoba/20ea1cd89729643d17c9dab2afec0a77 to your computer and use it in GitHub Desktop.
Save hkoba/20ea1cd89729643d17c9dab2afec0a77 to your computer and use it in GitHub Desktop.
Extracted list of meta scopes found in VSCode distribution
#!/bin/zsh
emulate -L zsh
perl -nle 'print $& for /meta(\.[-\w]+)*/g' **/*.tmLanguage.json|sort|uniq|
perl -MList::Util=uniq -nle '
(undef, my ($key, @rest)) = split /\./;
pop @rest;
push @{$meta{$key}}, join(".", @rest);
END {
print join "\t", "scope-prefix", "subscopes:";
foreach my $key (sort keys %meta) {
next if $key eq "";
print join "\t", "meta.$key", uniq sort @{$meta{$key}}
}
}' > meta-scope-list.tsv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2 in line 1.
scope-prefix subscopes:
meta.alter
meta.angle-brackets
meta.argument-type
meta.arguments attribute decltype operator.alignas operator.alignof operator.sizeof operator.typeid
meta.array empty literal literal.js string string.interpolated symbol symbol.interpolated
meta.array-binding-pattern-variable js
meta.arrow js
meta.assertion look-ahead look-behind negative-look-ahead negative-look-behind
meta.at-rule at-root body charset counter-style.body counter-style.header document.body document.header each else extend font-face font-features fontface for function header if import include keyframes keyframes.body keyframes.header media media.body media.header mixin namespace option page return supports supports.body supports.header viewport warn while
meta.attribute available objc style
meta.attribute-selector
meta.attribute-with-value id
meta.backreference named
meta.block class enum extern js namespace parens struct switch union
meta.block-mapping
meta.body class enum extern function.definition namespace struct switch union
meta.brace angle curly round round.js square square.js
meta.bracket square.access
meta.bracketed
meta.case
meta.catch body parameters
meta.cgblock
meta.character set
meta.class body identifier inheritance instance.constructor js perl
meta.class-struct-block
meta.closure parameter parameters
meta.commit-command
meta.commit-message
meta.conditional case switch
meta.content
meta.control flow
meta.create
meta.declaration annotation assertion namespace.alias namespace.alias.value type.alias type.alias.value.unknown
meta.decorator js
meta.definition associatedtype class class.implemented.interfaces class.inherited.classes function function.body function.initializer function.js global method method.js method.signature operator precedencegroup property property.js type.body type.protocol typealias variable variable.js variable.local variable.map variable.name
meta.delimiter decimal.period decimal.period.js
meta.diff header index range
meta.directive functions implements inherits inject layout model page using
meta.divider
meta.drop
meta.element inline metadata object other other.invalid structure
meta.embedded block block.example.source block.js diff expression expression.js line line.js pod
meta.encoding
meta.enum declaration declaration.js definition value
meta.enum-case
meta.environment-variable
meta.evaluation ternary
meta.even-tab
meta.example css.scss html js
meta.export default default.js js
meta.expression explicit implicit set
meta.extern-block
meta.feature-query
meta.field declaration declaration.js
meta.finally body
meta.first-class
meta.flow-mapping
meta.flow-pair explicit key value
meta.flow-sequence
meta.format brace percent
meta.fstring
meta.function block.end block.start calc closure closure.use color constructor constructor.initializer-list decorator definition definition.body.lambda definition.parameters definition.parameters.lambda definition.parameters.operator-overload destructor destructor.prototype document-rule expression expression.js gradient gradient.invalid.deprecated.gradient inline inline.else inline.other js lambda.parameters method.with-arguments method.without-arguments misc parameter.array parameter.default parameter.no-default parameter.typehinted parameters shape timing-function url variable
meta.function-call arguments generic invoke js member parameters predicate
meta.function-result
meta.function-with-body
meta.generic-argument-clause
meta.generic-parameter-clause
meta.generic-parameter-constraint
meta.generic-where-clause conformance-requirement same-type-requirement
meta.group array-expression assertion complex.subexpression regexp
meta.hashtable assignment
meta.head class enum extern function.definition namespace struct switch union
meta.herestring
meta.hlslblock
meta.id-with-protocol
meta.image inline reference
meta.implementation
meta.import js
meta.import-equals external external.js internal internal.js
meta.include
meta.indexer declaration declaration.js mappedtype.declaration mappedtype.declaration.js
meta.inheritance-clause
meta.inheritance-list
meta.inherited-class
meta.initialization
meta.inner-class
meta.interface js
meta.interface-or-protocol
meta.internalsubset
meta.interpolation
meta.item-access arguments
meta.js
meta.jsx children children.js
meta.lambda capture
meta.lambda-function
meta.leading-tabs
meta.link email.lt-gt inet inline reference reference.def reference.literal
meta.map
meta.metadata map simple
meta.method body declaration declaration.js identifier paramerised-type parameter parameters return-type
meta.method-call static
meta.module body
meta.named
meta.namespace declaration declaration.js
meta.namespace-block
meta.object member member.js type type.js
meta.object-binding-pattern-variable js
meta.object-literal key key.fx.blendstate key.fx.depthstencilstate key.fx.rasterizerstate key.fx.samplerstate key.js
meta.objectliteral js
meta.odd-tab
meta.other inherited-class type.phpdoc valid-ampersand valid-bracket
meta.package
meta.paragraph
meta.parameter default object-binding-pattern object-binding-pattern.js
meta.parameter-clause
meta.parameters js
meta.paramter array-binding-pattern array-binding-pattern.js
meta.parens block
meta.preprocessor conditional diagnostic include macro pragma sourcelocation
meta.prompt set
meta.property
meta.property-list font-feature media-query
meta.property-name media-query
meta.property-value media-query
meta.property-with-attributes
meta.protocol-list
meta.qualified_type
meta.quoted-expression
meta.ratio
meta.require
meta.requires
meta.return type type.arrow type.arrow.js type.js
meta.return-type
meta.scope between-tag-pair case-block case-body case-clause case-clause-body case-pattern condition conditional for-in-loop for-loop function-call group if-block implementation interface logical-expression message metadata prerequisites recipe select-block subject subshell target while-loop
meta.scope-resolution
meta.scriptblock
meta.section
meta.selector method-name
meta.separator
meta.set
meta.static_assert message
meta.structure array array.json dictionary dictionary.json dictionary.value dictionary.value.json extglob
meta.subscript-expression
meta.switch-statement
meta.symbol dynamic namespace
meta.syntax ruby
meta.tag any attributes attributes.js block.any custom.end custom.start inline inline.any inline.phpdoc inline.start js metadata metadata.cdata metadata.doctype metadata.processing.xml metadata.script.end metadata.script.start metadata.start metadata.style.end metadata.style.start no-content object object.start other other.invalid.end other.invalid.start other.invalid.void other.start other.unrecognized.html preprocessor preprocessor.xml sgml sgml.doctype structure structure.any structure.start tokenised without-attributes without-attributes.js xml
meta.tail class enum extern function.definition namespace struct switch union
meta.template angle-brackets.end angle-brackets.start call definition expression expression.js operator.comma operator.ellipsis
meta.throwables
meta.toc-list banner.block banner.line file-name line-number pragma-mark
meta.trait
meta.try body resources
meta.ts
meta.tsx
meta.type annotation annotation.js constructor constructor.js declaration declaration.js function function.js function.return function.return.js parameters parameters.js paren.cover paren.cover.js tuple tuple.js
meta.type-name
meta.type_params
meta.typehint comment
meta.use
meta.using-namespace
meta.using-namespace-declaration
meta.var expr expr.js
meta.var-single-variable expr expr.js
meta.variable assignment.destructured.array assignment.destructured.object substitution substring
meta.vector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment