mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
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;
|
||||
|
||||
export function activate(context): void {
|
||||
export function activate(context: vscode.ExtensionContext): void {
|
||||
|
||||
//keybindings.json command-suggestions
|
||||
context.subscriptions.push(registerKeybindingsCompletions());
|
||||
|
|
|
@ -149,7 +149,7 @@ export class SettingsDocument {
|
|||
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 languages.map(l => {
|
||||
return this.newSimpleCompletionItem(formatFunc(l), range);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"lib": [
|
||||
"es2015"
|
||||
],
|
||||
"strictNullChecks": true
|
||||
"strict": true
|
||||
},
|
||||
"include": [
|
||||
"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) => {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
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);
|
||||
}
|
||||
|
||||
acceptIncoming(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
acceptIncoming(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||
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);
|
||||
}
|
||||
|
||||
acceptAllCurrent(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
acceptAllCurrent(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||
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);
|
||||
}
|
||||
|
||||
acceptAllBoth(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
acceptAllBoth(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||
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);
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
navigateNext(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
navigateNext(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||
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);
|
||||
}
|
||||
|
||||
async acceptSelection(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
async acceptSelection(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||
let conflict = await this.findConflictContainingSelection(editor);
|
||||
|
||||
if (!conflict) {
|
||||
|
@ -175,7 +175,7 @@ export default class CommandHandler implements vscode.Disposable {
|
|||
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;
|
||||
|
||||
|
@ -257,7 +257,7 @@ export default class CommandHandler implements vscode.Disposable {
|
|||
};
|
||||
}
|
||||
|
||||
let predicate: (conflict) => boolean;
|
||||
let predicate: (_conflict: any) => boolean;
|
||||
let fallback: () => interfaces.IDocumentMergeConflict;
|
||||
|
||||
if (direction === NavigationDirection.Forwards) {
|
||||
|
|
|
@ -13,7 +13,7 @@ export class Delayer<T> {
|
|||
public defaultDelay: number;
|
||||
private timeout: any; // Timer
|
||||
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;
|
||||
|
||||
constructor(defaultDelay: number) {
|
||||
|
@ -45,7 +45,7 @@ export class Delayer<T> {
|
|||
if (delay >= 0 || this.timeout === null) {
|
||||
this.timeout = setTimeout(() => {
|
||||
this.timeout = null;
|
||||
this.onSuccess!(null);
|
||||
this.onSuccess!(undefined);
|
||||
}, delay >= 0 ? delay : this.defaultDelay);
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ export class Delayer<T> {
|
|||
}
|
||||
this.cancelTimeout();
|
||||
let result = this.completionPromise;
|
||||
this.onSuccess!(null);
|
||||
this.onSuccess!(undefined);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ export interface IExtensionConfiguration {
|
|||
}
|
||||
|
||||
export interface IDocumentMergeConflict extends IDocumentMergeConflictDescriptor {
|
||||
commitEdit(type: CommitType, editor: vscode.TextEditor, edit?: vscode.TextEditorEdit);
|
||||
applyEdit(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): void;
|
||||
}
|
||||
|
||||
export interface IDocumentMergeConflictDescriptor {
|
||||
|
@ -39,10 +39,10 @@ export interface IDocumentMergeConflictDescriptor {
|
|||
export interface IDocumentMergeConflictTracker {
|
||||
getConflicts(document: vscode.TextDocument): PromiseLike<IDocumentMergeConflict[]>;
|
||||
isPending(document: vscode.TextDocument): boolean;
|
||||
forget(document: vscode.TextDocument);
|
||||
forget(document: vscode.TextDocument): void;
|
||||
}
|
||||
|
||||
export interface IDocumentMergeConflictTrackerService {
|
||||
createTracker(origin: string): IDocumentMergeConflictTracker;
|
||||
forget(document: vscode.TextDocument);
|
||||
forget(document: vscode.TextDocument): void;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
],
|
||||
"module": "commonjs",
|
||||
"outDir": "./out",
|
||||
"strictNullChecks": true,
|
||||
"strict": true,
|
||||
"experimentalDecorators": true
|
||||
},
|
||||
"include": [
|
||||
|
|
|
@ -10,7 +10,7 @@ import { commands, Uri } from 'vscode';
|
|||
import { join, basename, normalize, dirname } from 'path';
|
||||
import * as fs from 'fs';
|
||||
|
||||
function assertUnchangedTokens(testFixurePath: string, done) {
|
||||
function assertUnchangedTokens(testFixurePath: string, done: any) {
|
||||
let fileName = basename(testFixurePath);
|
||||
|
||||
return commands.executeCommand('_workbench.captureSyntaxTokens', Uri.file(testFixurePath)).then(data => {
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
"lib": [
|
||||
"es2015"
|
||||
],
|
||||
"sourceMap": true
|
||||
"sourceMap": true,
|
||||
"strict": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
|
|
Loading…
Reference in a new issue