Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Fix #519 - Upgrade to TypeScript 2.4.1 (#535)
Browse files Browse the repository at this point in the history
* Bump typescript and ts-loader versions

* Update 
egisterLanguageService to be consistent between the Oni implementation and the definition

* Fix typing in Oni and LanguageClient

* Temporarily use 'any' type

* Change first instance of any -> React.CSSProperties

* Fix any typing

* Fix typing in QuickInfo
  • Loading branch information
extr0py authored Jul 12, 2017
1 parent 2daad92 commit f3ed138
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions browser/src/Plugins/Api/Oni.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion browser/src/UI/components/AutoCompletion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class AutoCompletion extends React.Component<IAutoCompletionProps, void>
return null
}

const containerStyle = {
const containerStyle: React.CSSProperties = {
position: "absolute",
top: this.props.y.toString() + "px",
left: this.props.x.toString() + "px",
Expand Down
4 changes: 2 additions & 2 deletions browser/src/UI/components/BufferScrollBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class BufferScrollBar extends React.PureComponent<IBufferScrollBarProps,
const windowHeight = ((this.props.windowBottomLine - this.props.windowTopLine + 1) / this.props.bufferSize) * this.props.height
const windowTop = ((this.props.windowTopLine - 1) / this.props.bufferSize) * this.props.height

const windowStyle = {
const windowStyle: React.CSSProperties = {
top: windowTop + "px",
height: windowHeight + "px",
}
Expand All @@ -49,7 +49,7 @@ export class BufferScrollBar extends React.PureComponent<IBufferScrollBarProps,
const pos = (line / this.props.bufferSize) * this.props.height
const size = "2px"

const markerStyle = {
const markerStyle: React.CSSProperties = {
position: "absolute",
top: pos + "px",
height: size,
Expand Down
2 changes: 1 addition & 1 deletion browser/src/UI/components/Cursor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CursorRenderer extends React.Component<ICursorProps, void> {
const width = isNormalMode ? this.props.width : this.props.width / 4
const characterToShow = isNormalMode ? this.props.character : ""

const cursorStyle = {
const cursorStyle: React.CSSProperties = {
position: "absolute",
left: this.props.x.toString() + "px",
top: this.props.y.toString() + "px",
Expand Down
2 changes: 1 addition & 1 deletion browser/src/UI/components/CursorLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CursorLineRenderer extends React.Component<ICursorLineRendererProps, void>

const width = this.props.width

const cursorStyle = {
const cursorStyle: React.CSSProperties = {
position: "absolute",
left: this.props.x.toString() + "px", // Window Start
top: this.props.y.toString() + "px", // Same as cursor
Expand Down
2 changes: 1 addition & 1 deletion browser/src/UI/components/LiveEvalMarker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class LiveEvalMarker extends React.Component<ILiveEvalMarkerProps, void>

const cssClasses = classNames("live-eval-marker", { "evaluating": this._isEvaluating() }, { "error": this._hasError() })

const positionDivStyles = {
const positionDivStyles: React.CSSProperties = {
position: "absolute",
top: this.props.y.toString() + "px",
right: "0px",
Expand Down
2 changes: 1 addition & 1 deletion browser/src/UI/components/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class LogsRenderer extends React.Component<ILogsProps, void> {
// TODO copy details to clipboard
if (!this.props.visible) { return null }

const maxHeightStyle = {
const maxHeightStyle: React.CSSProperties = {
"height": "25vh",
"maxHeight": "25vh",
"overflow": "auto",
Expand Down
10 changes: 5 additions & 5 deletions browser/src/UI/components/QuickInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ export class QuickInfo extends React.Component<IQuickInfoProps, void> {

const openFromTop = this.props.openFromTop || false

const containerStyle = {
const containerStyle: React.CSSProperties = {
position: "absolute",
top: this.props.y.toString() + "px",
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",
}

const innerStyle = openFromTop ? openFromTopStyle : openFromBottomStyle
const innerStyle: React.CSSProperties = openFromTop ? openFromTopStyle : openFromBottomStyle

return <div key={"quickinfo-container"} className="quickinfo-container enable-mouse" style={containerStyle}>
<div key={"quickInfo"} style={innerStyle} className="quickinfo">
Expand Down
2 changes: 1 addition & 1 deletion definitions/Oni.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[])
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit f3ed138

Please sign in to comment.