Fix spelling
This commit is contained in:
parent
8183db5b25
commit
d83f121f6d
|
@ -7,7 +7,7 @@ import * as vscode from 'vscode';
|
|||
import * as Proto from '../protocol';
|
||||
import { ITypeScriptServiceClient } from '../typescriptService';
|
||||
import API from '../utils/api';
|
||||
import { coalease } from '../utils/arrays';
|
||||
import { coalesce } from '../utils/arrays';
|
||||
import { Delayer } from '../utils/async';
|
||||
import { nulToken } from '../utils/cancellation';
|
||||
import { Disposable } from '../utils/dispose';
|
||||
|
@ -279,7 +279,7 @@ class GetErrRequest {
|
|||
) {
|
||||
const args: Proto.GeterrRequestArgs = {
|
||||
delay: 0,
|
||||
files: coalease(Array.from(files.entries).map(entry => client.normalizedPath(entry.resource)))
|
||||
files: coalesce(Array.from(files.entries).map(entry => client.normalizedPath(entry.resource)))
|
||||
};
|
||||
|
||||
client.executeAsync('geterr', args, _token.token)
|
||||
|
|
|
@ -7,7 +7,7 @@ import * as vscode from 'vscode';
|
|||
import * as Proto from '../protocol';
|
||||
import { ITypeScriptServiceClient } from '../typescriptService';
|
||||
import API from '../utils/api';
|
||||
import { coalease } from '../utils/arrays';
|
||||
import { coalesce } from '../utils/arrays';
|
||||
import { VersionDependentRegistration } from '../utils/dependentRegistration';
|
||||
import * as typeConverters from '../utils/typeConverters';
|
||||
|
||||
|
@ -34,7 +34,7 @@ class TypeScriptFoldingProvider implements vscode.FoldingRangeProvider {
|
|||
return;
|
||||
}
|
||||
|
||||
return coalease(response.body.map(span => this.convertOutliningSpan(span, document)));
|
||||
return coalesce(response.body.map(span => this.convertOutliningSpan(span, document)));
|
||||
}
|
||||
|
||||
private convertOutliningSpan(
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import * as jsonc from 'jsonc-parser';
|
||||
import { basename, dirname, join } from 'path';
|
||||
import * as vscode from 'vscode';
|
||||
import { coalease, flatten } from '../utils/arrays';
|
||||
import { coalesce, flatten } from '../utils/arrays';
|
||||
|
||||
function mapChildren<R>(node: jsonc.Node | undefined, f: (x: jsonc.Node) => R): R[] {
|
||||
return node && node.type === 'array' && node.children
|
||||
|
@ -25,7 +25,7 @@ class TsconfigLinkProvider implements vscode.DocumentLinkProvider {
|
|||
return null;
|
||||
}
|
||||
|
||||
return coalease([
|
||||
return coalesce([
|
||||
this.getExtendsLink(document, root),
|
||||
...this.getFilesLinks(document, root),
|
||||
...this.getReferencesLinks(document, root)
|
||||
|
|
|
@ -23,7 +23,7 @@ import { PluginManager } from './utils/plugins';
|
|||
import * as typeConverters from './utils/typeConverters';
|
||||
import TypingsStatus, { AtaProgressReporter } from './utils/typingsStatus';
|
||||
import VersionStatus from './utils/versionStatus';
|
||||
import { flatten, coalease } from './utils/arrays';
|
||||
import { flatten, coalesce } from './utils/arrays';
|
||||
|
||||
// Style check diagnostics that can be reported as warnings
|
||||
const styleCheckDiagnostics = [
|
||||
|
@ -245,7 +245,7 @@ export default class TypeScriptServiceClientHost extends Disposable {
|
|||
}
|
||||
const relatedInformation = diagnostic.relatedInformation;
|
||||
if (relatedInformation) {
|
||||
converted.relatedInformation = coalease(relatedInformation.map((info: any) => {
|
||||
converted.relatedInformation = coalesce(relatedInformation.map((info: any) => {
|
||||
const span = info.span;
|
||||
if (!span) {
|
||||
return undefined;
|
||||
|
|
|
@ -23,6 +23,6 @@ export function flatten<T>(array: ReadonlyArray<T>[]): T[] {
|
|||
return Array.prototype.concat.apply([], array);
|
||||
}
|
||||
|
||||
export function coalease<T>(array: ReadonlyArray<T | undefined>): T[] {
|
||||
export function coalesce<T>(array: ReadonlyArray<T | undefined>): T[] {
|
||||
return <T[]>array.filter(e => !!e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue