Add additional no unused checks for php extension

This commit is contained in:
Matt Bierner 2017-11-06 20:50:36 -08:00
parent b1747e7b5f
commit 52f45af7f0
6 changed files with 14 additions and 8 deletions

View file

@ -12,7 +12,7 @@ export default class PHPCompletionItemProvider implements CompletionItemProvider
public triggerCharacters = ['.', ':', '$']; public triggerCharacters = ['.', ':', '$'];
public provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): Promise<CompletionItem[]> { public provideCompletionItems(document: TextDocument, position: Position, _token: CancellationToken): Promise<CompletionItem[]> {
let result: CompletionItem[] = []; let result: CompletionItem[] = [];
let shouldProvideCompletionItems = workspace.getConfiguration('php').get<boolean>('suggest.basic', true); let shouldProvideCompletionItems = workspace.getConfiguration('php').get<boolean>('suggest.basic', true);

View file

@ -11,15 +11,15 @@ import { textToMarkedString } from './utils/markedTextUtil';
export default class PHPHoverProvider implements HoverProvider { export default class PHPHoverProvider implements HoverProvider {
public provideHover(document: TextDocument, position: Position, token: CancellationToken): Hover | undefined { public provideHover(document: TextDocument, position: Position, _token: CancellationToken): Hover | undefined {
let enable = workspace.getConfiguration('php').get<boolean>('suggest.basic', true); let enable = workspace.getConfiguration('php').get<boolean>('suggest.basic', true);
if (!enable) { if (!enable) {
return; return undefined;
} }
let wordRange = document.getWordRangeAtPosition(position); let wordRange = document.getWordRangeAtPosition(position);
if (!wordRange) { if (!wordRange) {
return; return undefined;
} }
let name = document.getText(wordRange); let name = document.getText(wordRange);
@ -30,5 +30,7 @@ export default class PHPHoverProvider implements HoverProvider {
let contents: MarkedString[] = [textToMarkedString(entry.description), { language: 'php', value: signature }]; let contents: MarkedString[] = [textToMarkedString(entry.description), { language: 'php', value: signature }];
return new Hover(contents, wordRange); return new Hover(contents, wordRange);
} }
return undefined;
} }
} }

View file

@ -69,7 +69,7 @@ class BackwardIterator {
export default class PHPSignatureHelpProvider implements SignatureHelpProvider { export default class PHPSignatureHelpProvider implements SignatureHelpProvider {
public provideSignatureHelp(document: TextDocument, position: Position, token: CancellationToken): Promise<SignatureHelp> | null { public provideSignatureHelp(document: TextDocument, position: Position, _token: CancellationToken): Promise<SignatureHelp> | null {
let enable = workspace.getConfiguration('php').get<boolean>('suggest.basic', true); let enable = workspace.getConfiguration('php').get<boolean>('suggest.basic', true);
if (!enable) { if (!enable) {
return null; return null;

View file

@ -53,7 +53,7 @@ export class Throttler<T> {
return result; return result;
}; };
this.queuedPromise = new Promise<T>((resolve, reject) => { this.queuedPromise = new Promise<T>((resolve) => {
this.activePromise!.then(onComplete, onComplete).then(resolve); this.activePromise!.then(onComplete, onComplete).then(resolve);
}); });
} }
@ -121,7 +121,7 @@ export class Delayer<T> {
this.cancelTimeout(); this.cancelTimeout();
if (!this.completionPromise) { if (!this.completionPromise) {
this.completionPromise = new Promise<T>((resolve, reject) => { this.completionPromise = new Promise<T>((resolve) => {
this.onResolve = resolve; this.onResolve = resolve;
}).then(() => { }).then(() => {
this.completionPromise = null; this.completionPromise = null;

View file

@ -224,7 +224,7 @@ export default class PHPValidationProvider {
} }
private doValidate(textDocument: vscode.TextDocument): Promise<void> { private doValidate(textDocument: vscode.TextDocument): Promise<void> {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve) => {
let executable = this.executable || 'php'; let executable = this.executable || 'php';
let decoder = new LineDecoder(); let decoder = new LineDecoder();
let diagnostics: vscode.Diagnostic[] = []; let diagnostics: vscode.Diagnostic[] = [];

View file

@ -6,6 +6,10 @@
], ],
"module": "commonjs", "module": "commonjs",
"outDir": "./out", "outDir": "./out",
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true "strict": true
}, },
"include": [ "include": [