-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
218 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
v4.2.0 (2021-10-29) | ||
------------------- | ||
|
||
- Implement arrow function type parameters in TypeScript and Flow (#29, #125). | ||
- Add a new command, “JS Custom — Report Syntax Issue With Current File”, to pre-fill a GitHub issue template. | ||
- Add a new option, “first_line_match”. | ||
- If a configuration specifies a nonexistent top-level option, then raise an error when building the syntax. | ||
|
||
## Upstream changes | ||
|
||
- Implement `static` blocks. (https://github.com/sublimehq/Packages/pull/2954) | ||
- Correctly scope methods that are template tags. (https://github.com/sublimehq/Packages/pull/2998) | ||
- Give an extra `native` scope to lowercase JSX/TSX tags. (https://github.com/sublimehq/Packages/pull/3000) | ||
- Implement TypeScript arrow function type parameters. (https://github.com/sublimehq/Packages/pull/2923, https://github.com/sublimehq/Packages/pull/2994) | ||
- Improvements to TypeScript exports/declarations. (https://github.com/sublimehq/Packages/pull/3061, https://github.com/sublimehq/Packages/pull/3068, https://github.com/sublimehq/Packages/pull/3085) | ||
- Implement quotes member names in object types. (https://github.com/sublimehq/Packages/pull/3022) | ||
- Implement triple-slash directives in TypeScript. (https://github.com/sublimehq/Packages/pull/3018) | ||
- Fix a TypeScript bug with generic array types. (https://github.com/sublimehq/Packages/pull/3063) | ||
- Fix a TypeScript bug with function types. (https://github.com/sublimehq/Packages/pull/3062) | ||
- Fix a TSX corner case for the ternary operator. (https://github.com/sublimehq/Packages/pull/2930) | ||
- Optimize a regexp. (https://github.com/sublimehq/Packages/pull/3071) | ||
- Fix some test compatibility issues. (https://github.com/sublimehq/Packages/pull/2987, https://github.com/sublimehq/Packages/pull/3104, https://github.com/sublimehq/Packages/pull/3106) | ||
|
||
## Internal changes | ||
|
||
- The core TSX extension now has code of its own, so JS Custom will load it if a configuration specifies both `jsx` and `typescript`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// SYNTAX TEST "Packages/JavaScript/JavaScript.sublime-syntax" | ||
|
||
/// <foo bar="baz"/> | ||
// <- comment.line.triple-slash.js punctuation.definition.comment.js | ||
//^^^^^^^^^^^^^^^^^^^ comment.line.triple-slash.js - meta.preprocessor |
185 changes: 185 additions & 0 deletions
185
tests/syntax_test_suites/typescript/typescript_declarations.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
// SYNTAX TEST "Packages/JavaScript/TypeScript.sublime-syntax" | ||
|
||
export as namespace O; | ||
// ^^^^^^^^^^^^^^^^^^^^^ meta.export | ||
// ^^^^^^ keyword.control.import-export | ||
// ^^ storage.modifier | ||
// ^^^^^^^^^ keyword.declaration | ||
// ^ entity.name.namespace | ||
// ^ 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 | ||
// ^ punctuation.separator.type | ||
// ^^^ meta.type support.type.any | ||
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty | ||
|
||
export let y: any; | ||
// ^^^^^^^^^^^^^^^^^^ meta.export | ||
// ^^^^^^ keyword.control.import-export | ||
// ^^^ keyword.declaration | ||
// ^ meta.binding.name variable.other.readwrite | ||
// ^ punctuation.separator.type | ||
// ^^^ meta.type support.type.any | ||
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty | ||
|
||
export var z: any; | ||
// ^^^^^^^^^^^^^^^^^^ meta.export | ||
// ^^^^^^ keyword.control.import-export | ||
// ^^^ keyword.declaration | ||
// ^ meta.binding.name variable.other.readwrite | ||
// ^ punctuation.separator.type | ||
// ^^^ meta.type support.type.any | ||
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty | ||
|
||
export function f(x: any): any; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.export | ||
// ^^^^^^ keyword.control.import-export | ||
// ^^^^^^^^^^^^^^^^^^^^^^^ meta.function | ||
// ^^^^^^^^ keyword.declaration.function | ||
// ^ entity.name.function | ||
// ^^^^^^^^ meta.function.parameters | ||
// ^ punctuation.section.group.begin | ||
// ^ meta.binding.name variable.parameter.function | ||
// ^ punctuation.separator.type | ||
// ^^^ meta.type support.type.any | ||
// ^ punctuation.section.group.end | ||
// ^ punctuation.separator.type | ||
// ^^^ meta.type support.type.any | ||
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty | ||
|
||
export class C { | ||
// ^^^^^^^^^^^^^^^^ meta.export | ||
// ^^^^^^ keyword.control.import-export | ||
// ^^^^^^^^^ meta.class | ||
// ^^^^^ keyword.declaration.class | ||
// ^ entity.name.class | ||
// ^ meta.block punctuation.section.block.begin | ||
|
||
x: any; | ||
// ^ variable.other.readwrite | ||
// ^ punctuation.separator.type | ||
// ^^^^ meta.type | ||
// ^^^ support.type.any | ||
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty | ||
|
||
f(x: any): any; | ||
// ^^^^^^^^^^^^^^ meta.function | ||
// ^ entity.name.function | ||
// ^^^^^^^^ meta.function.parameters | ||
// ^ punctuation.section.group.begin | ||
// ^ meta.binding.name | ||
// ^ variable.parameter.function | ||
// ^ punctuation.separator.type | ||
// ^^^^ meta.type | ||
// ^^^ support.type.any | ||
// ^ punctuation.section.group.end | ||
// ^ punctuation.separator.type | ||
// ^^^^ meta.type | ||
// ^^^ support.type.any | ||
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty | ||
} | ||
// ^ punctuation.section.block.end | ||
|
||
export interface I {} | ||
// ^^^^^^^^^^^^^^^^^^^^^ meta.export | ||
// ^^^^^^ keyword.control.import-export | ||
// ^^^^^^^^^^^^^^ meta.interface | ||
// ^^^^^^^^^ keyword.declaration | ||
// ^ entity.name.interface | ||
// ^^ meta.block | ||
// ^ punctuation.section.block.begin | ||
// ^ punctuation.section.block.end | ||
|
||
|
||
export namespace N { | ||
// ^^^^^^^^^^^^^^^^^^^^ meta.export | ||
// ^^^^^^ keyword.control.import-export | ||
// ^^^^^^^^^^^^^ meta.namespace | ||
// ^^^^^^^^^ keyword.declaration | ||
// ^ entity.name.namespace | ||
// ^ meta.block punctuation.section.block.begin | ||
|
||
const x: any; | ||
// ^^^^^ keyword.declaration | ||
// ^ meta.binding.name | ||
// ^ variable.other.readwrite | ||
// ^ punctuation.separator.type | ||
// ^^^^ meta.type | ||
// ^^^ support.type.any | ||
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty | ||
|
||
} | ||
// ^ punctuation.section.block.end | ||
|
||
declare const a: any; | ||
// ^^^^^^^ storage.modifier | ||
// ^^^^^ keyword.declaration | ||
// ^ meta.binding.name variable.other.readwrite | ||
// ^ punctuation.separator.type | ||
// ^^^^ meta.type | ||
// ^^^ support.type.any | ||
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty | ||
|
||
declare let b: any; | ||
// ^^^^^^^ storage.modifier | ||
// ^^^ keyword.declaration | ||
// ^ meta.binding.name variable.other.readwrite | ||
// ^ punctuation.separator.type | ||
// ^^^^ meta.type | ||
// ^^^ support.type.any | ||
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty | ||
|
||
declare var c: any; | ||
// ^^^^^^^ storage.modifier | ||
// ^^^ keyword.declaration | ||
// ^ meta.binding.name variable.other.readwrite | ||
// ^ punctuation.separator.type | ||
// ^^^^ meta.type | ||
// ^^^ support.type.any | ||
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty | ||
|
||
declare function g(x: any): any; | ||
// ^^^^^^^ storage.modifier | ||
// ^^^^^^^^^^^^^^^^^^^^^^^ meta.function | ||
// ^^^^^^^^ keyword.declaration.function | ||
// ^ entity.name.function | ||
// ^^^^^^^^ meta.function.parameters | ||
// ^ punctuation.section.group.begin | ||
// ^ meta.binding.name variable.parameter.function | ||
// ^ punctuation.separator.type | ||
// ^^^^ meta.type | ||
// ^^^ support.type.any | ||
// ^ punctuation.section.group.end | ||
// ^ punctuation.separator.type | ||
// ^^^^ meta.type | ||
// ^^^ support.type.any | ||
// ^ punctuation.terminator.statement - punctuation.terminator.statement.empty | ||
|
||
declare class D {} | ||
// ^^^^^^^ storage.modifier | ||
// ^^^^^^^^^^ meta.class | ||
// ^^^^^ keyword.declaration.class | ||
// ^ entity.name.class | ||
// ^^ meta.block | ||
// ^ punctuation.section.block.begin | ||
// ^ punctuation.section.block.end | ||
|
||
declare namespace M {} | ||
// ^^^^^^^ storage.modifier | ||
// ^^^^^^^^^^^^^^ meta.namespace | ||
// ^^^^^^^^^ keyword.declaration | ||
// ^ entity.name.namespace | ||
// ^^ meta.block | ||
// ^ punctuation.section.block.begin | ||
// ^ punctuation.section.block.end | ||
|
||
declare module 'module' {} | ||
// ^^^^^^^ storage.modifier | ||
// ^^^^^^^^^^^^^^^^^^ meta.module | ||
// ^^^^^^ keyword.declaration.module | ||
// ^^^^^^^^ meta.string string.quoted.single | ||
// ^^ meta.block |