From 4d827c8805bdbfeedfd610a5e34318ff0225e522 Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Thu, 10 Oct 2024 12:03:45 +0100 Subject: [PATCH 1/4] Add additional tests for unclosed code blocks in comments --- test/goldens/comments.dart.golden | 237 ++++++++++++++++++++---------- test/test_files/comments.dart | 67 ++++++++- 2 files changed, 219 insertions(+), 85 deletions(-) diff --git a/test/goldens/comments.dart.golden b/test/goldens/comments.dart.golden index 05b2729..94de67f 100644 --- a/test/goldens/comments.dart.golden +++ b/test/goldens/comments.dart.golden @@ -5,15 +5,15 @@ >// found in the LICENSE file. #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart > ->/// Multiline dartdoc comment. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart +>/// Multiline dartdoc comment with triple backticks. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart >/// #^^^ comment.block.documentation.dart >/// ``` #^^^^^^^ comment.block.documentation.dart ->/// doc +>/// code #^^^ comment.block.documentation.dart -# ^^^^ comment.block.documentation.dart variable.other.source.dart +# ^^^^^ comment.block.documentation.dart variable.other.source.dart >/// ``` #^^^ comment.block.documentation.dart # ^ comment.block.documentation.dart variable.other.source.dart @@ -22,125 +22,204 @@ #^^^ comment.block.documentation.dart >/// ... #^^^^^^^ comment.block.documentation.dart ->var a; +>var doc1; #^^^ storage.type.primitive.dart -# ^ punctuation.terminator.dart +# ^ punctuation.terminator.dart > ->/// `` +>/// Multiline dartdoc comment with unclosed triple backticks. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart +>/// +#^^^ comment.block.documentation.dart +>/// ``` +#^^^^^^^ comment.block.documentation.dart +>/// code +#^^^ comment.block.documentation.dart +# ^^^^^ comment.block.documentation.dart variable.other.source.dart +>var doc2; +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart +> +>/// Multiline dartdoc comment with unclosed backticks. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart +>/// +#^^^ comment.block.documentation.dart +>/// `code +#^^^^^^^^^ comment.block.documentation.dart +>var doc3; +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart +> +>/// Multiline dartdoc comment with indented code. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart +>/// +#^^^ comment.block.documentation.dart +>/// code1 +#^^^^^^^^^^^^^ comment.block.documentation.dart +>/// code2 +#^^^^^^^^^^^^^ comment.block.documentation.dart +>/// +#^^^ comment.block.documentation.dart +>/// code3 +#^^^^^^^^^^^^^ comment.block.documentation.dart +>/// +#^^^ comment.block.documentation.dart +>/// ... +#^^^^^^^ comment.block.documentation.dart +>var doc4; +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart +> +>/** Block dartdoc comment with triple backticks. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart +> * +#^^ comment.block.documentation.dart +> * ``` #^^^^^^ comment.block.documentation.dart ->var noInlineCode; +> * code +#^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> * ``` +#^^^ comment.block.documentation.dart variable.other.source.dart +# ^^^ comment.block.documentation.dart +> * +#^^ comment.block.documentation.dart +> * ... +#^^^^^^ comment.block.documentation.dart +> */ +#^^^ comment.block.documentation.dart +>var blockDoc1; #^^^ storage.type.primitive.dart -# ^ punctuation.terminator.dart +# ^ punctuation.terminator.dart +> +>/** Block dartdoc comment with unclosed triple backticks. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart +> * +#^^ comment.block.documentation.dart +> * ``` +#^^^^^^ comment.block.documentation.dart +> * code +#^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> */ +#^^^ comment.block.documentation.dart variable.other.source.dart +>var blockDoc2; +#^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> +>/** Block dartdoc comment with unclosed backticks. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> * +#^^ comment.block.documentation.dart variable.other.source.dart +> * `code +#^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> */ +#^^^ comment.block.documentation.dart variable.other.source.dart +>var blockDoc3; +#^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> +>/** Block dartdoc comment with indented code. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> * +#^^ comment.block.documentation.dart variable.other.source.dart +> * code1 +#^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> * code2 +#^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> * +#^^ comment.block.documentation.dart variable.other.source.dart +> * code3 +#^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> * +#^^ comment.block.documentation.dart variable.other.source.dart +> * ... +#^^^^^^ comment.block.documentation.dart variable.other.source.dart +> */ +#^^^ comment.block.documentation.dart variable.other.source.dart +>var blockDoc4; +#^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> +>/// `` +#^^^^^^ comment.block.documentation.dart variable.other.source.dart +>var noInlineCode; +#^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart > >/// `Stream` -#^^^^ comment.block.documentation.dart -# ^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart >var inlineCode; -#^^^ storage.type.primitive.dart -# ^ punctuation.terminator.dart +#^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart > >/// ` ` -#^^^^ comment.block.documentation.dart -# ^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^ comment.block.documentation.dart variable.other.source.dart >var inlineCodeJustWhitespace; -#^^^ storage.type.primitive.dart -# ^ punctuation.terminator.dart +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart > >/* -#^^ comment.block.dart +#^^ comment.block.documentation.dart variable.other.source.dart > * Old-style dartdoc -#^^^^^^^^^^^^^^^^^^^^ comment.block.dart +#^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart > * -#^^ comment.block.dart +#^^ comment.block.documentation.dart variable.other.source.dart > * ... -#^^^^^^ comment.block.dart +#^^^^^^ comment.block.documentation.dart variable.other.source.dart > */ -#^^^ comment.block.dart +#^^^ comment.block.documentation.dart variable.other.source.dart >var b; -#^^^ storage.type.primitive.dart -# ^ punctuation.terminator.dart +#^^^^^^ comment.block.documentation.dart variable.other.source.dart > >/* Inline block comment */ -#^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.dart +#^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart >var c; -#^^^ storage.type.primitive.dart -# ^ punctuation.terminator.dart +#^^^^^^ comment.block.documentation.dart variable.other.source.dart > >/** -#^^^ comment.block.documentation.dart +#^^^ comment.block.documentation.dart variable.other.source.dart > * Nested block -#^^^^^^^^^^^^^^^ comment.block.documentation.dart +#^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart > * -#^^ comment.block.documentation.dart +#^^ comment.block.documentation.dart variable.other.source.dart > * /** -#^^^^^^ comment.block.documentation.dart +#^^^^^^ comment.block.documentation.dart variable.other.source.dart > * * Nested block -#^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart +#^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart > * */ -#^^^^^^ comment.block.documentation.dart +#^^^^^^ comment.block.documentation.dart variable.other.source.dart > */ -#^^^ comment.block.documentation.dart +#^^^ comment.block.documentation.dart variable.other.source.dart >var d; -#^^^ storage.type.primitive.dart -# ^ punctuation.terminator.dart +#^^^^^^ comment.block.documentation.dart variable.other.source.dart > >/** -#^^^ comment.block.documentation.dart +#^^^ comment.block.documentation.dart variable.other.source.dart > * Nested -#^^^^^^^^^ comment.block.documentation.dart +#^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart > * -#^^ comment.block.documentation.dart +#^^ comment.block.documentation.dart variable.other.source.dart > * /* Inline */ -#^^^ comment.block.documentation.dart -# ^^^^^^^^^^^^ comment.block.documentation.dart comment.block.dart +#^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart > */ -#^^^ comment.block.documentation.dart +#^^^ comment.block.documentation.dart variable.other.source.dart >var e; -#^^^ storage.type.primitive.dart -# ^ punctuation.terminator.dart +#^^^^^^ comment.block.documentation.dart variable.other.source.dart > >/* Nested /* Inline */ */ -#^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.dart +#^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart >var f; -#^^^ storage.type.primitive.dart -# ^ punctuation.terminator.dart +#^^^^^^ comment.block.documentation.dart variable.other.source.dart > >// Simple comment -#^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart +#^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart >var g; -#^^^ storage.type.primitive.dart -# ^ punctuation.terminator.dart +#^^^^^^ comment.block.documentation.dart variable.other.source.dart > >/// Dartdoc with reference to [a]. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart -# ^^^ comment.block.documentation.dart variable.name.source.dart -# ^ comment.block.documentation.dart +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart >/// And a link to [example.org](http://example.org/). -#^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart -# ^^^^^^^^^^^^^ comment.block.documentation.dart variable.name.source.dart -# ^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart >var h; -#^^^ storage.type.primitive.dart -# ^ punctuation.terminator.dart -> ->class A { -#^^^^^ keyword.declaration.dart -# ^ support.class.dart -# ^ other.source.dart -# ^^^^^^^ support.class.dart -# ^^^^^^^^^^^^^ comment.block.dart -# ^ other.source.dart -> void b() {} -# ^^^^ storage.type.primitive.dart -# ^ keyword.operator.comparison.dart -# ^^^^^^^ support.class.dart -# ^^^^^^^^^^^^^ comment.block.dart -# ^ keyword.operator.comparison.dart -> Future c() {} -# ^^^^^^ support.class.dart -# ^ other.source.dart -# ^^^^^^^ support.class.dart -# ^^^^^^^^^^^^^ comment.block.dart -# ^ other.source.dart -# ^ entity.name.function.dart +#^^^^^^ comment.block.documentation.dart variable.other.source.dart +> +>class A { +#^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> void b() {} +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +> Future c() {} +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart >} +#^ comment.block.documentation.dart variable.other.source.dart diff --git a/test/test_files/comments.dart b/test/test_files/comments.dart index 31ff0b6..a41d817 100644 --- a/test/test_files/comments.dart +++ b/test/test_files/comments.dart @@ -2,14 +2,69 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// Multiline dartdoc comment. +/// Multiline dartdoc comment with triple backticks. /// /// ``` -/// doc +/// code /// ``` /// /// ... -var a; +var doc1; + +/// Multiline dartdoc comment with unclosed triple backticks. +/// +/// ``` +/// code +var doc2; + +/// Multiline dartdoc comment with unclosed backticks. +/// +/// `code +var doc3; + +/// Multiline dartdoc comment with indented code. +/// +/// code1 +/// code2 +/// +/// code3 +/// +/// ... +var doc4; + +/** Block dartdoc comment with triple backticks. + * + * ``` + * code + * ``` + * + * ... + */ +var blockDoc1; + +/** Block dartdoc comment with unclosed triple backticks. + * + * ``` + * code + */ +var blockDoc2; + +/** Block dartdoc comment with unclosed backticks. + * + * `code + */ +var blockDoc3; + +/** Block dartdoc comment with indented code. + * + * code1 + * code2 + * + * code3 + * + * ... + */ +var blockDoc4; /// `` var noInlineCode; @@ -56,7 +111,7 @@ var g; /// And a link to [example.org](http://example.org/). var h; -class A { - void b() {} - Future c() {} +class A { + void b() {} + Future c() {} } From 6a40337e10a091040788df361db8563e370402bc Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Thu, 10 Oct 2024 13:01:43 +0100 Subject: [PATCH 2/4] Switch from using "while" to "end" and adjust nested rules accordingly --- CHANGELOG.md | 5 + grammars/dart.json | 47 +++++--- pubspec.yaml | 8 +- test/goldens/comments.dart.golden | 178 ++++++++++++++++++------------ 4 files changed, 146 insertions(+), 92 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 658e7b1..3452322 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.4.0 (2024-10-10) + +- Removed use of 'while' in the grammar to avoid some differences in implementations between GitHub and VS Code +- Improved handling of unclosed code blocks in dartdoc comments + ## 1.3.0 (2024-07-31) - Added support for digit separators (`_`). diff --git a/grammars/dart.json b/grammars/dart.json index 6a4877b..7f63686 100644 --- a/grammars/dart.json +++ b/grammars/dart.json @@ -1,6 +1,6 @@ { "name": "Dart", - "version": "1.3.0", + "version": "1.4.0", "fileTypes": [ "dart" ], @@ -69,6 +69,16 @@ ], "repository": { + "dartdoc-codeblock-triple": { + "begin": "^\\s*///\\s*(?!\\s*```)", + "end": "\n", + "contentName": "variable.other.source.dart" + }, + "dartdoc-codeblock-block": { + "begin": "^\\s*\\*\\s*(?!(\\s*```|\/))", + "end": "\n", + "contentName": "variable.other.source.dart" + }, "dartdoc": { "patterns": [ { @@ -80,30 +90,31 @@ } }, { - "match": "^ {4,}(?![ \\*]).*", - "captures": { - "0": { - "name": "variable.name.source.dart" + "begin": "^\\s*///\\s*(```)", + "end": "^\\s*///\\s*(```)|^(?!\\s*///)", + "patterns": [ + { + "include": "#dartdoc-codeblock-triple" } - } + ] }, { - "contentName": "variable.other.source.dart", - "begin": "```.*?$", - "end": "```" + "begin": "^\\s*\\*\\s*(```)", + "end": "^\\s*\\*\\s*(```)|^(?=\\s*\\*\/)", + "patterns": [ + { + "include": "#dartdoc-codeblock-block" + } + ] }, { - "match": "(`[^`]+?`)", - "captures": { - "0": { - "name": "variable.other.source.dart" - } - } + "match": "`[^`\n]+`", + "name": "variable.other.source.dart" }, { - "match": "(\\* (( ).*))$", + "match": "\\s{4,}(.*)$", "captures": { - "2": { + "1": { "name": "variable.other.source.dart" } } @@ -157,7 +168,7 @@ { "name": "comment.block.documentation.dart", "begin": "///", - "while": "^\\s*///", + "end": "^(?!\\s*///)", "patterns": [ { "include": "#dartdoc" diff --git a/pubspec.yaml b/pubspec.yaml index 893846e..6606d5f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,8 +4,8 @@ environment: sdk: ^3.2.0 dev_dependencies: - collection: ^1.18.0 - dart_flutter_team_lints: ^2.1.1 + collection: ^1.19.0 + dart_flutter_team_lints: ^3.2.1 path: ^1.9.0 - string_scanner: ^1.2.0 - test: ^1.25.2 + string_scanner: ^1.4.0 + test: ^1.25.8 diff --git a/test/goldens/comments.dart.golden b/test/goldens/comments.dart.golden index 94de67f..bc00a3f 100644 --- a/test/goldens/comments.dart.golden +++ b/test/goldens/comments.dart.golden @@ -12,12 +12,10 @@ >/// ``` #^^^^^^^ comment.block.documentation.dart >/// code -#^^^ comment.block.documentation.dart -# ^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^ comment.block.documentation.dart +# ^^^^ comment.block.documentation.dart variable.other.source.dart >/// ``` -#^^^ comment.block.documentation.dart -# ^ comment.block.documentation.dart variable.other.source.dart -# ^^^ comment.block.documentation.dart +#^^^^^^^ comment.block.documentation.dart >/// #^^^ comment.block.documentation.dart >/// ... @@ -33,8 +31,8 @@ >/// ``` #^^^^^^^ comment.block.documentation.dart >/// code -#^^^ comment.block.documentation.dart -# ^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^ comment.block.documentation.dart +# ^^^^ comment.block.documentation.dart variable.other.source.dart >var doc2; #^^^ storage.type.primitive.dart # ^ punctuation.terminator.dart @@ -54,13 +52,16 @@ >/// #^^^ comment.block.documentation.dart >/// code1 -#^^^^^^^^^^^^^ comment.block.documentation.dart +#^^^^^^^^ comment.block.documentation.dart +# ^^^^^ comment.block.documentation.dart variable.other.source.dart >/// code2 -#^^^^^^^^^^^^^ comment.block.documentation.dart +#^^^^^^^^ comment.block.documentation.dart +# ^^^^^ comment.block.documentation.dart variable.other.source.dart >/// #^^^ comment.block.documentation.dart >/// code3 -#^^^^^^^^^^^^^ comment.block.documentation.dart +#^^^^^^^^ comment.block.documentation.dart +# ^^^^^ comment.block.documentation.dart variable.other.source.dart >/// #^^^ comment.block.documentation.dart >/// ... @@ -76,10 +77,10 @@ > * ``` #^^^^^^ comment.block.documentation.dart > * code -#^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ comment.block.documentation.dart +# ^^^^ comment.block.documentation.dart variable.other.source.dart > * ``` -#^^^ comment.block.documentation.dart variable.other.source.dart -# ^^^ comment.block.documentation.dart +#^^^^^^ comment.block.documentation.dart > * #^^ comment.block.documentation.dart > * ... @@ -97,129 +98,166 @@ > * ``` #^^^^^^ comment.block.documentation.dart > * code -#^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ comment.block.documentation.dart +# ^^^^ comment.block.documentation.dart variable.other.source.dart > */ -#^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ comment.block.documentation.dart >var blockDoc2; -#^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >/** Block dartdoc comment with unclosed backticks. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart > * -#^^ comment.block.documentation.dart variable.other.source.dart +#^^ comment.block.documentation.dart > * `code -#^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^ comment.block.documentation.dart > */ -#^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ comment.block.documentation.dart >var blockDoc3; -#^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >/** Block dartdoc comment with indented code. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart > * -#^^ comment.block.documentation.dart variable.other.source.dart +#^^ comment.block.documentation.dart > * code1 -#^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^ comment.block.documentation.dart +# ^^^^^ comment.block.documentation.dart variable.other.source.dart > * code2 -#^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^ comment.block.documentation.dart +# ^^^^^ comment.block.documentation.dart variable.other.source.dart > * -#^^ comment.block.documentation.dart variable.other.source.dart +#^^ comment.block.documentation.dart > * code3 -#^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^ comment.block.documentation.dart +# ^^^^^ comment.block.documentation.dart variable.other.source.dart > * -#^^ comment.block.documentation.dart variable.other.source.dart +#^^ comment.block.documentation.dart > * ... -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^ comment.block.documentation.dart > */ -#^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ comment.block.documentation.dart >var blockDoc4; -#^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >/// `` -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^ comment.block.documentation.dart >var noInlineCode; -#^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >/// `Stream` -#^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^ comment.block.documentation.dart +# ^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart >var inlineCode; -#^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >/// ` ` -#^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^ comment.block.documentation.dart +# ^^^ comment.block.documentation.dart variable.other.source.dart >var inlineCodeJustWhitespace; -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >/* -#^^ comment.block.documentation.dart variable.other.source.dart +#^^ comment.block.dart > * Old-style dartdoc -#^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^^^^^^^^^^^^ comment.block.dart > * -#^^ comment.block.documentation.dart variable.other.source.dart +#^^ comment.block.dart > * ... -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^ comment.block.dart > */ -#^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ comment.block.dart >var b; -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >/* Inline block comment */ -#^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.dart >var c; -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >/** -#^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ comment.block.documentation.dart > * Nested block -#^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^^^^^^^ comment.block.documentation.dart > * -#^^ comment.block.documentation.dart variable.other.source.dart +#^^ comment.block.documentation.dart > * /** -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^ comment.block.documentation.dart > * * Nested block -#^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart > * */ -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^ comment.block.documentation.dart > */ -#^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ comment.block.documentation.dart >var d; -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >/** -#^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ comment.block.documentation.dart > * Nested -#^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^ comment.block.documentation.dart > * -#^^ comment.block.documentation.dart variable.other.source.dart +#^^ comment.block.documentation.dart > * /* Inline */ -#^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ comment.block.documentation.dart +# ^^^^^^^^^^^^ comment.block.documentation.dart comment.block.dart > */ -#^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ comment.block.documentation.dart >var e; -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >/* Nested /* Inline */ */ -#^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.dart >var f; -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >// Simple comment -#^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart >var g; -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >/// Dartdoc with reference to [a]. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart +# ^^^ comment.block.documentation.dart variable.name.source.dart +# ^ comment.block.documentation.dart >/// And a link to [example.org](http://example.org/). -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart +# ^^^^^^^^^^^^^ comment.block.documentation.dart variable.name.source.dart +# ^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart >var h; -#^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^ storage.type.primitive.dart +# ^ punctuation.terminator.dart > >class A { -#^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +#^^^^^ keyword.declaration.dart +# ^ support.class.dart +# ^ other.source.dart +# ^ support.class.dart +# ^^^^^^^^^^^^^ comment.block.dart +# ^ other.source.dart > void b() {} -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +# ^^^^ storage.type.primitive.dart +# ^ keyword.operator.comparison.dart +# ^ support.class.dart +# ^^^^^^^^^^^^^ comment.block.dart +# ^ keyword.operator.comparison.dart > Future c() {} -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation.dart variable.other.source.dart +# ^^^^^^ support.class.dart +# ^ other.source.dart +# ^ support.class.dart +# ^^^^^^^^^^^^^ comment.block.dart +# ^ other.source.dart +# ^ entity.name.function.dart >} -#^ comment.block.documentation.dart variable.other.source.dart From e40eabc5119a91f232eb604044393b98ecb33c50 Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Wed, 30 Oct 2024 14:15:00 +0000 Subject: [PATCH 3/4] Update date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3452322..b2daaaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.4.0 (2024-10-10) +## 1.4.0 (2024-10-30) - Removed use of 'while' in the grammar to avoid some differences in implementations between GitHub and VS Code - Improved handling of unclosed code blocks in dartdoc comments From 75741bab65f75de98201513030ba1d918d1eef9e Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Thu, 14 Nov 2024 15:11:12 +0000 Subject: [PATCH 4/4] Update date in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2daaaa..6070319 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.4.0 (2024-10-30) +## 1.4.0 (2024-11-14) - Removed use of 'while' in the grammar to avoid some differences in implementations between GitHub and VS Code - Improved handling of unclosed code blocks in dartdoc comments