mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
debt - reduce null | undefined usages
This commit is contained in:
@@ -66,6 +66,7 @@ import * as vscode from 'vscode';
|
||||
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import { originalFSPath } from 'vs/base/common/resources';
|
||||
import { CLIServer } from 'vs/workbench/api/node/extHostCLIServer';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
|
||||
export interface IExtensionApiFactory {
|
||||
(extension: IExtensionDescription, registry: ExtensionDescriptionRegistry, configProvider: ExtHostConfigProvider): typeof vscode;
|
||||
@@ -535,7 +536,7 @@ export function createApiFactory(
|
||||
return extHostWorkspace.getRelativePath(pathOrUri, includeWorkspace);
|
||||
},
|
||||
findFiles: (include, exclude, maxResults?, token?) => {
|
||||
return extHostWorkspace.findFiles(typeConverters.GlobPattern.from(include), typeConverters.GlobPattern.from(exclude), maxResults, extension.identifier, token);
|
||||
return extHostWorkspace.findFiles(typeConverters.GlobPattern.from(include), typeConverters.GlobPattern.from(withNullAsUndefined(exclude)), maxResults, extension.identifier, token);
|
||||
},
|
||||
findTextInFiles: (query: vscode.TextSearchQuery, optionsOrCallback, callbackOrToken?, token?: vscode.CancellationToken) => {
|
||||
let options: vscode.FindTextInFilesOptions;
|
||||
|
||||
@@ -986,9 +986,9 @@ export namespace TextEditorOptions {
|
||||
export namespace GlobPattern {
|
||||
|
||||
export function from(pattern: vscode.GlobPattern): string | types.RelativePattern;
|
||||
export function from(pattern: undefined | null): undefined | null;
|
||||
export function from(pattern: vscode.GlobPattern | undefined | null): string | types.RelativePattern | undefined | null;
|
||||
export function from(pattern: vscode.GlobPattern | undefined | null): string | types.RelativePattern | undefined | null {
|
||||
export function from(pattern: undefined): undefined;
|
||||
export function from(pattern: vscode.GlobPattern | undefined): string | types.RelativePattern | undefined;
|
||||
export function from(pattern: vscode.GlobPattern | undefined): string | types.RelativePattern | undefined {
|
||||
if (pattern instanceof types.RelativePattern) {
|
||||
return pattern;
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac
|
||||
|
||||
// --- search ---
|
||||
|
||||
findFiles(include: string | RelativePattern | undefined | null, exclude: vscode.GlobPattern | undefined | null, maxResults: number | undefined, extensionId: ExtensionIdentifier, token: vscode.CancellationToken = CancellationToken.None): Promise<vscode.Uri[]> {
|
||||
findFiles(include: string | RelativePattern | undefined, exclude: vscode.GlobPattern | undefined, maxResults: number | undefined, extensionId: ExtensionIdentifier, token: vscode.CancellationToken = CancellationToken.None): Promise<vscode.Uri[]> {
|
||||
this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${extensionId.value}, entryPoint: findFiles`);
|
||||
|
||||
let includePattern: string | undefined;
|
||||
|
||||
Reference in New Issue
Block a user