Skip to content

Commit 202c720

Browse files
committed
Merge branch 'master' of https://github.com/Microsoft/TypeScript-Sublime-Plugin into fixSyntaxIssues
2 parents 771d0a8 + 6f52208 commit 202c720

24 files changed

+44563
-6386
lines changed

Default.sublime-keymap

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,6 @@
7373
{ "key": "selector", "operator": "equal", "operand": "text.find-refs" }
7474
]
7575
},
76-
{
77-
"keys": [ "alt+,"],
78-
"command": "typescript_signature_popup",
79-
"context": [
80-
{ "key": "selector", "operator": "equal", "operand": "source.ts" },
81-
{ "key": "tooltip_supported", "operator": "equal", "operand": true}
82-
83-
]
84-
},
8576
{
8677
"keys": [ "ctrl+t", "ctrl+q" ],
8778
"command": "typescript_quick_info_doc",
@@ -137,54 +128,12 @@
137128
]
138129
}, // In case when auto match is enabled, only format if not within {}
139130
{
140-
"keys": [ "}" ],
141-
"command": "typescript_format_on_key",
142-
"args": { "key": "}" },
131+
"keys": [ "alt+,"],
132+
"command": "typescript_signature_popup",
143133
"context": [
144134
{ "key": "selector", "operator": "equal", "operand": "source.ts" },
145-
{ "key": "setting.typescript_auto_format", "operator": "equal", "operand": true },
146-
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
147-
{ "key": "num_selections", "operator": "equal", "operand": 1},
148-
{ "key": "selection_empty", "operator": "equal", "operand": true },
135+
{ "key": "tooltip_supported", "operator": "equal", "operand": true}
149136

150-
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "\\{$" },
151-
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^\\}" }
152-
]
153-
},
154-
// In case when auto match is disabled, format the block regardless
155-
{
156-
"keys": [ "}" ],
157-
"command": "typescript_format_on_key",
158-
"args": { "key": "}" },
159-
"context": [
160-
{ "key": "num_selections", "operator": "equal", "operand": 1},
161-
{ "key": "setting.typescript_auto_format", "operator": "equal", "operand": true },
162-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
163-
{ "key": "selector", "operator": "equal", "operand": "source.ts" },
164-
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": false }
165-
]
166-
},
167-
{
168-
"keys": [ ";" ],
169-
"command": "typescript_format_on_key",
170-
"args": { "key": ";" },
171-
"context": [
172-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
173-
{ "key": "setting.typescript_auto_format", "operator": "equal", "operand": true },
174-
{ "key": "selector", "operator": "equal", "operand": "source.ts" }
175-
]
176-
},
177-
{
178-
"keys": [ "enter" ],
179-
"command": "typescript_format_on_key",
180-
"args": { "key": "\n" },
181-
"context": [
182-
{ "key": "setting.typescript_auto_indent", "operator": "equal", "operand": true },
183-
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
184-
{ "key": "selector", "operator": "not_equal", "operand": "meta.scope.between-tag-pair" },
185-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
186-
{ "key": "num_selections", "operator": "equal", "operand": 1},
187-
{ "key": "selector", "operator": "equal", "operand": "source.ts" }
188137
]
189138
},
190139
{

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
TypeScript Plugin for Sublime Text
22
==================================
33

4+
[![Join the chat at https://gitter.im/Microsoft/TypeScript-Sublime-Plugin](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Microsoft/TypeScript-Sublime-Plugin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5+
46
The plugin uses an IO wrapper around the TypeScript language services to provide
57
an enhanced Sublime Text experience when working with TypeScript code.
68

TypeScript.sublime-build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"target": "typescript_build",
3+
"selector": "source.ts"
4+
}

TypeScript.sublime-commands

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
{ "caption" : "TypeScript: Rename", "command": "typescript_rename" },
1111
{ "caption" : "TypeScript: PasteAndFormat", "command": "typescript_paste_and_format" },
1212
{ "caption" : "TypeScript: FormatLine", "command": "typescript_format_line" },
13+
{ "caption" : "TypeScript: SignatureInfo", "command": "typescript_signature_popup" },
1314
{ "caption" : "TypeScript: FormatBlock", "command": "typescript_format_brackets" }
1415
]

snippets/get-()-{}.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public get ${1:value}() : ${2:string} {
44
${3:return }
55
}
66
]]></content>
7-
<tabTrigger>get</tabTrigger>
7+
<tabTrigger>getter</tabTrigger>
88
<scope>source.ts</scope>
99
<description>get-property …</description>
1010
</snippet>

