Skip to main content
docs/reference/languages

Language packages

Every language package CodePad ships, with its language ids, its grammar, the languages it embeds and its token names.

Edit this page

Install a package next to the core and pass one of its ids as language. A package can hold more than one grammar: markdown_inline is used only inside Markdown, php_only reads PHP without the <?php tag, and dtd reads a standalone DTD file.

The Embedded languages column lists the language names a package marks inside its own code, such as css inside HTML. That code highlights when a package or a custom language with the same id is installed. "From the source" means the document names the language, as the word after a Markdown fence does.

PackagelanguageGrammarEmbedded languages
react-native-codepad-lang-cctree-sitter/tree-sitter-ccomment, doxygen, printf, re2c
react-native-codepad-lang-csscsstree-sitter/tree-sitter-csscomment
react-native-codepad-lang-gogotree-sitter/tree-sitter-gocomment, printf, re2c, regex
react-native-codepad-lang-htmlhtmltree-sitter/tree-sitter-htmlcomment, css, javascript, json, python, regex, toml
react-native-codepad-lang-iniinijustinmk/tree-sitter-inicomment
react-native-codepad-lang-javajavatree-sitter/tree-sitter-javacomment, javadoc, printf
react-native-codepad-lang-javascriptjavascripttree-sitter/tree-sitter-javascriptangular, comment, css, glimmer, graphql, groq, html, jsdoc, regex, styled, from the source
react-native-codepad-lang-jsonjsontree-sitter/tree-sitter-jsoncomment
react-native-codepad-lang-kotlinkotlinfwcd/tree-sitter-kotlincomment, printf, regex
react-native-codepad-lang-markdownmarkdown, markdown_inlinetree-sitter-grammars/tree-sitter-markdownhtml, latex, markdown_inline, toml, yaml, from the source
react-native-codepad-lang-phpphp, php_onlytree-sitter/tree-sitter-phpbash, html, phpdoc, regex, from the source
react-native-codepad-lang-pythonpythontree-sitter/tree-sitter-pythoncomment, printf, regex
react-native-codepad-lang-rustrusttree-sitter/tree-sitter-rustcomment, re2c, regex, rust, from the source
react-native-codepad-lang-sqlsqlDerekStride/tree-sitter-sqlcomment
react-native-codepad-lang-swiftswiftalex-pinkus/tree-sitter-swiftcomment, regex
react-native-codepad-lang-tsxtsxtree-sitter/tree-sitter-typescriptangular, comment, css, glimmer, graphql, groq, html, jsdoc, regex, styled, from the source
react-native-codepad-lang-typescripttypescripttree-sitter/tree-sitter-typescriptangular, comment, css, glimmer, graphql, groq, html, jsdoc, regex, styled, from the source
react-native-codepad-lang-xmldtd, xmltree-sitter-grammars/tree-sitter-xmlcomment, css, javascript, sql
react-native-codepad-lang-yamlyamltree-sitter-grammars/tree-sitter-yamlbash, comment, promql

Token names​

Each grammar gives a name to every piece of code it highlights. These names are the keys of a theme's tokens. When a theme has no entry for a name, it uses the entry for the shorter name, so keyword.return falls back to keyword.

c​

attribute, boolean, character, comment, comment.documentation, constant, constant.builtin, constant.macro, function, function.builtin, function.call, function.macro, keyword, keyword.conditional, keyword.conditional.ternary, keyword.directive, keyword.directive.define, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, number, operator, property, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, type, type.builtin, type.definition, variable, variable.builtin, variable.parameter

css​

attribute, character.special, comment, constant, function, keyword, keyword.directive, keyword.import, keyword.modifier, keyword.operator, module, number, number.float, operator, property, punctuation.bracket, punctuation.delimiter, spell, string, tag, tag.attribute, type, variable

go​

boolean, character, comment, comment.documentation, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.coroutine, keyword.function, keyword.import, keyword.repeat, keyword.return, keyword.type, label, module, number, number.float, operator, property, punctuation.bracket, punctuation.delimiter, spell, string, string.escape, string.regexp, type, type.builtin, type.definition, variable, variable.member, variable.parameter

html​

character.special, comment, constant, markup.heading, markup.heading.1, markup.heading.2, markup.heading.3, markup.heading.4, markup.heading.5, markup.heading.6, markup.italic, markup.link.label, markup.raw, markup.strikethrough, markup.strong, markup.underline, none, nospell, operator, spell, string, string.special.url, tag, tag.attribute, tag.delimiter

ini​

comment, markup.heading, operator, property, punctuation.bracket, spell, string

java​

attribute, boolean, character, character.special, comment, comment.documentation, constant, constant.builtin, function.builtin, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.exception, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, number, number.float, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, type, type.builtin, variable, variable.builtin, variable.member, variable.parameter

