mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-21 12:20:29 -04:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -26,7 +26,13 @@ namespace ParameterHintState {
|
||||
}
|
||||
|
||||
export const Default = new class { readonly type = Type.Default; };
|
||||
export const Pending = new class { readonly type = Type.Pending; };
|
||||
|
||||
export class Pending {
|
||||
readonly type = Type.Pending;
|
||||
constructor(
|
||||
readonly request: CancelablePromise<any>
|
||||
) { }
|
||||
}
|
||||
|
||||
export class Active {
|
||||
readonly type = Type.Active;
|
||||
@@ -35,7 +41,7 @@ namespace ParameterHintState {
|
||||
) { }
|
||||
}
|
||||
|
||||
export type State = typeof Default | typeof Pending | Active;
|
||||
export type State = typeof Default | Pending | Active;
|
||||
}
|
||||
|
||||
export class ParameterHintsModel extends Disposable {
|
||||
@@ -45,14 +51,13 @@ export class ParameterHintsModel extends Disposable {
|
||||
private readonly _onChangedHints = this._register(new Emitter<modes.SignatureHelp | undefined>());
|
||||
public readonly onChangedHints = this._onChangedHints.event;
|
||||
|
||||
private editor: ICodeEditor;
|
||||
private readonly editor: ICodeEditor;
|
||||
private enabled: boolean;
|
||||
private state: ParameterHintState.State = ParameterHintState.Default;
|
||||
private _state: ParameterHintState.State = ParameterHintState.Default;
|
||||
private triggerChars = new CharacterSet();
|
||||
private retriggerChars = new CharacterSet();
|
||||
|
||||
private throttledDelayer: Delayer<boolean>;
|
||||
private provideSignatureHelpRequest?: CancelablePromise<any>;
|
||||
private readonly throttledDelayer: Delayer<boolean>;
|
||||
private triggerId = 0;
|
||||
|
||||
constructor(
|
||||
@@ -78,7 +83,16 @@ export class ParameterHintsModel extends Disposable {
|
||||
this.onModelChanged();
|
||||
}
|
||||
|
||||
private get state() { return this._state; }
|
||||
private set state(value: ParameterHintState.State) {
|
||||
if (this._state.type === ParameterHintState.Type.Pending) {
|
||||
this._state.request.cancel();
|
||||
}
|
||||
this._state = value;
|
||||
}
|
||||
|
||||
cancel(silent: boolean = false): void {
|
||||
|
||||
this.state = ParameterHintState.Default;
|
||||
|
||||
this.throttledDelayer.cancel();
|
||||
@@ -86,16 +100,11 @@ export class ParameterHintsModel extends Disposable {
|
||||
if (!silent) {
|
||||
this._onChangedHints.fire(undefined);
|
||||
}
|
||||
|
||||
if (this.provideSignatureHelpRequest) {
|
||||
this.provideSignatureHelpRequest.cancel();
|
||||
this.provideSignatureHelpRequest = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
trigger(context: TriggerContext, delay?: number): void {
|
||||
const model = this.editor.getModel();
|
||||
if (model === null || !modes.SignatureHelpProviderRegistry.has(model)) {
|
||||
if (!model || !modes.SignatureHelpProviderRegistry.has(model)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -166,12 +175,10 @@ export class ParameterHintsModel extends Disposable {
|
||||
const model = this.editor.getModel();
|
||||
const position = this.editor.getPosition();
|
||||
|
||||
this.state = ParameterHintState.Pending;
|
||||
this.state = new ParameterHintState.Pending(createCancelablePromise(token =>
|
||||
provideSignatureHelp(model, position, triggerContext, token)));
|
||||
|
||||
this.provideSignatureHelpRequest = createCancelablePromise(token =>
|
||||
provideSignatureHelp(model, position, triggerContext, token));
|
||||
|
||||
return this.provideSignatureHelpRequest.then(result => {
|
||||
return this.state.request.then(result => {
|
||||
// Check that we are still resolving the correct signature help
|
||||
if (triggerId !== this.triggerId) {
|
||||
return false;
|
||||
@@ -186,7 +193,9 @@ export class ParameterHintsModel extends Disposable {
|
||||
return true;
|
||||
}
|
||||
}).catch(error => {
|
||||
this.state = ParameterHintState.Default;
|
||||
if (triggerId === this.triggerId) {
|
||||
this.state = ParameterHintState.Default;
|
||||
}
|
||||
onUnexpectedError(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user