diff --git a/languages.toml b/languages.toml index 9b810282..2bf8f123 100644 --- a/languages.toml +++ b/languages.toml @@ -2873,7 +2873,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "jsdoc" -source = { git = "https://github.com/tree-sitter/tree-sitter-jsdoc", rev = "189a6a4829beb9cdbe837260653b4a3dfb0cc3db" } +source = { git = "https://github.com/tree-sitter/tree-sitter-jsdoc", rev = "658d18dcdddb75c760363faa4963427a7c6b52db" } [[language]] name = "openscad" diff --git a/runtime/queries/jsdoc/highlights.scm b/runtime/queries/jsdoc/highlights.scm index 4b4266c9..65d11529 100644 --- a/runtime/queries/jsdoc/highlights.scm +++ b/runtime/queries/jsdoc/highlights.scm @@ -1,2 +1,3 @@ (tag_name) @keyword (type) @type +(number) @constant.numeric diff --git a/runtime/queries/jsdoc/injections.scm b/runtime/queries/jsdoc/injections.scm index 877b671d..49869e2f 100644 --- a/runtime/queries/jsdoc/injections.scm +++ b/runtime/queries/jsdoc/injections.scm @@ -2,4 +2,11 @@ ((document) @injection.content (#set! injection.include-children) - (#set! injection.language "comment")) \ No newline at end of file + (#set! injection.language "comment")) + +; Fenced code blocks inside doc comments (e.g. ```js in @example): highlight +; the body with the language named in the fence. +((code_block + (code_block_language) @injection.language + (code_block_line) @injection.content) + (#set! injection.combined)) \ No newline at end of file