diff --git a/src/vs/base/common/winjs.base.d.ts b/src/vs/base/common/winjs.base.d.ts index 23b1d178f24f92102fd53922b1bbfbea859fb6ca..ea35630cf374e6634c99c22041955031dfe7c661 100644 --- a/src/vs/base/common/winjs.base.d.ts +++ b/src/vs/base/common/winjs.base.d.ts @@ -28,17 +28,17 @@ export declare class Promise { static join(promises: { [name: string]: Promise; }): Promise; static join(promises: Promise[]): Promise; - static any(promises: Promise[]): Promise; + // static any(promises: Promise[]): Promise; // commented out to speed up adoption of TPromise // static timeout(delay:number):Promise; static wrapError(error: any): Promise; - static is(value: any): value is Thenable; - static addEventListener(type: string, fn: EventCallback): void; + // static is(value: any): value is Thenable; + // static addEventListener(type: string, fn: EventCallback): void; public then(success?: ValueCallback, error?: ErrorCallback, progress?: ProgressCallback): Promise; - public then(success?: ValueCallback, error?: ErrorCallback, progress?: ProgressCallback): TPromise; + // public then(success?: ValueCallback, error?: ErrorCallback, progress?: ProgressCallback): TPromise; public done(success?: ValueCallback, error?: ErrorCallback, progress?: ProgressCallback): void; public cancel(): void; } @@ -78,7 +78,12 @@ export declare class TPromise { public done(success?: (value: V) => void, error?: (err: any) => any, progress?: ProgressCallback): void; public cancel(): void; + public static as(value: null): TPromise; + public static as(value: undefined): TPromise; + public static as(value: TPromise): TPromise; + public static as(value: Thenable): Thenable; public static as(value: ValueType): TPromise; + public static is(value: any): value is Thenable; public static timeout(delay: number): TPromise; public static join(promises: TPromise[]): TPromise; @@ -113,4 +118,4 @@ export declare class PPromise extends TPromise { public static join(promises: { [n: string]: PPromise }): PPromise<{ [n: string]: C }, P>; public static any(promises: PPromise[]): PPromise<{ key: string; value: PPromise; }, P>; public static wrapError(error: any): TPromise; -} \ No newline at end of file +} diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index f3d5245e24d93d1cf0a0ded71bb148c22d2afaec..d08cbfa7eb105217718aee18ddff9254cb1b5678 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -7,7 +7,6 @@ import { MarkedString } from 'vs/base/common/htmlContent'; import { IDisposable } from 'vs/base/common/lifecycle'; import URI from 'vs/base/common/uri'; -import { IFilter } from 'vs/base/common/filters'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { TokenizationResult, TokenizationResult2 } from 'vs/editor/common/core/token'; import LanguageFeatureRegistry from 'vs/editor/common/modes/languageFeatureRegistry'; @@ -237,8 +236,6 @@ export interface ISuggestSupport { triggerCharacters: string[]; - filter?: IFilter; - provideCompletionItems(model: editorCommon.IReadOnlyModel, position: Position, token: CancellationToken): ISuggestResult | Thenable; resolveCompletionItem?(model: editorCommon.IReadOnlyModel, position: Position, item: ISuggestion, token: CancellationToken): ISuggestion | Thenable; diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts index 053a8d30f25be6f103043560a6b9e4ed9e9b1b20..e4a0bb2647b86fa95ec0c305fe09237375b31605 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts @@ -373,7 +373,7 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC this.throttler.queue(() => { return state.validate(this.editor) ? this.findDefinition(mouseEvent.target) - : TPromise.as(null); + : TPromise.as(null); }).then(results => { if (!results || !results.length || !state.validate(this.editor)) { diff --git a/src/vs/editor/contrib/suggest/common/completionModel.ts b/src/vs/editor/contrib/suggest/common/completionModel.ts index 7120049fba6ff1c5f363eac6d52ebb36c9f7051f..981af7ff2717feb57e56a17dbff867cf2defce3d 100644 --- a/src/vs/editor/contrib/suggest/common/completionModel.ts +++ b/src/vs/editor/contrib/suggest/common/completionModel.ts @@ -110,8 +110,7 @@ export class CompletionModel { for (const item of this._items) { - const {suggestion, support, container} = item; - const filter = support && support.filter || fuzzyContiguousFilter; + const {suggestion, container} = item; // collect those supports that signaled having // an incomplete result @@ -128,17 +127,17 @@ export class CompletionModel { let match = false; // compute highlights based on 'label' - item.highlights = filter(word, suggestion.label); + item.highlights = fuzzyContiguousFilter(word, suggestion.label); match = item.highlights !== null; // no match on label nor codeSnippet -> check on filterText if (!match && typeof suggestion.filterText === 'string') { - if (!isFalsyOrEmpty(filter(word, suggestion.filterText))) { + if (!isFalsyOrEmpty(fuzzyContiguousFilter(word, suggestion.filterText))) { match = true; // try to compute highlights by stripping none-word // characters from the end of the string - item.highlights = filter(word.replace(/^\W+|\W+$/, ''), suggestion.label); + item.highlights = fuzzyContiguousFilter(word.replace(/^\W+|\W+$/, ''), suggestion.label); } } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index d6af73f63dfe05e76122a1f8924b982f709a2572..2be64bae096b54cf88aec823a84828b9463be4e2 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -74,7 +74,12 @@ declare module monaco { public done(success?: (value: V) => void, error?: (err: any) => any, progress?: ProgressCallback): void; public cancel(): void; + public static as(value: null): Promise; + public static as(value: undefined): Promise; + public static as(value: Promise): Promise; + public static as(value: Thenable): Thenable; public static as(value: ValueType): Promise; + public static is(value: any): value is Thenable; public static timeout(delay: number): Promise; public static join(promises: Promise[]): Promise;