From 05b2628da574df8d1ffc983a770b7009e52e5858 Mon Sep 17 00:00:00 2001 From: extr0py Date: Wed, 12 Jul 2017 10:47:42 -0700 Subject: [PATCH 1/7] Bump typescript and ts-loader versions --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c3630a81a5..779a06455e 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "omnisharp-client": "7.0.6", "q": "1.4.1", "tslint": "4.0.2", - "typescript": "2.2.1" + "typescript": "2.4.1" }, "devDependencies": { "@types/classnames": "0.0.32", @@ -145,7 +145,7 @@ "sinon": "1.17.6", "spectron": "3.6.2", "style-loader": "0.13.1", - "ts-loader": "1.2.2", + "ts-loader": "2.2.2", "vscode-jsonrpc": "3.3.1", "vscode-languageserver-types": "3.3.0", "wcwidth": "1.0.1", From 8a745a499b8b59d9667e764facb89a86fc04c76a Mon Sep 17 00:00:00 2001 From: extr0py Date: Wed, 12 Jul 2017 10:59:44 -0700 Subject: [PATCH 2/7] Update egisterLanguageService to be consistent between the Oni implementation and the definition --- definitions/Oni.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/Oni.d.ts b/definitions/Oni.d.ts index eb9ed3f61a..5505e602db 100644 --- a/definitions/Oni.d.ts +++ b/definitions/Oni.d.ts @@ -160,7 +160,7 @@ declare namespace Oni { editor: Editor statusBar: StatusBar - registerLanguageService(languageType: string, languageService: LanguageService) + registerLanguageService(languageService: LanguageService) clearHighlights(file: string, key: string) setHighlights(file: string, key: string, highlights: SyntaxHighlight[]) From 30f238cf2b3db8fdffd5df4a778c96e32d0199b1 Mon Sep 17 00:00:00 2001 From: extr0py Date: Wed, 12 Jul 2017 11:05:46 -0700 Subject: [PATCH 3/7] Fix typing in Oni and LanguageClient --- browser/src/Plugins/Api/Oni.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/src/Plugins/Api/Oni.ts b/browser/src/Plugins/Api/Oni.ts index 552e1961ea..600f0b1626 100644 --- a/browser/src/Plugins/Api/Oni.ts +++ b/browser/src/Plugins/Api/Oni.ts @@ -10,7 +10,7 @@ import { Editor } from "./Editor" import { StatusBar } from "./StatusBar" import { DebouncedLanguageService } from "./DebouncedLanguageService" -import { InitializationParamsCreator, LanguageClient } from "./LanguageClient/LanguageClient" +import { InitializationParamsCreator, LanguageClient, ServerRunOptions } from "./LanguageClient/LanguageClient" const react = require("react") // tslint:disable-line no-var-requires @@ -72,8 +72,8 @@ export class Oni extends EventEmitter implements Oni.Plugin.Api { }) } - public createLanguageClient(initializationCommand: string, initializationParamsCreator: InitializationParamsCreator): LanguageClient { - return new LanguageClient(initializationCommand, initializationParamsCreator, this) + public createLanguageClient(startOptions: ServerRunOptions, initializationParamsCreator: InitializationParamsCreator): LanguageClient { + return new LanguageClient(startOptions, initializationParamsCreator, this) } public registerLanguageService(languageService: Oni.Plugin.LanguageService): void { From 903ccfb99704ce9acc660090eab3543a1cd2899d Mon Sep 17 00:00:00 2001 From: extr0py Date: Wed, 12 Jul 2017 11:24:15 -0700 Subject: [PATCH 4/7] Temporarily use 'any' type --- browser/src/UI/components/AutoCompletion.tsx | 2 +- browser/src/UI/components/BufferScrollBar.tsx | 4 ++-- browser/src/UI/components/Cursor.tsx | 2 +- browser/src/UI/components/CursorLine.tsx | 2 +- browser/src/UI/components/LiveEvalMarker.tsx | 2 +- browser/src/UI/components/Logs.tsx | 2 +- browser/src/UI/components/QuickInfo.tsx | 4 ++-- package.json | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/browser/src/UI/components/AutoCompletion.tsx b/browser/src/UI/components/AutoCompletion.tsx index 7d447c9f5f..eadeca2984 100644 --- a/browser/src/UI/components/AutoCompletion.tsx +++ b/browser/src/UI/components/AutoCompletion.tsx @@ -31,7 +31,7 @@ export class AutoCompletion extends React.Component return null } - const containerStyle = { + const containerStyle: any = { position: "absolute", top: this.props.y.toString() + "px", left: this.props.x.toString() + "px", diff --git a/browser/src/UI/components/BufferScrollBar.tsx b/browser/src/UI/components/BufferScrollBar.tsx index 53f58fda14..927089e3b4 100644 --- a/browser/src/UI/components/BufferScrollBar.tsx +++ b/browser/src/UI/components/BufferScrollBar.tsx @@ -37,7 +37,7 @@ export class BufferScrollBar extends React.PureComponent { const width = isNormalMode ? this.props.width : this.props.width / 4 const characterToShow = isNormalMode ? this.props.character : "" - const cursorStyle = { + const cursorStyle: any = { position: "absolute", left: this.props.x.toString() + "px", top: this.props.y.toString() + "px", diff --git a/browser/src/UI/components/CursorLine.tsx b/browser/src/UI/components/CursorLine.tsx index 481ad2d7f6..cad0f6bc19 100644 --- a/browser/src/UI/components/CursorLine.tsx +++ b/browser/src/UI/components/CursorLine.tsx @@ -27,7 +27,7 @@ class CursorLineRenderer extends React.Component const width = this.props.width - const cursorStyle = { + const cursorStyle: any = { position: "absolute", left: this.props.x.toString() + "px", // Window Start top: this.props.y.toString() + "px", // Same as cursor diff --git a/browser/src/UI/components/LiveEvalMarker.tsx b/browser/src/UI/components/LiveEvalMarker.tsx index 1ef9bed308..a50d0f646d 100644 --- a/browser/src/UI/components/LiveEvalMarker.tsx +++ b/browser/src/UI/components/LiveEvalMarker.tsx @@ -49,7 +49,7 @@ export class LiveEvalMarker extends React.Component const cssClasses = classNames("live-eval-marker", { "evaluating": this._isEvaluating() }, { "error": this._hasError() }) - const positionDivStyles = { + const positionDivStyles: any = { position: "absolute", top: this.props.y.toString() + "px", right: "0px", diff --git a/browser/src/UI/components/Logs.tsx b/browser/src/UI/components/Logs.tsx index d7292d2f71..c8c2ebf235 100644 --- a/browser/src/UI/components/Logs.tsx +++ b/browser/src/UI/components/Logs.tsx @@ -26,7 +26,7 @@ export class LogsRenderer extends React.Component { // TODO copy details to clipboard if (!this.props.visible) { return null } - const maxHeightStyle = { + const maxHeightStyle: any = { "height": "25vh", "maxHeight": "25vh", "overflow": "auto", diff --git a/browser/src/UI/components/QuickInfo.tsx b/browser/src/UI/components/QuickInfo.tsx index 9f4732f432..81e9673e56 100644 --- a/browser/src/UI/components/QuickInfo.tsx +++ b/browser/src/UI/components/QuickInfo.tsx @@ -24,7 +24,7 @@ export class QuickInfo extends React.Component { const openFromTop = this.props.openFromTop || false - const containerStyle = { + const containerStyle: any = { position: "absolute", top: this.props.y.toString() + "px", left: this.props.x.toString() + "px", @@ -46,7 +46,7 @@ export class QuickInfo extends React.Component { "bottom": "0px", } - const innerStyle = openFromTop ? openFromTopStyle : openFromBottomStyle + const innerStyle: any = openFromTop ? openFromTopStyle : openFromBottomStyle return
diff --git a/package.json b/package.json index 779a06455e..08c97319c6 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "@types/mocha": "2.2.33", "@types/node": "6.0.48", "@types/q": "0.0.32", - "@types/react": "0.14.48", + "@types/react": "15.0.30", "@types/react-dom": "0.14.18", "@types/react-redux": "4.4.38", "@types/sinon": "1.16.32", From f3e26e49f84230f08a145e1f05bd546f329d5559 Mon Sep 17 00:00:00 2001 From: extr0py Date: Wed, 12 Jul 2017 11:27:10 -0700 Subject: [PATCH 5/7] Change first instance of any -> React.CSSProperties --- browser/src/UI/components/AutoCompletion.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/src/UI/components/AutoCompletion.tsx b/browser/src/UI/components/AutoCompletion.tsx index eadeca2984..c4482146b8 100644 --- a/browser/src/UI/components/AutoCompletion.tsx +++ b/browser/src/UI/components/AutoCompletion.tsx @@ -31,7 +31,7 @@ export class AutoCompletion extends React.Component return null } - const containerStyle: any = { + const containerStyle: React.CSSProperties = { position: "absolute", top: this.props.y.toString() + "px", left: this.props.x.toString() + "px", From 31cbc82db18a83bd7c5aa6f6ab1bcc69196355fc Mon Sep 17 00:00:00 2001 From: extr0py Date: Wed, 12 Jul 2017 11:42:39 -0700 Subject: [PATCH 6/7] Fix any typing --- browser/src/UI/components/BufferScrollBar.tsx | 4 ++-- browser/src/UI/components/Cursor.tsx | 2 +- browser/src/UI/components/CursorLine.tsx | 2 +- browser/src/UI/components/LiveEvalMarker.tsx | 2 +- browser/src/UI/components/Logs.tsx | 2 +- browser/src/UI/components/QuickInfo.tsx | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/browser/src/UI/components/BufferScrollBar.tsx b/browser/src/UI/components/BufferScrollBar.tsx index 927089e3b4..51f9ba68eb 100644 --- a/browser/src/UI/components/BufferScrollBar.tsx +++ b/browser/src/UI/components/BufferScrollBar.tsx @@ -37,7 +37,7 @@ export class BufferScrollBar extends React.PureComponent { const width = isNormalMode ? this.props.width : this.props.width / 4 const characterToShow = isNormalMode ? this.props.character : "" - const cursorStyle: any = { + const cursorStyle: React.CSSProperties = { position: "absolute", left: this.props.x.toString() + "px", top: this.props.y.toString() + "px", diff --git a/browser/src/UI/components/CursorLine.tsx b/browser/src/UI/components/CursorLine.tsx index cad0f6bc19..fd8d9766cc 100644 --- a/browser/src/UI/components/CursorLine.tsx +++ b/browser/src/UI/components/CursorLine.tsx @@ -27,7 +27,7 @@ class CursorLineRenderer extends React.Component const width = this.props.width - const cursorStyle: any = { + const cursorStyle: React.CSSProperties = { position: "absolute", left: this.props.x.toString() + "px", // Window Start top: this.props.y.toString() + "px", // Same as cursor diff --git a/browser/src/UI/components/LiveEvalMarker.tsx b/browser/src/UI/components/LiveEvalMarker.tsx index a50d0f646d..835549b6aa 100644 --- a/browser/src/UI/components/LiveEvalMarker.tsx +++ b/browser/src/UI/components/LiveEvalMarker.tsx @@ -49,7 +49,7 @@ export class LiveEvalMarker extends React.Component const cssClasses = classNames("live-eval-marker", { "evaluating": this._isEvaluating() }, { "error": this._hasError() }) - const positionDivStyles: any = { + const positionDivStyles: React.CSSProperties = { position: "absolute", top: this.props.y.toString() + "px", right: "0px", diff --git a/browser/src/UI/components/Logs.tsx b/browser/src/UI/components/Logs.tsx index c8c2ebf235..ef0402b9cb 100644 --- a/browser/src/UI/components/Logs.tsx +++ b/browser/src/UI/components/Logs.tsx @@ -26,7 +26,7 @@ export class LogsRenderer extends React.Component { // TODO copy details to clipboard if (!this.props.visible) { return null } - const maxHeightStyle: any = { + const maxHeightStyle: React.CSSProperties = { "height": "25vh", "maxHeight": "25vh", "overflow": "auto", diff --git a/browser/src/UI/components/QuickInfo.tsx b/browser/src/UI/components/QuickInfo.tsx index 81e9673e56..d095aa77d4 100644 --- a/browser/src/UI/components/QuickInfo.tsx +++ b/browser/src/UI/components/QuickInfo.tsx @@ -24,7 +24,7 @@ export class QuickInfo extends React.Component { const openFromTop = this.props.openFromTop || false - const containerStyle: any = { + const containerStyle: React.CSSProperties = { position: "absolute", top: this.props.y.toString() + "px", left: this.props.x.toString() + "px", @@ -46,7 +46,7 @@ export class QuickInfo extends React.Component { "bottom": "0px", } - const innerStyle: any = openFromTop ? openFromTopStyle : openFromBottomStyle + const innerStyle: React.CSSProperties = openFromTop ? openFromTopStyle : openFromBottomStyle return
From cc38de16594c9de752369cb05a27d3d5c4323f03 Mon Sep 17 00:00:00 2001 From: extr0py Date: Wed, 12 Jul 2017 11:48:20 -0700 Subject: [PATCH 7/7] Fix typing in QuickInfo --- browser/src/UI/components/QuickInfo.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/src/UI/components/QuickInfo.tsx b/browser/src/UI/components/QuickInfo.tsx index d095aa77d4..b65b52590d 100644 --- a/browser/src/UI/components/QuickInfo.tsx +++ b/browser/src/UI/components/QuickInfo.tsx @@ -30,18 +30,18 @@ export class QuickInfo extends React.Component { left: this.props.x.toString() + "px", } - const innerCommonStyle = { + const innerCommonStyle: React.CSSProperties = { "position": "absolute", "opacity": this.props.visible ? 1 : 0, "max-width": (document.body.offsetWidth - this.props.x - 40) + "px", } - const openFromTopStyle = { + const openFromTopStyle: React.CSSProperties = { ...innerCommonStyle, "top": "0px", } - const openFromBottomStyle = { + const openFromBottomStyle: React.CSSProperties = { ...innerCommonStyle, "bottom": "0px", }