mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-20 20:10:11 -04:00
Merge from master
This commit is contained in:
@@ -2,17 +2,17 @@
|
||||
* 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 { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { toggleClass } from 'vs/base/browser/dom';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import * as editorBrowser from 'vs/editor/browser/editorBrowser';
|
||||
import { Widget } from 'vs/base/browser/ui/widget';
|
||||
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import { Widget } from 'vs/base/browser/ui/widget';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import * as editorBrowser from 'vs/editor/browser/editorBrowser';
|
||||
import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
|
||||
export class ContentHoverWidget extends Widget implements editorBrowser.IContentWidget {
|
||||
|
||||
@@ -21,7 +21,8 @@ export class ContentHoverWidget extends Widget implements editorBrowser.IContent
|
||||
private _isVisible: boolean;
|
||||
private _containerDomNode: HTMLElement;
|
||||
private _domNode: HTMLElement;
|
||||
protected _showAtPosition: Position;
|
||||
protected _showAtPosition: Position | null;
|
||||
protected _showAtRange: Range | null;
|
||||
private _stoleFocus: boolean;
|
||||
private scrollbar: DomScrollableElement;
|
||||
private disposables: IDisposable[] = [];
|
||||
@@ -72,6 +73,7 @@ export class ContentHoverWidget extends Widget implements editorBrowser.IContent
|
||||
this.updateMaxHeight();
|
||||
this._editor.addContentWidget(this);
|
||||
this._showAtPosition = null;
|
||||
this._showAtRange = null;
|
||||
}
|
||||
|
||||
public getId(): string {
|
||||
@@ -82,9 +84,10 @@ export class ContentHoverWidget extends Widget implements editorBrowser.IContent
|
||||
return this._containerDomNode;
|
||||
}
|
||||
|
||||
public showAt(position: Position, focus: boolean): void {
|
||||
public showAt(position: Position, range: Range, focus: boolean): void {
|
||||
// Position has changed
|
||||
this._showAtPosition = new Position(position.lineNumber, position.column);
|
||||
this._showAtPosition = position;
|
||||
this._showAtRange = range;
|
||||
this.isVisible = true;
|
||||
|
||||
this._editor.layoutContentWidget(this);
|
||||
@@ -110,10 +113,11 @@ export class ContentHoverWidget extends Widget implements editorBrowser.IContent
|
||||
}
|
||||
}
|
||||
|
||||
public getPosition(): editorBrowser.IContentWidgetPosition {
|
||||
public getPosition(): editorBrowser.IContentWidgetPosition | null {
|
||||
if (this.isVisible) {
|
||||
return {
|
||||
position: this._showAtPosition,
|
||||
range: this._showAtRange,
|
||||
preference: [
|
||||
editorBrowser.ContentWidgetPositionPreference.ABOVE,
|
||||
editorBrowser.ContentWidgetPositionPreference.BELOW
|
||||
@@ -229,7 +233,7 @@ export class GlyphHoverWidget extends Widget implements editorBrowser.IOverlayWi
|
||||
this.isVisible = false;
|
||||
}
|
||||
|
||||
public getPosition(): editorBrowser.IOverlayWidgetPosition {
|
||||
public getPosition(): editorBrowser.IOverlayWidgetPosition | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user