mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-21 12:20:29 -04:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
41
src/vs/editor/contrib/parameterHints/provideSignatureHelp.ts
Normal file
41
src/vs/editor/contrib/parameterHints/provideSignatureHelp.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { onUnexpectedExternalError } from 'vs/base/common/errors';
|
||||
import { IReadOnlyModel } from 'vs/editor/common/editorCommon';
|
||||
import { registerDefaultLanguageCommand } from 'vs/editor/browser/editorExtensions';
|
||||
import { SignatureHelp, SignatureHelpProviderRegistry } from 'vs/editor/common/modes';
|
||||
import { asWinJsPromise, sequence } from 'vs/base/common/async';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
|
||||
export const Context = {
|
||||
Visible: new RawContextKey<boolean>('parameterHintsVisible', false),
|
||||
MultipleSignatures: new RawContextKey<boolean>('parameterHintsMultipleSignatures', false),
|
||||
};
|
||||
|
||||
export function provideSignatureHelp(model: IReadOnlyModel, position: Position): TPromise<SignatureHelp> {
|
||||
|
||||
const supports = SignatureHelpProviderRegistry.ordered(model);
|
||||
let result: SignatureHelp;
|
||||
|
||||
return sequence(supports.map(support => () => {
|
||||
|
||||
if (result) {
|
||||
// stop when there is a result
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return asWinJsPromise(token => support.provideSignatureHelp(model, position, token)).then(thisResult => {
|
||||
result = thisResult;
|
||||
}, onUnexpectedExternalError);
|
||||
|
||||
})).then(() => result);
|
||||
}
|
||||
|
||||
registerDefaultLanguageCommand('_executeSignatureHelpProvider', provideSignatureHelp);
|
||||
Reference in New Issue
Block a user