javascript​

attribute, boolean, character.special, comment, comment.documentation, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, markup.heading, markup.heading.1, markup.heading.2, markup.heading.3, markup.heading.4, markup.heading.5, markup.heading.6, markup.italic, markup.link.label, markup.raw, markup.strikethrough, markup.strong, markup.underline, module, module.builtin, none, number, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, string.special.url, tag, tag.attribute, tag.builtin, tag.delimiter, type, type.builtin, variable, variable.builtin, variable.member, variable.parameter

json​

boolean, comment, conceal, constant.builtin, number, property, punctuation.bracket, punctuation.delimiter, spell, string, string.escape

kotlin​

attribute, boolean, character, character.special, comment, comment.documentation, constant, constructor, function, function.builtin, function.call, keyword, keyword.conditional, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.repeat, keyword.return, keyword.type, label, module, none, number, number.float, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, type, type.builtin, type.definition, variable, variable.builtin, variable.member, variable.parameter

markdown​

keyword.directive, label, markup.heading, markup.heading.1, markup.heading.2, markup.heading.3, markup.heading.4, markup.heading.5, markup.heading.6, markup.link.label, markup.link.url, markup.list, markup.list.checked, markup.list.unchecked, markup.quote, markup.raw.block, punctuation.delimiter, punctuation.special, spell, string.escape

markdown_inline​

character.special, conceal, markup.italic, markup.link, markup.link.label, markup.link.url, markup.raw, markup.strikethrough, markup.strong, nospell

php​

attribute, boolean, comment, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, module, module.builtin, number, number.float, operator, property, punctuation.bracket, punctuation.delimiter, spell, string, string.escape, type, type.builtin, type.definition, variable, variable.builtin, variable.member, variable.parameter

php_only​

attribute, boolean, comment, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, module, module.builtin, number, number.float, operator, property, punctuation.bracket, punctuation.delimiter, spell, string, string.escape, type, type.builtin, type.definition, variable, variable.builtin, variable.member, variable.parameter

python​

attribute, attribute.builtin, boolean, character.special, comment, constant, constant.builtin, constructor, function, function.builtin, function.call, function.macro, function.method, function.method.call, keyword, keyword.conditional, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.operator, keyword.repeat, keyword.return, keyword.type, module, module.builtin, none, nospell, number, number.float, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.documentation, string.escape, string.regexp, type, type.builtin, type.definition, variable, variable.builtin, variable.member, variable.parameter

rust​

attribute, attribute.builtin, boolean, character, character.special, comment, comment.documentation, constant, constant.builtin, function, function.call, function.macro, keyword, keyword.conditional, keyword.coroutine, keyword.debug, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, module, number, number.float, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, type, type.builtin, variable, variable.builtin, variable.member, variable.parameter

sql​

attribute, boolean, comment, function.call, keyword, keyword.conditional, keyword.modifier, keyword.operator, keyword.repeat, number, number.float, operator, punctuation.bracket, punctuation.delimiter, spell, string, type, type.builtin, variable, variable.member, variable.parameter

swift​

attribute, boolean, character.special, comment, comment.documentation, constant.builtin, constant.macro, constructor, function.call, function.macro, function.method, keyword, keyword.conditional, keyword.conditional.ternary, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, number, number.float, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, type, variable, variable.builtin, variable.member, variable.parameter

tsx​

attribute, boolean, character.special, comment, comment.documentation, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, markup.heading, markup.heading.1, markup.heading.2, markup.heading.3, markup.heading.4, markup.heading.5, markup.heading.6, markup.italic, markup.link.label, markup.raw, markup.strikethrough, markup.strong, markup.underline, module, module.builtin, none, number, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, string.special.url, tag, tag.attribute, tag.builtin, tag.delimiter, type, type.builtin, variable, variable.builtin, variable.member, variable.parameter

typescript​

attribute, boolean, character.special, comment, comment.documentation, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, module, module.builtin, none, number, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, string.special.url, type, type.builtin, variable, variable.builtin, variable.member, variable.parameter

dtd​

attribute, character, character.special, comment, constant, constant.builtin, function.macro, keyword, keyword.directive, keyword.directive.define, keyword.import, keyword.modifier, label, number, operator, punctuation.bracket, punctuation.delimiter, spell, string, string.special, string.special.url, tag, tag.attribute, tag.delimiter, type.builtin

xml​

attribute, boolean, character, character.special, comment, constant, constant.builtin, function.macro, keyword, keyword.directive, keyword.directive.define, keyword.modifier, label, markup.raw, module, none, number, operator, punctuation.bracket, punctuation.delimiter, spell, string, string.special, string.special.url, tag, tag.attribute, tag.delimiter, type.builtin, type.definition

yaml​

boolean, comment, constant.builtin, keyword.directive, label, number, property, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, type