Enable strict in a few more extensions
This commit is contained in:
parent
de137dd8b8
commit
cd00b590a8
|
@ -19,7 +19,7 @@ const decoration = vscode.window.createTextEditorDecorationType({
|
||||||
|
|
||||||
let pendingLaunchJsonDecoration: NodeJS.Timer;
|
let pendingLaunchJsonDecoration: NodeJS.Timer;
|
||||||
|
|
||||||
export function activate(context): void {
|
export function activate(context: vscode.ExtensionContext): void {
|
||||||
|
|
||||||
//keybindings.json command-suggestions
|
//keybindings.json command-suggestions
|
||||||
context.subscriptions.push(registerKeybindingsCompletions());
|
context.subscriptions.push(registerKeybindingsCompletions());
|
||||||
|
|
|
@ -149,7 +149,7 @@ export class SettingsDocument {
|
||||||
return Promise.resolve(completions);
|
return Promise.resolve(completions);
|
||||||
}
|
}
|
||||||
|
|
||||||
private provideLanguageCompletionItems(location: Location, range: vscode.Range, formatFunc: (string) => string = (l) => JSON.stringify(l)): vscode.ProviderResult<vscode.CompletionItem[]> {
|
private provideLanguageCompletionItems(location: Location, range: vscode.Range, formatFunc: (string: string) => string = (l) => JSON.stringify(l)): vscode.ProviderResult<vscode.CompletionItem[]> {
|
||||||
return vscode.languages.getLanguages().then(languages => {
|
return vscode.languages.getLanguages().then(languages => {
|
||||||
return languages.map(l => {
|
return languages.map(l => {
|
||||||
return this.newSimpleCompletionItem(formatFunc(l), range);
|
return this.newSimpleCompletionItem(formatFunc(l), range);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"lib": [
|
"lib": [
|
||||||
"es2015"
|
"es2015"
|
||||||
],
|
],
|
||||||
"strictNullChecks": true
|
"strict": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*"
|
"src/**/*"
|
||||||
|
|
|
@ -43,38 +43,38 @@ export default class CommandHandler implements vscode.Disposable {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private registerTextEditorCommand(command: string, cb: (editor: vscode.TextEditor, ...args) => Promise<void>) {
|
private registerTextEditorCommand(command: string, cb: (editor: vscode.TextEditor, ...args: any[]) => Promise<void>) {
|
||||||
return vscode.commands.registerCommand(command, (...args) => {
|
return vscode.commands.registerCommand(command, (...args) => {
|
||||||
const editor = vscode.window.activeTextEditor;
|
const editor = vscode.window.activeTextEditor;
|
||||||
return editor && cb.call(this, editor, ...args);
|
return editor && cb.call(this, editor, ...args);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptCurrent(editor: vscode.TextEditor, ...args): Promise<void> {
|
acceptCurrent(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||||
return this.accept(interfaces.CommitType.Current, editor, ...args);
|
return this.accept(interfaces.CommitType.Current, editor, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptIncoming(editor: vscode.TextEditor, ...args): Promise<void> {
|
acceptIncoming(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||||
return this.accept(interfaces.CommitType.Incoming, editor, ...args);
|
return this.accept(interfaces.CommitType.Incoming, editor, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptBoth(editor: vscode.TextEditor, ...args): Promise<void> {
|
acceptBoth(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||||
return this.accept(interfaces.CommitType.Both, editor, ...args);
|
return this.accept(interfaces.CommitType.Both, editor, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptAllCurrent(editor: vscode.TextEditor, ...args): Promise<void> {
|
acceptAllCurrent(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||||
return this.acceptAll(interfaces.CommitType.Current, editor);
|
return this.acceptAll(interfaces.CommitType.Current, editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptAllIncoming(editor: vscode.TextEditor, ...args): Promise<void> {
|
acceptAllIncoming(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||||
return this.acceptAll(interfaces.CommitType.Incoming, editor);
|
return this.acceptAll(interfaces.CommitType.Incoming, editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptAllBoth(editor: vscode.TextEditor, ...args): Promise<void> {
|
acceptAllBoth(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||||
return this.acceptAll(interfaces.CommitType.Both, editor);
|
return this.acceptAll(interfaces.CommitType.Both, editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
async compare(editor: vscode.TextEditor, conflict: interfaces.IDocumentMergeConflict | null, ...args) {
|
async compare(editor: vscode.TextEditor, conflict: interfaces.IDocumentMergeConflict | null, ...args: any[]) {
|
||||||
const fileName = path.basename(editor.document.uri.fsPath);
|
const fileName = path.basename(editor.document.uri.fsPath);
|
||||||
|
|
||||||
// No conflict, command executed from command palette
|
// No conflict, command executed from command palette
|
||||||
|
@ -102,15 +102,15 @@ export default class CommandHandler implements vscode.Disposable {
|
||||||
vscode.commands.executeCommand('vscode.diff', leftUri, rightUri, title);
|
vscode.commands.executeCommand('vscode.diff', leftUri, rightUri, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
navigateNext(editor: vscode.TextEditor, ...args): Promise<void> {
|
navigateNext(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||||
return this.navigate(editor, NavigationDirection.Forwards);
|
return this.navigate(editor, NavigationDirection.Forwards);
|
||||||
}
|
}
|
||||||
|
|
||||||
navigatePrevious(editor: vscode.TextEditor, ...args): Promise<void> {
|
navigatePrevious(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||||
return this.navigate(editor, NavigationDirection.Backwards);
|
return this.navigate(editor, NavigationDirection.Backwards);
|
||||||
}
|
}
|
||||||
|
|
||||||
async acceptSelection(editor: vscode.TextEditor, ...args): Promise<void> {
|
async acceptSelection(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||||
let conflict = await this.findConflictContainingSelection(editor);
|
let conflict = await this.findConflictContainingSelection(editor);
|
||||||
|
|
||||||
if (!conflict) {
|
if (!conflict) {
|
||||||
|
@ -175,7 +175,7 @@ export default class CommandHandler implements vscode.Disposable {
|
||||||
editor.revealRange(navigationResult.conflict.range, vscode.TextEditorRevealType.Default);
|
editor.revealRange(navigationResult.conflict.range, vscode.TextEditorRevealType.Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async accept(type: interfaces.CommitType, editor: vscode.TextEditor, ...args): Promise<void> {
|
private async accept(type: interfaces.CommitType, editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||||
|
|
||||||
let conflict: interfaces.IDocumentMergeConflict | null;
|
let conflict: interfaces.IDocumentMergeConflict | null;
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ export default class CommandHandler implements vscode.Disposable {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let predicate: (conflict) => boolean;
|
let predicate: (_conflict: any) => boolean;
|
||||||
let fallback: () => interfaces.IDocumentMergeConflict;
|
let fallback: () => interfaces.IDocumentMergeConflict;
|
||||||
|
|
||||||
if (direction === NavigationDirection.Forwards) {
|
if (direction === NavigationDirection.Forwards) {
|
||||||
|
|
|
@ -13,7 +13,7 @@ export class Delayer<T> {
|
||||||
public defaultDelay: number;
|
public defaultDelay: number;
|
||||||
private timeout: any; // Timer
|
private timeout: any; // Timer
|
||||||
private completionPromise: Promise<T> | null;
|
private completionPromise: Promise<T> | null;
|
||||||
private onSuccess: ((value?: T | Thenable<T> | null) => void) | null;
|
private onSuccess: ((value?: T | Thenable<T> | undefined) => void) | null;
|
||||||
private task: ITask<T> | null;
|
private task: ITask<T> | null;
|
||||||
|
|
||||||
constructor(defaultDelay: number) {
|
constructor(defaultDelay: number) {
|
||||||
|
@ -45,7 +45,7 @@ export class Delayer<T> {
|
||||||
if (delay >= 0 || this.timeout === null) {
|
if (delay >= 0 || this.timeout === null) {
|
||||||
this.timeout = setTimeout(() => {
|
this.timeout = setTimeout(() => {
|
||||||
this.timeout = null;
|
this.timeout = null;
|
||||||
this.onSuccess!(null);
|
this.onSuccess!(undefined);
|
||||||
}, delay >= 0 ? delay : this.defaultDelay);
|
}, delay >= 0 ? delay : this.defaultDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ export class Delayer<T> {
|
||||||
}
|
}
|
||||||
this.cancelTimeout();
|
this.cancelTimeout();
|
||||||
let result = this.completionPromise;
|
let result = this.completionPromise;
|
||||||
this.onSuccess!(null);
|
this.onSuccess!(undefined);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ export interface IExtensionConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IDocumentMergeConflict extends IDocumentMergeConflictDescriptor {
|
export interface IDocumentMergeConflict extends IDocumentMergeConflictDescriptor {
|
||||||
commitEdit(type: CommitType, editor: vscode.TextEditor, edit?: vscode.TextEditorEdit);
|
commitEdit(type: CommitType, editor: vscode.TextEditor, edit?: vscode.TextEditorEdit): Thenable<boolean>;
|
||||||
applyEdit(type: CommitType, editor: vscode.TextEditor, edit: vscode.TextEditorEdit);
|
applyEdit(type: CommitType, editor: vscode.TextEditor, edit: vscode.TextEditorEdit): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IDocumentMergeConflictDescriptor {
|
export interface IDocumentMergeConflictDescriptor {
|
||||||
|
@ -39,10 +39,10 @@ export interface IDocumentMergeConflictDescriptor {
|
||||||
export interface IDocumentMergeConflictTracker {
|
export interface IDocumentMergeConflictTracker {
|
||||||
getConflicts(document: vscode.TextDocument): PromiseLike<IDocumentMergeConflict[]>;
|
getConflicts(document: vscode.TextDocument): PromiseLike<IDocumentMergeConflict[]>;
|
||||||
isPending(document: vscode.TextDocument): boolean;
|
isPending(document: vscode.TextDocument): boolean;
|
||||||
forget(document: vscode.TextDocument);
|
forget(document: vscode.TextDocument): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IDocumentMergeConflictTrackerService {
|
export interface IDocumentMergeConflictTrackerService {
|
||||||
createTracker(origin: string): IDocumentMergeConflictTracker;
|
createTracker(origin: string): IDocumentMergeConflictTracker;
|
||||||
forget(document: vscode.TextDocument);
|
forget(document: vscode.TextDocument): void;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
],
|
],
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"outDir": "./out",
|
"outDir": "./out",
|
||||||
"strictNullChecks": true,
|
"strict": true,
|
||||||
"experimentalDecorators": true
|
"experimentalDecorators": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { commands, Uri } from 'vscode';
|
||||||
import { join, basename, normalize, dirname } from 'path';
|
import { join, basename, normalize, dirname } from 'path';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
|
|
||||||
function assertUnchangedTokens(testFixurePath: string, done) {
|
function assertUnchangedTokens(testFixurePath: string, done: any) {
|
||||||
let fileName = basename(testFixurePath);
|
let fileName = basename(testFixurePath);
|
||||||
|
|
||||||
return commands.executeCommand('_workbench.captureSyntaxTokens', Uri.file(testFixurePath)).then(data => {
|
return commands.executeCommand('_workbench.captureSyntaxTokens', Uri.file(testFixurePath)).then(data => {
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
"lib": [
|
"lib": [
|
||||||
"es2015"
|
"es2015"
|
||||||
],
|
],
|
||||||
"sourceMap": true
|
"sourceMap": true,
|
||||||
|
"strict": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*"
|
"src/**/*"
|
||||||
|
|
Loading…
Reference in a new issue