Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions JavaScript/JavaScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ contexts:
push: line-comment-double-slash-body

line-comment-end:
- match: (//+)?\n
- match: (//+)?$\n?
captures:
1: punctuation.definition.comment.js
pop: 1
Expand Down Expand Up @@ -1434,7 +1434,7 @@ contexts:
string-content:
- match: \\\n
scope: constant.character.escape.newline.js
- match: \\(?:x\h\h|u\h\h\h\h|.)
- match: \\(?:x\h{2}|u\h{4}|.)
scope: constant.character.escape.js

string-interpolations:
Expand Down
18 changes: 17 additions & 1 deletion JavaScript/tests/syntax_test_typescript_declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
// ^^ storage.modifier
// ^^^^^^^^^ keyword.declaration
// ^ entity.name.namespace
// @ definition
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty

export const x: any;
// ^^^^^^^^^^^^^^^^^^^^ meta.export
// ^^^^^^ keyword.control.import-export
// ^^^^^ keyword.declaration
// ^ meta.binding.name variable.other.readwrite
// @ global-definition
// ^ punctuation.separator.type
// ^^^ meta.type support.type.any
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty
Expand All @@ -22,6 +24,7 @@
// ^^^^^^ keyword.control.import-export
// ^^^ keyword.declaration
// ^ meta.binding.name variable.other.readwrite
// @ global-definition
// ^ punctuation.separator.type
// ^^^ meta.type support.type.any
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty
Expand All @@ -31,6 +34,7 @@
// ^^^^^^ keyword.control.import-export
// ^^^ keyword.declaration
// ^ meta.binding.name variable.other.readwrite
// @ global-definition
// ^ punctuation.separator.type
// ^^^ meta.type support.type.any
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty
Expand All @@ -41,6 +45,7 @@
// ^^^^^^^^^^^^^^^^^^^^^^^ meta.function
// ^^^^^^^^ keyword.declaration.function
// ^ entity.name.function
// @ definition
// ^^^^^^^^ meta.function.parameters
// ^ punctuation.section.group.begin
// ^ meta.binding.name variable.parameter.function
Expand All @@ -57,8 +62,9 @@
// ^^^^^^^^^ meta.class
// ^^^^^ keyword.declaration.class
// ^ entity.name.class
// @ definition
// ^ meta.block punctuation.section.block.begin

x: any;
// ^ variable.other.readwrite
// ^ punctuation.separator.type
Expand All @@ -69,6 +75,7 @@
f(x: any): any;
// ^^^^^^^^^^^^^^ meta.function
// ^ entity.name.function
// @ definition
// ^^^^^^^^ meta.function.parameters
// ^ punctuation.section.group.begin
// ^ meta.binding.name
Expand All @@ -90,6 +97,7 @@
// ^^^^^^^^^^^^^^ meta.interface
// ^^^^^^^^^ keyword.declaration
// ^ entity.name.interface
// @ definition
// ^^ meta.block
// ^ punctuation.section.block.begin
// ^ punctuation.section.block.end
Expand All @@ -101,12 +109,14 @@
// ^^^^^^^^^^^^^ meta.namespace
// ^^^^^^^^^ keyword.declaration
// ^ entity.name.namespace
// @ definition
// ^ meta.block punctuation.section.block.begin

const x: any;
// ^^^^^ keyword.declaration
// ^ meta.binding.name
// ^ variable.other.readwrite
// @ global-definition
// ^ punctuation.separator.type
// ^^^^ meta.type
// ^^^ support.type.any
Expand Down Expand Up @@ -147,6 +157,7 @@
// ^^^^^^^^^^^^^^^^^^^^^^^ meta.function
// ^^^^^^^^ keyword.declaration.function
// ^ entity.name.function
// @ definition
// ^^^^^^^^ meta.function.parameters
// ^ punctuation.section.group.begin
// ^ meta.binding.name variable.parameter.function
Expand All @@ -164,6 +175,7 @@
// ^^^^^^^^^^ meta.class
// ^^^^^ keyword.declaration.class
// ^ entity.name.class
// @ definition
// ^^ meta.block
// ^ punctuation.section.block.begin
// ^ punctuation.section.block.end
Expand All @@ -173,6 +185,7 @@
// ^^^^^^^^^^^^^^ meta.namespace
// ^^^^^^^^^ keyword.declaration
// ^ entity.name.namespace
// @ definition
// ^^ meta.block
// ^ punctuation.section.block.begin
// ^ punctuation.section.block.end
Expand All @@ -182,13 +195,15 @@
// ^^^^^^^^^^^^^^^^ meta.module
// ^^^^^^ keyword.declaration.module
// ^^^^^^ entity.name.module.js
// @@@@@@ definition
// ^^ meta.block

declare module 'module' {}
// ^^^^^^^ storage.modifier
// ^^^^^^^^^^^^^^^^^^ meta.module
// ^^^^^^ keyword.declaration.module
// ^^^^^^^^ entity.name.module.js
// @@@@@@@@ definition "module"
// ^ punctuation.definition.quoted.begin.js
// ^ punctuation.definition.quoted.end.js
// ^^ meta.block
Expand All @@ -198,6 +213,7 @@
// ^^^^^^^^^^^^^^^^^^ meta.module
// ^^^^^^ keyword.declaration.module
// ^^^^^^^^ entity.name.module.js
// @@@@@@@@ definition "module"
// ^ punctuation.definition.quoted.begin.js
// ^ punctuation.definition.quoted.end.js
// ^^ meta.block
Loading