Update extensions for TS 2.7

Update src to build with TS 2.7

Explicitly assign this.message in the else body
This commit is contained in:
Matt Bierner
2018-02-07 12:51:49 -08:00
parent d2d18a47fd
commit 308c1887df
17 changed files with 64 additions and 69 deletions

View File

@@ -30,7 +30,7 @@ export default class LanguageProvider {
private _validate: boolean = true;
private _documentSelector: DocumentFilter[];
private _documentSelector?: DocumentFilter[];
private readonly disposables: Disposable[] = [];
private readonly versionDependentDisposables: Disposable[] = [];

View File

@@ -11,7 +11,7 @@ export interface Lazy<T> {
class LazyValue<T> implements Lazy<T> {
private _hasValue: boolean = false;
private _value: T;
private _value?: T;
constructor(
private readonly _getValue: () => T
@@ -22,7 +22,7 @@ class LazyValue<T> implements Lazy<T> {
this._hasValue = true;
this._value = this._getValue();
}
return this._value;
return this._value!;
}
get hasValue(): boolean {

View File

@@ -10,7 +10,7 @@ import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
export default class Logger {
private _output: OutputChannel;
private _output?: OutputChannel;
private get output(): OutputChannel {
if (!this._output) {

View File

@@ -28,7 +28,7 @@ const fileLimit = 500;
class ExcludeHintItem {
public configFileName?: string;
private _item: vscode.StatusBarItem;
private _currentHint: Hint;
private _currentHint?: Hint;
constructor(
private readonly telemetryReporter: TelemetryReporter
@@ -38,7 +38,7 @@ class ExcludeHintItem {
}
public getCurrentHint(): Hint {
return this._currentHint;
return this._currentHint!;
}
public hide() {

View File

@@ -13,8 +13,8 @@ interface IPackageInfo {
}
export default class TelemetryReporter {
private _packageInfo: IPackageInfo | null;
private _reporter: VsCodeTelemetryReporter | null;
private _packageInfo: IPackageInfo | null = null;
private _reporter: VsCodeTelemetryReporter | null = null;
dispose() {
if (this._reporter) {

View File

@@ -32,7 +32,7 @@ namespace Trace {
}
export default class Tracer {
private trace: Trace;
private trace?: Trace;
constructor(
private readonly logger: Logger