snippets/log.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<snippet>
22
<content><![CDATA[console.log($1);
33
$0]]></content>
4-
<tabTrigger>log</tabTrigger>
4+
<tabTrigger>clog</tabTrigger>
55
<scope>source.ts</scope>
66
<description>console log</description>
77
</snippet>

snippets/set-()-{}.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public set ${1:value}(v : ${2:string}) {
44
this.${3:_value} = v;
55
}
66
]]></content>
7-
<tabTrigger>set</tabTrigger>
7+
<tabTrigger>setter</tabTrigger>
88
<scope>source.ts</scope>
99
<description>set-property …</description>
1010
</snippet>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<snippet>
22
<content><![CDATA[setTimeout(() => {$0}${2:}, ${1:500});]]></content>
3-
<tabTrigger>timeout</tabTrigger>
3+
<tabTrigger>tout</tabTrigger>
44
<scope>source.ts</scope>
55
<description>setTimeout function</description>
66
</snippet>

tsserver/lib.d.ts

Lines changed: 156 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ interface Math {
561561
*/
562562
atan(x: number): number;
563563
/**
564-
* Returns the angle (in radians) from the X axis to a point (y,x).
564+
* Returns the angle (in radians) from the X axis to a point.
565565
* @param y A numeric expression representing the cartesian y-coordinate.
566566
* @param x A numeric expression representing the cartesian x-coordinate.
567567
*/
@@ -1231,6 +1231,139 @@ interface ArrayBufferView {
12311231
byteOffset: number;
12321232
}
12331233

1234+
interface DataView {
1235+
buffer: ArrayBuffer;
1236+
byteLength: number;
1237+
byteOffset: number;
1238+
/**
1239+
* Gets the Float32 value at the specified byte offset from the start of the view. There is
1240+
* no alignment constraint; multi-byte values may be fetched from any offset.
1241+
* @param byteOffset The place in the buffer at which the value should be retrieved.
1242+
*/
1243+
getFloat32(byteOffset: number, littleEndian: boolean): number;
1244+
1245+
/**
1246+
* Gets the Float64 value at the specified byte offset from the start of the view. There is
1247+
* no alignment constraint; multi-byte values may be fetched from any offset.
1248+
* @param byteOffset The place in the buffer at which the value should be retrieved.
1249+
*/
1250+
getFloat64(byteOffset: number, littleEndian: boolean): number;
1251+
1252+
/**
1253+
* Gets the Int8 value at the specified byte offset from the start of the view. There is
1254+
* no alignment constraint; multi-byte values may be fetched from any offset.
1255+
* @param byteOffset The place in the buffer at which the value should be retrieved.
1256+
*/
1257+
getInt8(byteOffset: number): number;
1258+
1259+
/**
1260+
* Gets the Int16 value at the specified byte offset from the start of the view. There is
1261+
* no alignment constraint; multi-byte values may be fetched from any offset.
1262+
* @param byteOffset The place in the buffer at which the value should be retrieved.
1263+
*/
1264+
getInt16(byteOffset: number, littleEndian: boolean): number;
1265+
/**
1266+
* Gets the Int32 value at the specified byte offset from the start of the view. There is
1267+
* no alignment constraint; multi-byte values may be fetched from any offset.
1268+
* @param byteOffset The place in the buffer at which the value should be retrieved.
1269+
*/
1270+
getInt32(byteOffset: number, littleEndian: boolean): number;
1271+
1272+
/**
1273+
* Gets the Uint8 value at the specified byte offset from the start of the view. There is
1274+
* no alignment constraint; multi-byte values may be fetched from any offset.
1275+
* @param byteOffset The place in the buffer at which the value should be retrieved.
1276+
*/
1277+
getUint8(byteOffset: number): number;
1278+
1279+
/**
1280+
* Gets the Uint16 value at the specified byte offset from the start of the view. There is
1281+
* no alignment constraint; multi-byte values may be fetched from any offset.
1282+
* @param byteOffset The place in the buffer at which the value should be retrieved.
1283+
*/
1284+
getUint16(byteOffset: number, littleEndian: boolean): number;
1285+
1286+
/**
1287+
* Gets the Uint32 value at the specified byte offset from the start of the view. There is
1288+
* no alignment constraint; multi-byte values may be fetched from any offset.
1289+
* @param byteOffset The place in the buffer at which the value should be retrieved.
1290+
*/
1291+
getUint32(byteOffset: number, littleEndian: boolean): number;
1292+
1293+
/**
1294+
* Stores an Float32 value at the specified byte offset from the start of the view.
1295+
* @param byteOffset The place in the buffer at which the value should be set.
1296+
* @param value The value to set.
1297+
* @param littleEndian If false or undefined, a big-endian value should be written,
1298+
* otherwise a little-endian value should be written.
1299+
*/
1300+
setFloat32(byteOffset: number, value: number, littleEndian: boolean): void;
1301+
1302+
/**
1303+
* Stores an Float64 value at the specified byte offset from the start of the view.
1304+
* @param byteOffset The place in the buffer at which the value should be set.
1305+
* @param value The value to set.
1306+
* @param littleEndian If false or undefined, a big-endian value should be written,
1307+
* otherwise a little-endian value should be written.
1308+
*/
1309+
setFloat64(byteOffset: number, value: number, littleEndian: boolean): void;
1310+
1311+
/**
1312+
* Stores an Int8 value at the specified byte offset from the start of the view.
1313+
* @param byteOffset The place in the buffer at which the value should be set.
1314+
* @param value The value to set.
1315+
*/
1316+
setInt8(byteOffset: number, value: number): void;
1317+
1318+
/**
1319+
* Stores an Int16 value at the specified byte offset from the start of the view.
1320+
* @param byteOffset The place in the buffer at which the value should be set.
1321+
* @param value The value to set.
1322+
* @param littleEndian If false or undefined, a big-endian value should be written,
1323+
* otherwise a little-endian value should be written.
1324+
*/
1325+
setInt16(byteOffset: number, value: number, littleEndian: boolean): void;
1326+
1327+
/**
1328+
* Stores an Int32 value at the specified byte offset from the start of the view.
1329+
* @param byteOffset The place in the buffer at which the value should be set.
1330+
* @param value The value to set.
1331+
* @param littleEndian If false or undefined, a big-endian value should be written,
1332+
* otherwise a little-endian value should be written.
1333+
*/
1334+
setInt32(byteOffset: number, value: number, littleEndian: boolean): void;
1335+
1336+
/**
1337+
* Stores an Uint8 value at the specified byte offset from the start of the view.
1338+
* @param byteOffset The place in the buffer at which the value should be set.
1339+
* @param value The value to set.
1340+
*/
1341+
setUint8(byteOffset: number, value: number): void;
1342+
1343+
/**
1344+
* Stores an Uint16 value at the specified byte offset from the start of the view.
1345+
* @param byteOffset The place in the buffer at which the value should be set.
1346+
* @param value The value to set.
1347+
* @param littleEndian If false or undefined, a big-endian value should be written,
1348+
* otherwise a little-endian value should be written.
1349+
*/
1350+
setUint16(byteOffset: number, value: number, littleEndian: boolean): void;
1351+
1352+
/**
1353+
* Stores an Uint32 value at the specified byte offset from the start of the view.
1354+
* @param byteOffset The place in the buffer at which the value should be set.
1355+
* @param value The value to set.
1356+
* @param littleEndian If false or undefined, a big-endian value should be written,
1357+
* otherwise a little-endian value should be written.
1358+
*/
1359+
setUint32(byteOffset: number, value: number, littleEndian: boolean): void;
1360+
}
1361+
1362+
interface DataViewConstructor {
1363+
new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView;
1364+
}
1365+
declare var DataView: DataViewConstructor;
1366+
12341367
/**
12351368
* A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
12361369
* number of bytes could not be allocated an exception is raised.
@@ -7222,6 +7355,8 @@ interface HTMLCanvasElement extends HTMLElement {
72227355
* Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.
72237356
* @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl");
72247357
*/
7358+
getContext(contextId: "2d"): CanvasRenderingContext2D;
7359+
getContext(contextId: "experimental-webgl"): WebGLRenderingContext;
72257360
getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext;
72267361
/**
72277362
* Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing.
@@ -11200,10 +11335,10 @@ declare var MediaQueryList: {
1120011335
interface MediaSource extends EventTarget {
1120111336
activeSourceBuffers: SourceBufferList;
1120211337
duration: number;
11203-
readyState: string;
11338+
readyState: number;
1120411339
sourceBuffers: SourceBufferList;
1120511340
addSourceBuffer(type: string): SourceBuffer;
11206-
endOfStream(error?: string): void;
11341+
endOfStream(error?: number): void;
1120711342
removeSourceBuffer(sourceBuffer: SourceBuffer): void;
1120811343
}
1120911344

@@ -11932,7 +12067,7 @@ declare var PopStateEvent: {
1193212067

1193312068
interface Position {
1193412069
coords: Coordinates;
11935-
timestamp: Date;
12070+
timestamp: number;
1193612071
}
1193712072

1193812073
declare var Position: {
@@ -14613,9 +14748,17 @@ interface WebGLRenderingContext {
1461314748
stencilMaskSeparate(face: number, mask: number): void;
1461414749
stencilOp(fail: number, zfail: number, zpass: number): void;
1461514750
stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void;
14751+
texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void;
14752+
texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void;
14753+
texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void;
14754+
texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void;
1461614755
texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void;
1461714756
texParameterf(target: number, pname: number, param: number): void;
1461814757
texParameteri(target: number, pname: number, param: number): void;
14758+
texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void;
14759+
texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void;
14760+
texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void;
14761+
texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void;
1461914762
texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void;
1462014763
uniform1f(location: WebGLUniformLocation, x: number): void;
1462114764
uniform1fv(location: WebGLUniformLocation, v: any): void;
@@ -15703,6 +15846,7 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {
1570315846
overrideMimeType(mime: string): void;
1570415847
send(data?: Document): void;
1570515848
send(data?: string): void;
15849+
send(data?: any): void;
1570615850
setRequestHeader(header: string, value: string): void;
1570715851
DONE: number;
1570815852
HEADERS_RECEIVED: number;
@@ -15854,14 +15998,17 @@ interface DocumentEvent {
1585415998
createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent;
1585515999
createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent;
1585616000
createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent;
16001+
createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent;
1585716002
createEvent(eventInterface:"CloseEvent"): CloseEvent;
1585816003
createEvent(eventInterface:"CommandEvent"): CommandEvent;
1585916004
createEvent(eventInterface:"CompositionEvent"): CompositionEvent;
16005+
createEvent(eventInterface:"CustomEvent"): CustomEvent;
1586016006
createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent;
1586116007
createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent;
1586216008
createEvent(eventInterface:"DragEvent"): DragEvent;
1586316009
createEvent(eventInterface:"ErrorEvent"): ErrorEvent;
1586416010
createEvent(eventInterface:"Event"): Event;
16011+
createEvent(eventInterface:"Events"): Event;
1586516012
createEvent(eventInterface:"FocusEvent"): FocusEvent;
1586616013
createEvent(eventInterface:"GamepadEvent"): GamepadEvent;
1586716014
createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent;
@@ -15876,8 +16023,10 @@ interface DocumentEvent {
1587616023
createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent;
1587716024
createEvent(eventInterface:"MessageEvent"): MessageEvent;
1587816025
createEvent(eventInterface:"MouseEvent"): MouseEvent;
16026+
createEvent(eventInterface:"MouseEvents"): MouseEvent;
1587916027
createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent;
1588016028
createEvent(eventInterface:"MutationEvent"): MutationEvent;
16029+
createEvent(eventInterface:"MutationEvents"): MutationEvent;
1588116030
createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent;
1588216031
createEvent(eventInterface:"NavigationEvent"): NavigationEvent;
1588316032
createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer;
@@ -15888,13 +16037,15 @@ interface DocumentEvent {
1588816037
createEvent(eventInterface:"PopStateEvent"): PopStateEvent;
1588916038
createEvent(eventInterface:"ProgressEvent"): ProgressEvent;
1589016039
createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent;
16040+
createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent;
1589116041
createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent;
1589216042
createEvent(eventInterface:"StorageEvent"): StorageEvent;
1589316043
createEvent(eventInterface:"TextEvent"): TextEvent;
1589416044
createEvent(eventInterface:"TouchEvent"): TouchEvent;
1589516045
createEvent(eventInterface:"TrackEvent"): TrackEvent;
1589616046
createEvent(eventInterface:"TransitionEvent"): TransitionEvent;
1589716047
createEvent(eventInterface:"UIEvent"): UIEvent;
16048+
createEvent(eventInterface:"UIEvents"): UIEvent;
1589816049
createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent;
1589916050
createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent;
1590016051
createEvent(eventInterface:"WheelEvent"): WheelEvent;
@@ -16486,6 +16637,7 @@ declare function addEventListener(type: "volumechange", listener: (ev: Event) =>
1648616637
declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
1648716638
declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
1648816639
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
16640+
1648916641
/////////////////////////////
1649016642
/// WorkerGlobalScope APIs
1649116643
/////////////////////////////

0 commit comments

Comments
 (0)