From 6fecc7d08d4f79faf904467dd840a4e4e89b4620 Mon Sep 17 00:00:00 2001 From: PanAeon Date: Mon, 24 Jun 2019 23:38:04 +0100 Subject: [PATCH 1/2] Fix nested comments, make links highlighted in the scaladoc, add @constructor keyword, remove dead code, add snap tests for comments. --- src/typescript/Scala.tmLanguage.ts | 25 +- tests/snap/comments.test.scala | 141 ++++++++ tests/snap/comments.test.scala.snap | 524 ++++++++++++++++++++++++++++ 3 files changed, 675 insertions(+), 15 deletions(-) create mode 100644 tests/snap/comments.test.scala create mode 100644 tests/snap/comments.test.scala.snap diff --git a/src/typescript/Scala.tmLanguage.ts b/src/typescript/Scala.tmLanguage.ts index dd1e843..f37a1af 100644 --- a/src/typescript/Scala.tmLanguage.ts +++ b/src/typescript/Scala.tmLanguage.ts @@ -119,19 +119,6 @@ export const scalaTmLanguage: TmLanguage = { } ] }, - 'block-comments': { - end: '\\*/', - begin: '/\\*', - patterns: [ - { - include: '#block-comments' - }, - { - match: '(?x)(?! /\\*)(?! \\*/)' - } - ], - name: 'comment.block.scala' - }, 'script-header': { match: '^#!(.*)$', captures: { @@ -697,7 +684,7 @@ export const scalaTmLanguage: TmLanguage = { } }, { - match: '@(return|see|note|example|usecase|author|version|since|todo|deprecated|migration|define|inheritdoc)\\b', + match: '@(return|see|note|example|constructor|usecase|author|version|since|todo|deprecated|migration|define|inheritdoc)\\b', name: 'keyword.other.documentation.scaladoc.scala' }, { @@ -707,12 +694,15 @@ export const scalaTmLanguage: TmLanguage = { name: 'punctuation.definition.documentation.link.scala' }, '2': { - name: 'entity.other.documentation.link.scala' + name: 'string.other.link.title.markdown' }, '3': { name: 'punctuation.definition.documentation.link.scala' } } + }, + { + "include": "#comments" } ], endCaptures: { @@ -730,6 +720,11 @@ export const scalaTmLanguage: TmLanguage = { name: 'punctuation.definition.comment.scala' } }, + patterns: [ + { + "include": "#comments" + } + ], name: 'comment.block.scala' }, { diff --git a/tests/snap/comments.test.scala b/tests/snap/comments.test.scala new file mode 100644 index 0000000..1ea922b --- /dev/null +++ b/tests/snap/comments.test.scala @@ -0,0 +1,141 @@ +/// SYNTAX TEST "source.scala" +#!/usr/bin/env scala + +// single line comments + +/* /**/ /** */ /* comments within comments */ */ + +/** /* */ /** **/ **/ + + +/************************ + * + * [[scala.Option]] + * @return smth + ***********************/ + +case class C(val x: Int) { + def f(p:Double) : String = { + + } +} + +/** Provides classes for dealing with complex numbers. Also provides + * implicits for converting to and from `Int`. + * + * ==Overview== + * The main class to use is [[my.package.complex.Complex]], as so + * {{{ + * scala> val complex = Complex(4,3) + * complex: my.package.complex.Complex = 4 + 3i + * }}} + * + * If you include [[my.package.complex.ComplexConversions]], you can + * convert numbers more directly + * {{{ + * scala> import my.package.complex.ComplexConversions._ + * scala> val complex = 4 + 3.i + * complex: my.package.complex.Complex = 4 + 3i + * }}} + */ +package complex {} + +/** A person who uses our application. + * + * @constructor create a new person with a name and age. + * @tparam T useless param + * @param name the person's name + * @param age the person's age in years + * @throws java.lang.Exception + * + * @see reference other sources of information like external document links or related entities in the documentation. + * @note add a note for pre or post conditions, or any other notable restrictions or expectations. + * @example for providing example code or related example documentation. + * @usecase def apply(name: String, age: Int) : Unit + * + * @groupname group name + * @groupprio group 2 + * @groupdesc group desc + * @group group + * @contentDiagram + * + * + * @author provide author information for the following entity + * @version the version of the system or API that this entity is a part of. + * @since like @version but defines the system or API that this entity was first defined in. + * @todo for documenting unimplemented features or unimplemented aspects of an entity. + * @deprecated marks the entity as deprecated, providing both the replacement implementation that should be used and the version/date at which this entity was deprecated. + * @migration like deprecated but provides advanced warning of planned changes ahead of deprecation. Same fields as @deprecated. + * @inheritdoc take comments from a superclass as defaults if comments are not provided locally. + * @documentable Expand a type alias and abstract type into a full template page. - TODO: Test the “abstract type” claim - no examples of this in the Scala code base + * + * @define + * + * @shortDescription ??? + * @hideImplicitConversion ??? + * + */ +class Person[T](name: String, age: Int) { +} + +/** Factory for [[mypackage.Person]] instances. */ +object Person { + /** Creates a person with a given name and age. + * + * @param name their name + * @param age the age of the person to create + */ + def apply(name: String, age: Int) = {} + + /** Creates a person with a given name and birthdate + * + * @param name their name + * @param birthDate the person's birthdate + * @return a new Person instance with the age determined by the + * birthdate and current date. + */ + def apply(name: String, birthDate: java.util.Date) = {} + } + +/** Implicit conversions and helpers for [[mypackage.Complex]] instances. + * + * {{{ + * import ComplexImplicits._ + * val c: Complex = 4 + 3.i + * }}} + */ +object ComplexImplicits {} + +/** + * =Heading=, ==Sub-Heading== + * + * `monospace` + * ''italic text'' + * '''bold text''' + * __underline__ + * ^superscript^ + * ,,subscript,, + * [[entity link]], e.g. [[scala.collection.Seq]] + * [[http://external.link External Link]], + * e.g. [[http://scala-lang.org Scala Language Site]] + * + */ +object Markup { + /** Here is an unordered list: + * + * - First item + * - Second item + * - Sub-item to the second + * - Another sub-item + * - Third item + * + * Here is an ordered list: + * + * 1. First numbered item + * 1. Second numbered item + * i. Sub-item to the second + * i. Another sub-item + * 1. Third item + */ + def lists = () +} \ No newline at end of file diff --git a/tests/snap/comments.test.scala.snap b/tests/snap/comments.test.scala.snap new file mode 100644 index 0000000..e95f1dd --- /dev/null +++ b/tests/snap/comments.test.scala.snap @@ -0,0 +1,524 @@ +>/// SYNTAX TEST "source.scala" +#^^ source.scala comment.line.double-slash.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.line.double-slash.scala +>#!/usr/bin/env scala +#^^ source.scala comment.block.shebang.scala +# ^^^^^^^^^^^^^^^^^^ source.scala comment.block.shebang.scala string.unquoted.shebang.scala +> +>// single line comments +#^^ source.scala comment.line.double-slash.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^^^^^^^^^^ source.scala comment.line.double-slash.scala +> +>/* /**/ /** */ /* comments within comments */ */ +#^^ source.scala comment.block.scala punctuation.definition.comment.scala +# ^^ source.scala comment.block.scala +# ^^^^ source.scala comment.block.scala comment.block.empty.scala punctuation.definition.comment.scala +# ^ source.scala comment.block.scala +# ^^ source.scala comment.block.scala comment.block.scala punctuation.definition.comment.scala +# ^^ source.scala comment.block.scala comment.block.scala +# ^^ source.scala comment.block.scala comment.block.scala punctuation.definition.comment.scala +# ^ source.scala comment.block.scala +# ^^ source.scala comment.block.scala comment.block.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.scala comment.block.scala +# ^^ source.scala comment.block.scala comment.block.scala punctuation.definition.comment.scala +# ^ source.scala comment.block.scala +# ^^ source.scala comment.block.scala punctuation.definition.comment.scala +> +>/** /* */ /** **/ **/ +#^^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +# ^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala comment.block.scala punctuation.definition.comment.scala +# ^ source.scala comment.block.documentation.scala comment.block.scala +# ^^ source.scala comment.block.documentation.scala comment.block.scala punctuation.definition.comment.scala +# ^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala comment.block.scala punctuation.definition.comment.scala +# ^^^ source.scala comment.block.documentation.scala comment.block.scala +# ^^ source.scala comment.block.documentation.scala comment.block.scala punctuation.definition.comment.scala +# ^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +> +> +>/************************ +#^^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^ source.scala comment.block.documentation.scala +> * [[scala.Option]] +#^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^^^ source.scala comment.block.documentation.scala string.other.link.title.markdown +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +> * @return smth +#^^^ source.scala comment.block.documentation.scala +# ^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^ source.scala comment.block.documentation.scala +> ***********************/ +#^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +> +>case class C(val x: Int) { +#^^^^ source.scala keyword.declaration.scala +# ^ source.scala +# ^^^^^ source.scala keyword.declaration.scala +# ^ source.scala +# ^ source.scala entity.name.class.declaration +# ^ source.scala meta.bracket.scala +# ^^^ source.scala keyword.declaration.stable.scala +# ^ source.scala +# ^ source.scala variable.other.declaration.scala +# ^ source.scala keyword.operator.scala +# ^ source.scala +# ^^^ source.scala storage.type.primitive.scala +# ^ source.scala meta.bracket.scala +# ^ source.scala +# ^ source.scala punctuation.section.block.begin.scala +> def f(p:Double) : String = { +#^^^^ source.scala +# ^^^ source.scala keyword.declaration.scala +# ^ source.scala +# ^ source.scala entity.name.function.declaration +# ^ source.scala meta.bracket.scala +# ^ source.scala +# ^ source.scala keyword.operator.scala +# ^^^^^^ source.scala storage.type.primitive.scala +# ^ source.scala meta.bracket.scala +# ^ source.scala +# ^ source.scala keyword.operator.scala +# ^ source.scala +# ^^^^^^ source.scala storage.type.scala +# ^ source.scala +# ^ source.scala keyword.operator.comparison.scala +# ^ source.scala +# ^ source.scala punctuation.section.block.begin.scala +> +> } +#^^^^ source.scala +# ^ source.scala punctuation.section.block.end.scala +>} +#^ source.scala punctuation.section.block.end.scala +> +>/** Provides classes for dealing with complex numbers. Also provides +#^^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * implicits for converting to and from `Int`. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^ source.scala comment.block.documentation.scala +> * ==Overview== +#^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * The main class to use is [[my.package.complex.Complex]], as so +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala string.other.link.title.markdown +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^ source.scala comment.block.documentation.scala +> * {{{ +#^^^^^^^^ source.scala comment.block.documentation.scala +> * scala> val complex = Complex(4,3) +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * complex: my.package.complex.Complex = 4 + 3i +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * }}} +#^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^ source.scala comment.block.documentation.scala +> * If you include [[my.package.complex.ComplexConversions]], you can +#^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala string.other.link.title.markdown +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^ source.scala comment.block.documentation.scala +> * convert numbers more directly +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * {{{ +#^^^^^^^^ source.scala comment.block.documentation.scala +> * scala> import my.package.complex.ComplexConversions._ +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * scala> val complex = 4 + 3.i +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * complex: my.package.complex.Complex = 4 + 3i +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * }}} +#^^^^^^^^ source.scala comment.block.documentation.scala +> */ +#^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +>package complex {} +#^^^^^^^ source.scala meta.package.scala keyword.other.import.scala +# ^ source.scala meta.package.scala +# ^^^^^^^ source.scala meta.package.scala entity.name.package.scala +# ^^^^ source.scala meta.package.scala +> +>/** A person who uses our application. +#^^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^ source.scala comment.block.documentation.scala +> * @constructor create a new person with a name and age. +#^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @tparam T useless param +#^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^ source.scala comment.block.documentation.scala +# ^ source.scala comment.block.documentation.scala entity.name.class +# ^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @param name the person's name +#^^^^ source.scala comment.block.documentation.scala +# ^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^ source.scala comment.block.documentation.scala +# ^^^^ source.scala comment.block.documentation.scala variable.parameter.scala +# ^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @param age the person's age in years +#^^^^ source.scala comment.block.documentation.scala +# ^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^ source.scala comment.block.documentation.scala +# ^^^ source.scala comment.block.documentation.scala variable.parameter.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @throws java.lang.Exception +#^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^ source.scala comment.block.documentation.scala +# ^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala entity.name.class +> * +#^^^^ source.scala comment.block.documentation.scala +> * @see reference other sources of information like external document links or related entities in the documentation. +#^^^ source.scala comment.block.documentation.scala +# ^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @note add a note for pre or post conditions, or any other notable restrictions or expectations. +#^^^ source.scala comment.block.documentation.scala +# ^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @example for providing example code or related example documentation. +#^^^ source.scala comment.block.documentation.scala +# ^^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @usecase def apply(name: String, age: Int) : Unit +#^^^ source.scala comment.block.documentation.scala +# ^^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^^ source.scala comment.block.documentation.scala +> * @groupname group name +#^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @groupprio group 2 +#^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @groupdesc group desc +#^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @group group +#^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @contentDiagram +#^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^^ source.scala comment.block.documentation.scala +> * +#^^^^ source.scala comment.block.documentation.scala +> * @author provide author information for the following entity +#^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @version the version of the system or API that this entity is a part of. +#^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @since like @version but defines the system or API that this entity was first defined in. +#^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @todo for documenting unimplemented features or unimplemented aspects of an entity. +#^^^^^ source.scala comment.block.documentation.scala +# ^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @deprecated marks the entity as deprecated, providing both the replacement implementation that should be used and the version/date at which this entity was deprecated. +#^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @migration like deprecated but provides advanced warning of planned changes ahead of deprecation. Same fields as @deprecated. +#^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^ source.scala comment.block.documentation.scala +> * @inheritdoc take comments from a superclass as defaults if comments are not provided locally. +#^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @documentable Expand a type alias and abstract type into a full template page. - TODO: Test the “abstract type” claim - no examples of this in the Scala code base +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^ source.scala comment.block.documentation.scala +> * @define +#^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^^^^ source.scala comment.block.documentation.scala +> * @shortDescription ??? +#^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @hideImplicitConversion ??? +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^ source.scala comment.block.documentation.scala +> */ +#^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +>class Person[T](name: String, age: Int) { +#^^^^^ source.scala keyword.declaration.scala +# ^ source.scala +# ^^^^^^ source.scala entity.name.class.declaration +# ^ source.scala meta.bracket.scala +# ^ source.scala entity.name.class +# ^ source.scala meta.bracket.scala +# ^ source.scala meta.bracket.scala +# ^^^^ source.scala variable.parameter.scala +# ^ source.scala meta.colon.scala +# ^ source.scala +# ^^^^^^ source.scala storage.type.scala +# ^^ source.scala +# ^^^ source.scala variable.parameter.scala +# ^ source.scala meta.colon.scala +# ^ source.scala +# ^^^ source.scala storage.type.primitive.scala +# ^ source.scala meta.bracket.scala +# ^ source.scala +# ^ source.scala punctuation.section.block.begin.scala +>} +#^ source.scala punctuation.section.block.end.scala +> +>/** Factory for [[mypackage.Person]] instances. */ +#^^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala string.other.link.title.markdown +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +>object Person { +#^^^^^^ source.scala keyword.declaration.scala +# ^ source.scala +# ^^^^^^ source.scala entity.name.class.declaration +# ^ source.scala +# ^ source.scala punctuation.section.block.begin.scala +> /** Creates a person with a given name and age. +#^^^^ source.scala comment.block.documentation.scala +# ^^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^^^^^ source.scala comment.block.documentation.scala +> * @param name their name +#^^^^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^ source.scala comment.block.documentation.scala +# ^^^^ source.scala comment.block.documentation.scala variable.parameter.scala +# ^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @param age the age of the person to create +#^^^^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^ source.scala comment.block.documentation.scala +# ^^^ source.scala comment.block.documentation.scala variable.parameter.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> */ +#^^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +> def apply(name: String, age: Int) = {} +#^^^^ source.scala +# ^^^ source.scala keyword.declaration.scala +# ^ source.scala +# ^^^^^ source.scala entity.name.function.declaration +# ^ source.scala meta.bracket.scala +# ^^^^ source.scala variable.parameter.scala +# ^ source.scala meta.colon.scala +# ^ source.scala +# ^^^^^^ source.scala storage.type.scala +# ^^ source.scala +# ^^^ source.scala variable.parameter.scala +# ^ source.scala meta.colon.scala +# ^ source.scala +# ^^^ source.scala storage.type.primitive.scala +# ^ source.scala meta.bracket.scala +# ^ source.scala +# ^ source.scala keyword.operator.comparison.scala +# ^ source.scala +# ^ source.scala punctuation.section.block.begin.scala +# ^ source.scala punctuation.section.block.end.scala +> +> /** Creates a person with a given name and birthdate +#^^^^ source.scala comment.block.documentation.scala +# ^^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^^^^^ source.scala comment.block.documentation.scala +> * @param name their name +#^^^^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^ source.scala comment.block.documentation.scala +# ^^^^ source.scala comment.block.documentation.scala variable.parameter.scala +# ^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @param birthDate the person's birthdate +#^^^^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^ source.scala comment.block.documentation.scala +# ^^^^^^^^^ source.scala comment.block.documentation.scala variable.parameter.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * @return a new Person instance with the age determined by the +#^^^^^^^^ source.scala comment.block.documentation.scala +# ^^^^^^^ source.scala comment.block.documentation.scala keyword.other.documentation.scaladoc.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * birthdate and current date. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> */ +#^^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +> def apply(name: String, birthDate: java.util.Date) = {} +#^^^^ source.scala +# ^^^ source.scala keyword.declaration.scala +# ^ source.scala +# ^^^^^ source.scala entity.name.function.declaration +# ^ source.scala meta.bracket.scala +# ^^^^ source.scala variable.parameter.scala +# ^ source.scala meta.colon.scala +# ^ source.scala +# ^^^^^^ source.scala storage.type.scala +# ^^ source.scala +# ^^^^^^^^^ source.scala variable.parameter.scala +# ^ source.scala meta.colon.scala +# ^ source.scala +# ^^^^^^^^^^ source.scala +# ^^^^ source.scala entity.name.class +# ^ source.scala meta.bracket.scala +# ^ source.scala +# ^ source.scala keyword.operator.comparison.scala +# ^ source.scala +# ^ source.scala punctuation.section.block.begin.scala +# ^ source.scala punctuation.section.block.end.scala +> } +#^^ source.scala +# ^ source.scala punctuation.section.block.end.scala +> +>/** Implicit conversions and helpers for [[mypackage.Complex]] instances. +#^^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala string.other.link.title.markdown +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^ source.scala comment.block.documentation.scala +> * {{{ +#^^^^^^^^ source.scala comment.block.documentation.scala +> * import ComplexImplicits._ +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * val c: Complex = 4 + 3.i +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * }}} +#^^^^^^^^ source.scala comment.block.documentation.scala +> */ +#^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +>object ComplexImplicits {} +#^^^^^^ source.scala keyword.declaration.scala +# ^ source.scala +# ^^^^^^^^^^^^^^^^ source.scala entity.name.class.declaration +# ^ source.scala +# ^ source.scala punctuation.section.block.begin.scala +# ^ source.scala punctuation.section.block.end.scala +> +>/** +#^^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +> * =Heading=, ==Sub-Heading== +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^^^ source.scala comment.block.documentation.scala +> * `monospace` +#^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * ''italic text'' +#^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * '''bold text''' +#^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * __underline__ +#^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * ^superscript^ +#^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * ,,subscript,, +#^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * [[entity link]], e.g. [[scala.collection.Seq]] +#^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^^ source.scala comment.block.documentation.scala string.other.link.title.markdown +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala string.other.link.title.markdown +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +> * [[http://external.link External Link]], +#^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala string.other.link.title.markdown +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^ source.scala comment.block.documentation.scala +> * e.g. [[http://scala-lang.org Scala Language Site]] +#^^^^^^^^^^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala string.other.link.title.markdown +# ^^ source.scala comment.block.documentation.scala punctuation.definition.documentation.link.scala +> * +#^^^^^^ source.scala comment.block.documentation.scala +> */ +#^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +>object Markup { +#^^^^^^ source.scala keyword.declaration.scala +# ^ source.scala +# ^^^^^^ source.scala entity.name.class.declaration +# ^ source.scala +# ^ source.scala punctuation.section.block.begin.scala +> /** Here is an unordered list: +#^^ source.scala comment.block.documentation.scala +# ^^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^^^ source.scala comment.block.documentation.scala +> * - First item +#^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * - Second item +#^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * - Sub-item to the second +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * - Another sub-item +#^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * - Third item +#^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^^ source.scala comment.block.documentation.scala +> * Here is an ordered list: +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * +#^^^^ source.scala comment.block.documentation.scala +> * 1. First numbered item +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * 1. Second numbered item +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * i. Sub-item to the second +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * i. Another sub-item +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> * 1. Third item +#^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.documentation.scala +> */ +#^^ source.scala comment.block.documentation.scala +# ^^ source.scala comment.block.documentation.scala punctuation.definition.comment.scala +> def lists = () +#^^ source.scala +# ^^^ source.scala keyword.declaration.scala +# ^ source.scala +# ^^^^^ source.scala entity.name.function.declaration +# ^ source.scala +# ^ source.scala keyword.operator.comparison.scala +# ^ source.scala +# ^^ source.scala meta.parentheses.scala meta.bracket.scala +>} +#^ source.scala punctuation.section.block.end.scala \ No newline at end of file From be15605de49de729a0c6760cd17f9184fbb43892 Mon Sep 17 00:00:00 2001 From: PanAeon Date: Tue, 25 Jun 2019 10:06:40 +0100 Subject: [PATCH 2/2] Commiting missing changes --- syntaxes/Scala.tmLanguage.json | 2 +- tests/snap/lexical.test.scala.snap | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/syntaxes/Scala.tmLanguage.json b/syntaxes/Scala.tmLanguage.json index 89ba97b..c8f78e1 100644 --- a/syntaxes/Scala.tmLanguage.json +++ b/syntaxes/Scala.tmLanguage.json @@ -1 +1 @@ -{"fileTypes":["scala"],"firstLineMatch":"^#!/.*\\b\\w*scala\\b","foldingStartMarker":"/\\*\\*|\\{\\s*$","foldingStopMarker":"\\*\\*/|^\\s*\\}","keyEquivalent":"^~S","repository":{"empty-parentheses":{"match":"(\\(\\))","captures":{"1":{"name":"meta.bracket.scala"}},"name":"meta.parentheses.scala"},"imports":{"end":"(?<=[\\n;])","begin":"\\b(import)\\s+","beginCaptures":{"1":{"name":"keyword.other.import.scala"}},"patterns":[{"include":"#comments"},{"match":"(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))","name":"entity.name.import.scala"},{"match":"\\.","name":"punctuation.definition.import"},{"end":"}","begin":"{","beginCaptures":{"0":{"name":"meta.bracket.scala"}},"patterns":[{"match":"(?x)\\s*(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))\\s*(=>)\\s*(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))\\s*","captures":{"1":{"name":"entity.name.import.renamed-from.scala"},"2":{"name":"keyword.other.arrow.scala"},"3":{"name":"entity.name.import.renamed-to.scala"}}},{"match":"([^\\s.,}]+)","name":"entity.name.import.scala"}],"endCaptures":{"0":{"name":"meta.bracket.scala"}},"name":"meta.import.selector.scala"}],"name":"meta.import.scala"},"constants":{"patterns":[{"match":"\\b(false|null|true|Nil|None)\\b","name":"constant.language.scala"},{"match":"\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.[0-9]+)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?|[0-9]+)([LlFfDd]|UL|ul)?\\b","name":"constant.numeric.scala"},{"match":"\\b(this|super|self)\\b","name":"variable.language.scala"},{"match":"\\b(Unit|Boolean|Byte|Char|Short|Int|Float|Long|Double)\\b","name":"storage.type.primitive.scala"},{"match":"\\b(String|Symbol)\\b","name":"storage.type.scala"}]},"block-comments":{"end":"\\*/","begin":"/\\*","patterns":[{"include":"#block-comments"},{"match":"(?x)(?! /\\*)(?! \\*/)"}],"name":"comment.block.scala"},"script-header":{"match":"^#!(.*)$","captures":{"1":{"name":"string.unquoted.shebang.scala"}},"name":"comment.block.shebang.scala"},"code":{"patterns":[{"include":"#script-header"},{"include":"#storage-modifiers"},{"include":"#declarations"},{"include":"#inheritance"},{"include":"#imports"},{"include":"#comments"},{"include":"#strings"},{"include":"#initialization"},{"include":"#xml-literal"},{"include":"#keywords"},{"include":"#constants"},{"include":"#scala-symbol"},{"include":"#scala-quoted"},{"include":"#char-literal"},{"include":"#empty-parentheses"},{"include":"#parameter-list"},{"include":"#qualifiedClassName"},{"include":"#meta-brackets"},{"include":"#meta-bounds"},{"include":"#meta-colons"}]},"strings":{"patterns":[{"end":"\"\"\"(?!\")","begin":"\"\"\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.scala"}},"patterns":[{"match":"\\\\\\\\|\\\\u[0-9A-Fa-f]{4}","name":"constant.character.escape.scala"}],"endCaptures":{"0":{"name":"punctuation.definition.string.end.scala"}},"name":"string.quoted.triple.scala"},{"begin":"\\b([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]+)(\"\"\")","end":"\"\"\"(?!\")","beginCaptures":{"1":{"name":"keyword.interpolation.scala"},"2":{"name":"string.quoted.triple.interpolated.scala punctuation.definition.string.begin.scala"}},"patterns":[{"include":"#string-interpolation"},{"match":"\\\\\\\\|\\\\u[0-9A-Fa-f]{4}","name":"constant.character.escape.scala"},{"match":".","name":"string.quoted.triple.interpolated.scala"}],"endCaptures":{"0":{"name":"string.quoted.triple.interpolated.scala punctuation.definition.string.end.scala"}}},{"end":"\"","begin":"\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.scala"}},"patterns":[{"match":"\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})","name":"constant.character.escape.scala"},{"match":"\\\\.","name":"invalid.illegal.unrecognized-string-escape.scala"}],"endCaptures":{"0":{"name":"punctuation.definition.string.end.scala"}},"name":"string.quoted.double.scala"},{"begin":"\\b([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]+)(\")","end":"\"","beginCaptures":{"1":{"name":"keyword.interpolation.scala"},"2":{"name":"string.quoted.double.interpolated.scala punctuation.definition.string.begin.scala"}},"patterns":[{"include":"#string-interpolation"},{"match":"\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})","name":"constant.character.escape.scala"},{"match":"\\\\.","name":"invalid.illegal.unrecognized-string-escape.scala"},{"match":".","name":"string.quoted.double.interpolated.scala"}],"endCaptures":{"0":{"name":"string.quoted.double.interpolated.scala punctuation.definition.string.end.scala"}}}]},"string-interpolation":{"patterns":[{"name":"constant.character.escape.interpolation.scala","match":"\\$\\$"},{"match":"(\\$)([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*)","captures":{"1":{"name":"punctuation.definition.template-expression.begin.scala"}}},{"name":"punctuation.definition.template-expression.scala","begin":"\\$\\{","beginCaptures":{"0":{"name":"punctuation.definition.template-expression.begin.scala"}},"end":"\\}","endCaptures":{"0":{"name":"punctuation.definition.template-expression.end.scala"}},"patterns":[{"include":"#code"}]}]},"xml-entity":{"match":"(&)([:a-zA-Z_][:a-zA-Z0-9_.-]*|#[0-9]+|#x[0-9a-fA-F]+)(;)","captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"name":"constant.character.entity.xml"},"xml-singlequotedString":{"end":"'","begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"patterns":[{"include":"#xml-entity"}],"endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.single.xml"},"meta-colons":{"patterns":[{"match":"(?=|<>|<|>)","name":"keyword.operator.comparison.scala"},{"match":"(\\-|\\+|\\*|/(?![/*])|%|~)","name":"keyword.operator.arithmetic.scala"},{"match":"(!|&&|\\|\\|)","name":"keyword.operator.logical.scala"},{"match":"(<-|←|->|→|=>|⇒|\\?|\\:+|@|\\|)+","name":"keyword.operator.scala"}]},"scala-quoted":{"match":"'\\{'|'\\('|'\\['|'\\{|'\\(|'\\[","name":"constant.other.quoted.scala"},"xml-doublequotedString":{"end":"\"","begin":"\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"patterns":[{"include":"#xml-entity"}],"endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.double.xml"},"declarations":{"patterns":[{"match":"(?x)\\b(def)\\s+(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))","captures":{"1":{"name":"keyword.declaration.scala"},"2":{"name":"entity.name.function.declaration"}}},{"match":"\\b(trait)\\s+([^\\s\\{\\(\\[]+)","captures":{"1":{"name":"keyword.declaration.scala"},"2":{"name":"entity.name.class.declaration"}}},{"match":"\\b(?:(case)\\s+)?(class|object)\\s+([^\\s\\{\\(\\[]+)","captures":{"1":{"name":"keyword.declaration.scala"},"2":{"name":"keyword.declaration.scala"},"3":{"name":"entity.name.class.declaration"}}},{"match":"\\b(type)\\s+(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))","captures":{"1":{"name":"keyword.declaration.scala"},"2":{"name":"entity.name.type.declaration"}}},{"match":"\\b(val)\\s+([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)\\b","captures":{"1":{"name":"keyword.declaration.stable.scala"},"2":{"name":"constant.other.declaration.scala"}}},{"match":"\\b(?:(val)|(var))\\s+(?:(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))|(?=\\())","captures":{"1":{"name":"keyword.declaration.stable.scala"},"2":{"name":"keyword.declaration.volatile.scala"},"3":{"name":"variable.other.declaration.scala"}}},{"match":"\\b(package)\\s+(object)\\s+([^\\s\\{\\(\\[]+)","captures":{"1":{"name":"keyword.other.scoping.scala"},"2":{"name":"keyword.declaration.scala"},"3":{"name":"entity.name.class.declaration"}}},{"end":"(?<=[\\n;])","begin":"\\b(package)\\s+","beginCaptures":{"1":{"name":"keyword.other.import.scala"}},"patterns":[{"include":"#comments"},{"match":"(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))","name":"entity.name.package.scala"},{"match":"\\.","name":"punctuation.definition.package"}],"name":"meta.package.scala"}]},"char-literal":{"end":"'","begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.character.begin.scala"}},"patterns":[{"match":"\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})","name":"constant.character.escape.scala"},{"match":"\\\\.","name":"invalid.illegal.unrecognized-character-escape.scala"},{"match":"[^']{2,}","name":"invalid.illegal.character-literal-too-long"},{"match":"(?'(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))(?!')","name":"constant.other.symbol.scala"},"meta-brackets":{"patterns":[{"match":"\\{","comment":"The punctuation.section.*.begin is needed for return snippet in source bundle","name":"punctuation.section.block.begin.scala"},{"match":"\\}","comment":"The punctuation.section.*.end is needed for return snippet in source bundle","name":"punctuation.section.block.end.scala"},{"match":"{|}|\\(|\\)|\\[|\\]","name":"meta.bracket.scala"}],"comment":"For themes: Brackets look nice when colored."},"qualifiedClassName":{"match":"(\\b([A-Z][\\w]*))","captures":{"1":{"name":"entity.name.class"}}},"storage-modifiers":{"patterns":[{"match":"\\b(private\\[\\S+\\]|protected\\[\\S+\\]|private|protected)\\b","name":"storage.modifier.access"},{"match":"\\b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|override|@transient|@native)\\b","name":"storage.modifier.other"}]},"meta-bounds":{"match":"<%|=:=|<:<|<%<|>:|<:","comment":"For themes: Matching view bounds","name":"meta.bounds.scala"},"comments":{"patterns":[{"match":"/\\*\\*/","captures":{"0":{"name":"punctuation.definition.comment.scala"}},"name":"comment.block.empty.scala"},{"end":"\\*/","begin":"^\\s*(/\\*\\*)(?!/)","beginCaptures":{"1":{"name":"punctuation.definition.comment.scala"}},"patterns":[{"match":"(@param)\\s+(\\S+)","captures":{"1":{"name":"keyword.other.documentation.scaladoc.scala"},"2":{"name":"variable.parameter.scala"}}},{"match":"(@(?:tparam|throws))\\s+(\\S+)","captures":{"1":{"name":"keyword.other.documentation.scaladoc.scala"},"2":{"name":"entity.name.class"}}},{"match":"@(return|see|note|example|usecase|author|version|since|todo|deprecated|migration|define|inheritdoc)\\b","name":"keyword.other.documentation.scaladoc.scala"},{"match":"(\\[\\[)([^\\]]+)(\\]\\])","captures":{"1":{"name":"punctuation.definition.documentation.link.scala"},"2":{"name":"entity.other.documentation.link.scala"},"3":{"name":"punctuation.definition.documentation.link.scala"}}}],"endCaptures":{"0":{"name":"punctuation.definition.comment.scala"}},"name":"comment.block.documentation.scala"},{"end":"\\*/","begin":"/\\*","captures":{"0":{"name":"punctuation.definition.comment.scala"}},"name":"comment.block.scala"},{"end":"(?!\\G)","begin":"(^[ \\t]+)?(?=//)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.scala"}},"patterns":[{"end":"\\n","begin":"//","beginCaptures":{"0":{"name":"punctuation.definition.comment.scala"}},"name":"comment.line.double-slash.scala"}]}]},"xml-embedded-content":{"patterns":[{"end":"}","begin":"{","patterns":[{"include":"#code"}],"captures":{"0":{"name":"meta.bracket.scala"}},"name":"meta.source.embedded.scala"},{"match":" (?:([-_a-zA-Z0-9]+)((:)))?([_a-zA-Z-]+)=","captures":{"1":{"name":"entity.other.attribute-name.namespace.xml"},"2":{"name":"entity.other.attribute-name.xml"},"3":{"name":"punctuation.separator.namespace.xml"},"4":{"name":"entity.other.attribute-name.localname.xml"}}},{"include":"#xml-doublequotedString"},{"include":"#xml-singlequotedString"}]},"inheritance":{"patterns":[{"match":"(extends|with)\\s+([^\\s\\{\\(\\[\\]]+)","captures":{"1":{"name":"keyword.declaration.scala"},"2":{"name":"entity.other.inherited-class.scala"}}}]},"parameter-list":{"patterns":[{"match":"(?<=[^\\._$a-zA-Z0-9])(`[^`]+`|[_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)\\s*(:)\\s+","captures":{"1":{"name":"variable.parameter.scala"},"2":{"name":"meta.colon.scala"}}}]},"xml-literal":{"patterns":[{"end":"(>(<))/(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]*[_a-zA-Z0-9])(>)","begin":"(<)((?:([_a-zA-Z0-9][_a-zA-Z0-9]*)((:)))?([_a-zA-Z0-9][-_a-zA-Z0-9:]*))(?=(\\s[^>]*)?>)","beginCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"3":{"name":"entity.name.tag.namespace.xml"},"4":{"name":"entity.name.tag.xml"},"5":{"name":"punctuation.separator.namespace.xml"},"6":{"name":"entity.name.tag.localname.xml"}},"patterns":[{"include":"#xml-embedded-content"}],"comment":"We do not allow a tag name to start with a - since this would likely conflict with the <- operator. This is not very common for tag names anyway. Also code such as -- if (val val3) will falsly be recognized as an xml tag. The solution is to put a space on either side of the comparison operator","endCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"meta.scope.between-tag-pair.xml"},"3":{"name":"entity.name.tag.namespace.xml"},"4":{"name":"entity.name.tag.xml"},"5":{"name":"punctuation.separator.namespace.xml"},"6":{"name":"entity.name.tag.localname.xml"},"7":{"name":"punctuation.definition.tag.xml"}},"name":"meta.tag.no-content.xml"},{"end":"(/?>)","begin":"(]*?>)","patterns":[{"include":"#xml-embedded-content"}],"captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.namespace.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"name":"meta.tag.xml"},{"include":"#xml-entity"}]}},"uuid":"158C0929-299A-40C8-8D89-316BE0C446E8","patterns":[{"include":"#code"}],"name":"Scala","scopeName":"source.scala"} +{"fileTypes":["scala"],"firstLineMatch":"^#!/.*\\b\\w*scala\\b","foldingStartMarker":"/\\*\\*|\\{\\s*$","foldingStopMarker":"\\*\\*/|^\\s*\\}","keyEquivalent":"^~S","repository":{"empty-parentheses":{"match":"(\\(\\))","captures":{"1":{"name":"meta.bracket.scala"}},"name":"meta.parentheses.scala"},"imports":{"end":"(?<=[\\n;])","begin":"\\b(import)\\s+","beginCaptures":{"1":{"name":"keyword.other.import.scala"}},"patterns":[{"include":"#comments"},{"match":"(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))","name":"entity.name.import.scala"},{"match":"\\.","name":"punctuation.definition.import"},{"end":"}","begin":"{","beginCaptures":{"0":{"name":"meta.bracket.scala"}},"patterns":[{"match":"(?x)\\s*(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))\\s*(=>)\\s*(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))\\s*","captures":{"1":{"name":"entity.name.import.renamed-from.scala"},"2":{"name":"keyword.other.arrow.scala"},"3":{"name":"entity.name.import.renamed-to.scala"}}},{"match":"([^\\s.,}]+)","name":"entity.name.import.scala"}],"endCaptures":{"0":{"name":"meta.bracket.scala"}},"name":"meta.import.selector.scala"}],"name":"meta.import.scala"},"constants":{"patterns":[{"match":"\\b(false|null|true|Nil|None)\\b","name":"constant.language.scala"},{"match":"\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.[0-9]+)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?|[0-9]+)([LlFfDd]|UL|ul)?\\b","name":"constant.numeric.scala"},{"match":"\\b(this|super|self)\\b","name":"variable.language.scala"},{"match":"\\b(Unit|Boolean|Byte|Char|Short|Int|Float|Long|Double)\\b","name":"storage.type.primitive.scala"},{"match":"\\b(String|Symbol)\\b","name":"storage.type.scala"}]},"script-header":{"match":"^#!(.*)$","captures":{"1":{"name":"string.unquoted.shebang.scala"}},"name":"comment.block.shebang.scala"},"code":{"patterns":[{"include":"#script-header"},{"include":"#storage-modifiers"},{"include":"#declarations"},{"include":"#inheritance"},{"include":"#imports"},{"include":"#comments"},{"include":"#strings"},{"include":"#initialization"},{"include":"#xml-literal"},{"include":"#keywords"},{"include":"#constants"},{"include":"#scala-symbol"},{"include":"#scala-quoted"},{"include":"#char-literal"},{"include":"#empty-parentheses"},{"include":"#parameter-list"},{"include":"#qualifiedClassName"},{"include":"#meta-brackets"},{"include":"#meta-bounds"},{"include":"#meta-colons"}]},"strings":{"patterns":[{"end":"\"\"\"(?!\")","begin":"\"\"\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.scala"}},"patterns":[{"match":"\\\\\\\\|\\\\u[0-9A-Fa-f]{4}","name":"constant.character.escape.scala"}],"endCaptures":{"0":{"name":"punctuation.definition.string.end.scala"}},"name":"string.quoted.triple.scala"},{"begin":"\\b([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]+)(\"\"\")","end":"\"\"\"(?!\")","beginCaptures":{"1":{"name":"keyword.interpolation.scala"},"2":{"name":"string.quoted.triple.interpolated.scala punctuation.definition.string.begin.scala"}},"patterns":[{"include":"#string-interpolation"},{"match":"\\\\\\\\|\\\\u[0-9A-Fa-f]{4}","name":"constant.character.escape.scala"},{"match":".","name":"string.quoted.triple.interpolated.scala"}],"endCaptures":{"0":{"name":"string.quoted.triple.interpolated.scala punctuation.definition.string.end.scala"}}},{"end":"\"","begin":"\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.scala"}},"patterns":[{"match":"\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})","name":"constant.character.escape.scala"},{"match":"\\\\.","name":"invalid.illegal.unrecognized-string-escape.scala"}],"endCaptures":{"0":{"name":"punctuation.definition.string.end.scala"}},"name":"string.quoted.double.scala"},{"begin":"\\b([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]+)(\")","end":"\"","beginCaptures":{"1":{"name":"keyword.interpolation.scala"},"2":{"name":"string.quoted.double.interpolated.scala punctuation.definition.string.begin.scala"}},"patterns":[{"include":"#string-interpolation"},{"match":"\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})","name":"constant.character.escape.scala"},{"match":"\\\\.","name":"invalid.illegal.unrecognized-string-escape.scala"},{"match":".","name":"string.quoted.double.interpolated.scala"}],"endCaptures":{"0":{"name":"string.quoted.double.interpolated.scala punctuation.definition.string.end.scala"}}}]},"string-interpolation":{"patterns":[{"name":"constant.character.escape.interpolation.scala","match":"\\$\\$"},{"match":"(\\$)([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*)","captures":{"1":{"name":"punctuation.definition.template-expression.begin.scala"}}},{"name":"punctuation.definition.template-expression.scala","begin":"\\$\\{","beginCaptures":{"0":{"name":"punctuation.definition.template-expression.begin.scala"}},"end":"\\}","endCaptures":{"0":{"name":"punctuation.definition.template-expression.end.scala"}},"patterns":[{"include":"#code"}]}]},"xml-entity":{"match":"(&)([:a-zA-Z_][:a-zA-Z0-9_.-]*|#[0-9]+|#x[0-9a-fA-F]+)(;)","captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"name":"constant.character.entity.xml"},"xml-singlequotedString":{"end":"'","begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"patterns":[{"include":"#xml-entity"}],"endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.single.xml"},"meta-colons":{"patterns":[{"match":"(?=|<>|<|>)","name":"keyword.operator.comparison.scala"},{"match":"(\\-|\\+|\\*|/(?![/*])|%|~)","name":"keyword.operator.arithmetic.scala"},{"match":"(!|&&|\\|\\|)","name":"keyword.operator.logical.scala"},{"match":"(<-|←|->|→|=>|⇒|\\?|\\:+|@|\\|)+","name":"keyword.operator.scala"}]},"scala-quoted":{"match":"'\\{'|'\\('|'\\['|'\\{|'\\(|'\\[","name":"constant.other.quoted.scala"},"xml-doublequotedString":{"end":"\"","begin":"\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"patterns":[{"include":"#xml-entity"}],"endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.double.xml"},"declarations":{"patterns":[{"match":"(?x)\\b(def)\\s+(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))","captures":{"1":{"name":"keyword.declaration.scala"},"2":{"name":"entity.name.function.declaration"}}},{"match":"\\b(trait)\\s+([^\\s\\{\\(\\[]+)","captures":{"1":{"name":"keyword.declaration.scala"},"2":{"name":"entity.name.class.declaration"}}},{"match":"\\b(?:(case)\\s+)?(class|object)\\s+([^\\s\\{\\(\\[]+)","captures":{"1":{"name":"keyword.declaration.scala"},"2":{"name":"keyword.declaration.scala"},"3":{"name":"entity.name.class.declaration"}}},{"match":"\\b(type)\\s+(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))","captures":{"1":{"name":"keyword.declaration.scala"},"2":{"name":"entity.name.type.declaration"}}},{"match":"\\b(val)\\s+([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)\\b","captures":{"1":{"name":"keyword.declaration.stable.scala"},"2":{"name":"constant.other.declaration.scala"}}},{"match":"\\b(?:(val)|(var))\\s+(?:(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))|(?=\\())","captures":{"1":{"name":"keyword.declaration.stable.scala"},"2":{"name":"keyword.declaration.volatile.scala"},"3":{"name":"variable.other.declaration.scala"}}},{"match":"\\b(package)\\s+(object)\\s+([^\\s\\{\\(\\[]+)","captures":{"1":{"name":"keyword.other.scoping.scala"},"2":{"name":"keyword.declaration.scala"},"3":{"name":"entity.name.class.declaration"}}},{"end":"(?<=[\\n;])","begin":"\\b(package)\\s+","beginCaptures":{"1":{"name":"keyword.other.import.scala"}},"patterns":[{"include":"#comments"},{"match":"(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))","name":"entity.name.package.scala"},{"match":"\\.","name":"punctuation.definition.package"}],"name":"meta.package.scala"}]},"char-literal":{"end":"'","begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.character.begin.scala"}},"patterns":[{"match":"\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})","name":"constant.character.escape.scala"},{"match":"\\\\.","name":"invalid.illegal.unrecognized-character-escape.scala"},{"match":"[^']{2,}","name":"invalid.illegal.character-literal-too-long"},{"match":"(?'(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))(?!')","name":"constant.other.symbol.scala"},"meta-brackets":{"patterns":[{"match":"\\{","comment":"The punctuation.section.*.begin is needed for return snippet in source bundle","name":"punctuation.section.block.begin.scala"},{"match":"\\}","comment":"The punctuation.section.*.end is needed for return snippet in source bundle","name":"punctuation.section.block.end.scala"},{"match":"{|}|\\(|\\)|\\[|\\]","name":"meta.bracket.scala"}],"comment":"For themes: Brackets look nice when colored."},"qualifiedClassName":{"match":"(\\b([A-Z][\\w]*))","captures":{"1":{"name":"entity.name.class"}}},"storage-modifiers":{"patterns":[{"match":"\\b(private\\[\\S+\\]|protected\\[\\S+\\]|private|protected)\\b","name":"storage.modifier.access"},{"match":"\\b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|override|@transient|@native)\\b","name":"storage.modifier.other"}]},"meta-bounds":{"match":"<%|=:=|<:<|<%<|>:|<:","comment":"For themes: Matching view bounds","name":"meta.bounds.scala"},"comments":{"patterns":[{"match":"/\\*\\*/","captures":{"0":{"name":"punctuation.definition.comment.scala"}},"name":"comment.block.empty.scala"},{"end":"\\*/","begin":"^\\s*(/\\*\\*)(?!/)","beginCaptures":{"1":{"name":"punctuation.definition.comment.scala"}},"patterns":[{"match":"(@param)\\s+(\\S+)","captures":{"1":{"name":"keyword.other.documentation.scaladoc.scala"},"2":{"name":"variable.parameter.scala"}}},{"match":"(@(?:tparam|throws))\\s+(\\S+)","captures":{"1":{"name":"keyword.other.documentation.scaladoc.scala"},"2":{"name":"entity.name.class"}}},{"match":"@(return|see|note|example|constructor|usecase|author|version|since|todo|deprecated|migration|define|inheritdoc)\\b","name":"keyword.other.documentation.scaladoc.scala"},{"match":"(\\[\\[)([^\\]]+)(\\]\\])","captures":{"1":{"name":"punctuation.definition.documentation.link.scala"},"2":{"name":"string.other.link.title.markdown"},"3":{"name":"punctuation.definition.documentation.link.scala"}}},{"include":"#comments"}],"endCaptures":{"0":{"name":"punctuation.definition.comment.scala"}},"name":"comment.block.documentation.scala"},{"end":"\\*/","begin":"/\\*","captures":{"0":{"name":"punctuation.definition.comment.scala"}},"patterns":[{"include":"#comments"}],"name":"comment.block.scala"},{"end":"(?!\\G)","begin":"(^[ \\t]+)?(?=//)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.scala"}},"patterns":[{"end":"\\n","begin":"//","beginCaptures":{"0":{"name":"punctuation.definition.comment.scala"}},"name":"comment.line.double-slash.scala"}]}]},"xml-embedded-content":{"patterns":[{"end":"}","begin":"{","patterns":[{"include":"#code"}],"captures":{"0":{"name":"meta.bracket.scala"}},"name":"meta.source.embedded.scala"},{"match":" (?:([-_a-zA-Z0-9]+)((:)))?([_a-zA-Z-]+)=","captures":{"1":{"name":"entity.other.attribute-name.namespace.xml"},"2":{"name":"entity.other.attribute-name.xml"},"3":{"name":"punctuation.separator.namespace.xml"},"4":{"name":"entity.other.attribute-name.localname.xml"}}},{"include":"#xml-doublequotedString"},{"include":"#xml-singlequotedString"}]},"inheritance":{"patterns":[{"match":"(extends|with)\\s+([^\\s\\{\\(\\[\\]]+)","captures":{"1":{"name":"keyword.declaration.scala"},"2":{"name":"entity.other.inherited-class.scala"}}}]},"parameter-list":{"patterns":[{"match":"(?<=[^\\._$a-zA-Z0-9])(`[^`]+`|[_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)\\s*(:)\\s+","captures":{"1":{"name":"variable.parameter.scala"},"2":{"name":"meta.colon.scala"}}}]},"xml-literal":{"patterns":[{"end":"(>(<))/(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]*[_a-zA-Z0-9])(>)","begin":"(<)((?:([_a-zA-Z0-9][_a-zA-Z0-9]*)((:)))?([_a-zA-Z0-9][-_a-zA-Z0-9:]*))(?=(\\s[^>]*)?>)","beginCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"3":{"name":"entity.name.tag.namespace.xml"},"4":{"name":"entity.name.tag.xml"},"5":{"name":"punctuation.separator.namespace.xml"},"6":{"name":"entity.name.tag.localname.xml"}},"patterns":[{"include":"#xml-embedded-content"}],"comment":"We do not allow a tag name to start with a - since this would likely conflict with the <- operator. This is not very common for tag names anyway. Also code such as -- if (val val3) will falsly be recognized as an xml tag. The solution is to put a space on either side of the comparison operator","endCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"meta.scope.between-tag-pair.xml"},"3":{"name":"entity.name.tag.namespace.xml"},"4":{"name":"entity.name.tag.xml"},"5":{"name":"punctuation.separator.namespace.xml"},"6":{"name":"entity.name.tag.localname.xml"},"7":{"name":"punctuation.definition.tag.xml"}},"name":"meta.tag.no-content.xml"},{"end":"(/?>)","begin":"(]*?>)","patterns":[{"include":"#xml-embedded-content"}],"captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.namespace.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"name":"meta.tag.xml"},{"include":"#xml-entity"}]}},"uuid":"158C0929-299A-40C8-8D89-316BE0C446E8","patterns":[{"include":"#code"}],"name":"Scala","scopeName":"source.scala"} diff --git a/tests/snap/lexical.test.scala.snap b/tests/snap/lexical.test.scala.snap index 0733526..c158997 100644 --- a/tests/snap/lexical.test.scala.snap +++ b/tests/snap/lexical.test.scala.snap @@ -416,11 +416,12 @@ > /* nested /* multi-line */ comment */ #^^^ source.scala # ^^ source.scala comment.block.scala punctuation.definition.comment.scala -# ^^^^^^^^^^^^^^^^^^^^^^^ source.scala comment.block.scala -# ^^ source.scala comment.block.scala punctuation.definition.comment.scala -# ^^^^^^^^^ source.scala -# ^ source.scala keyword.operator.arithmetic.scala -# ^ source.scala keyword.operator.arithmetic.scala +# ^^^^^^^^^ source.scala comment.block.scala +# ^^ source.scala comment.block.scala comment.block.scala punctuation.definition.comment.scala +# ^^^^^^^^^^^^ source.scala comment.block.scala comment.block.scala +# ^^ source.scala comment.block.scala comment.block.scala punctuation.definition.comment.scala +# ^^^^^^^^^ source.scala comment.block.scala +# ^^ source.scala comment.block.scala punctuation.definition.comment.scala > > >object Xml {