Skip to content

Commit

Permalink
Add missing tests and messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom1729 committed Oct 29, 2021
1 parent 298bd2d commit eabfe28
Show file tree
Hide file tree
Showing 4 changed files with 218 additions and 1 deletion.
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"install": "messages/install.md",
"2.0.0": "messages/2.0.0.md",
"4.0.0": "messages/4.0.0.md",
"4.1.0": "messages/4.1.0.md"
"4.1.0": "messages/4.1.0.md",
"4.2.1": "messages/4.2.1.md"
}
26 changes: 26 additions & 0 deletions messages/4.2.1.md
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`.
5 changes: 5 additions & 0 deletions tests/syntax_test_suites/js/js_not_typescript.js
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 tests/syntax_test_suites/typescript/typescript_declarations.d.ts
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

0 comments on commit eabfe28

Please sign in to comment.