mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode b12f623603e2fc1c5b3037115fa37c1a6acc4165 (#6760)
This commit is contained in:
@@ -49,7 +49,7 @@ export interface IPointerHandlerHelper {
|
||||
*/
|
||||
getLastViewCursorsRenderData(): IViewCursorRenderData[];
|
||||
|
||||
shouldSuppressMouseDownOnViewZone(viewZoneId: number): boolean;
|
||||
shouldSuppressMouseDownOnViewZone(viewZoneId: string): boolean;
|
||||
shouldSuppressMouseDownOnWidget(widgetId: string): boolean;
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,7 +19,7 @@ import { IViewModel } from 'vs/editor/common/viewModel/viewModel';
|
||||
import { CursorColumns } from 'vs/editor/common/controller/cursorCommon';
|
||||
|
||||
export interface IViewZoneData {
|
||||
viewZoneId: number;
|
||||
viewZoneId: string;
|
||||
positionBefore: Position | null;
|
||||
positionAfter: Position | null;
|
||||
position: Position;
|
||||
|
||||
@@ -83,17 +83,17 @@ export interface IViewZoneChangeAccessor {
|
||||
* @param zone Zone to create
|
||||
* @return A unique identifier to the view zone.
|
||||
*/
|
||||
addZone(zone: IViewZone): number;
|
||||
addZone(zone: IViewZone): string;
|
||||
/**
|
||||
* Remove a zone
|
||||
* @param id A unique identifier to the view zone, as returned by the `addZone` call.
|
||||
*/
|
||||
removeZone(id: number): void;
|
||||
removeZone(id: string): void;
|
||||
/**
|
||||
* Change a zone's position.
|
||||
* The editor will rescan the `afterLineNumber` and `afterColumn` properties of a view zone.
|
||||
*/
|
||||
layoutZone(id: number): void;
|
||||
layoutZone(id: string): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -399,7 +399,7 @@ export interface ICodeEditor extends editorCommon.IEditor {
|
||||
*/
|
||||
onWillType(listener: (text: string) => void): IDisposable;
|
||||
/**
|
||||
* An event emitted before interpreting typed characters (on the keyboard).
|
||||
* An event emitted after interpreting typed characters (on the keyboard).
|
||||
* @event
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@@ -55,8 +55,7 @@ export class OpenerService implements IOpenerService {
|
||||
|
||||
if (equalsIgnoreCase(scheme, Schemas.http) || equalsIgnoreCase(scheme, Schemas.https) || equalsIgnoreCase(scheme, Schemas.mailto)) {
|
||||
// open http or default mail application
|
||||
dom.windowOpenNoOpener(encodeURI(resource.toString(true)));
|
||||
return Promise.resolve(true);
|
||||
return this.openExternal(resource);
|
||||
|
||||
} else if (equalsIgnoreCase(scheme, Schemas.command)) {
|
||||
// run command or bail out if command isn't known
|
||||
@@ -100,4 +99,10 @@ export class OpenerService implements IOpenerService {
|
||||
).then(() => true);
|
||||
}
|
||||
}
|
||||
|
||||
openExternal(resource: URI): Promise<boolean> {
|
||||
dom.windowOpenNoOpener(encodeURI(resource.toString(true)));
|
||||
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ export class View extends ViewEventHandler {
|
||||
getLastViewCursorsRenderData: () => {
|
||||
return this.viewCursors.getLastRenderData() || [];
|
||||
},
|
||||
shouldSuppressMouseDownOnViewZone: (viewZoneId: number) => {
|
||||
shouldSuppressMouseDownOnViewZone: (viewZoneId: string) => {
|
||||
return this.viewZones.shouldSuppressMouseDownOnViewZone(viewZoneId);
|
||||
},
|
||||
shouldSuppressMouseDownOnWidget: (widgetId: string) => {
|
||||
@@ -473,17 +473,17 @@ export class View extends ViewEventHandler {
|
||||
|
||||
this._renderOnce(() => {
|
||||
const changeAccessor: editorBrowser.IViewZoneChangeAccessor = {
|
||||
addZone: (zone: editorBrowser.IViewZone): number => {
|
||||
addZone: (zone: editorBrowser.IViewZone): string => {
|
||||
zonesHaveChanged = true;
|
||||
return this.viewZones.addZone(zone);
|
||||
},
|
||||
removeZone: (id: number): void => {
|
||||
removeZone: (id: string): void => {
|
||||
if (!id) {
|
||||
return;
|
||||
}
|
||||
zonesHaveChanged = this.viewZones.removeZone(id) || zonesHaveChanged;
|
||||
},
|
||||
layoutZone: (id: number): void => {
|
||||
layoutZone: (id: string): void => {
|
||||
if (!id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import * as viewEvents from 'vs/editor/common/view/viewEvents';
|
||||
import { IViewWhitespaceViewportData } from 'vs/editor/common/viewModel/viewModel';
|
||||
|
||||
export interface IMyViewZone {
|
||||
whitespaceId: number;
|
||||
whitespaceId: string;
|
||||
delegate: IViewZone;
|
||||
isVisible: boolean;
|
||||
domNode: FastDomNode<HTMLElement>;
|
||||
@@ -74,7 +74,7 @@ export class ViewZones extends ViewPart {
|
||||
const id = keys[i];
|
||||
const zone = this._zones[id];
|
||||
const props = this._computeWhitespaceProps(zone.delegate);
|
||||
if (this._context.viewLayout.changeWhitespace(parseInt(id, 10), props.afterViewLineNumber, props.heightInPx)) {
|
||||
if (this._context.viewLayout.changeWhitespace(id, props.afterViewLineNumber, props.heightInPx)) {
|
||||
this._safeCallOnComputedHeight(zone.delegate, props.heightInPx);
|
||||
hadAChange = true;
|
||||
}
|
||||
@@ -183,7 +183,7 @@ export class ViewZones extends ViewPart {
|
||||
};
|
||||
}
|
||||
|
||||
public addZone(zone: IViewZone): number {
|
||||
public addZone(zone: IViewZone): string {
|
||||
const props = this._computeWhitespaceProps(zone);
|
||||
const whitespaceId = this._context.viewLayout.addWhitespace(props.afterViewLineNumber, this._getZoneOrdinal(zone), props.heightInPx, props.minWidthInPx);
|
||||
|
||||
@@ -200,18 +200,18 @@ export class ViewZones extends ViewPart {
|
||||
myZone.domNode.setPosition('absolute');
|
||||
myZone.domNode.domNode.style.width = '100%';
|
||||
myZone.domNode.setDisplay('none');
|
||||
myZone.domNode.setAttribute('monaco-view-zone', myZone.whitespaceId.toString());
|
||||
myZone.domNode.setAttribute('monaco-view-zone', myZone.whitespaceId);
|
||||
this.domNode.appendChild(myZone.domNode);
|
||||
|
||||
if (myZone.marginDomNode) {
|
||||
myZone.marginDomNode.setPosition('absolute');
|
||||
myZone.marginDomNode.domNode.style.width = '100%';
|
||||
myZone.marginDomNode.setDisplay('none');
|
||||
myZone.marginDomNode.setAttribute('monaco-view-zone', myZone.whitespaceId.toString());
|
||||
myZone.marginDomNode.setAttribute('monaco-view-zone', myZone.whitespaceId);
|
||||
this.marginDomNode.appendChild(myZone.marginDomNode);
|
||||
}
|
||||
|
||||
this._zones[myZone.whitespaceId.toString()] = myZone;
|
||||
this._zones[myZone.whitespaceId] = myZone;
|
||||
|
||||
|
||||
this.setShouldRender();
|
||||
@@ -219,10 +219,10 @@ export class ViewZones extends ViewPart {
|
||||
return myZone.whitespaceId;
|
||||
}
|
||||
|
||||
public removeZone(id: number): boolean {
|
||||
if (this._zones.hasOwnProperty(id.toString())) {
|
||||
const zone = this._zones[id.toString()];
|
||||
delete this._zones[id.toString()];
|
||||
public removeZone(id: string): boolean {
|
||||
if (this._zones.hasOwnProperty(id)) {
|
||||
const zone = this._zones[id];
|
||||
delete this._zones[id];
|
||||
this._context.viewLayout.removeWhitespace(zone.whitespaceId);
|
||||
|
||||
zone.domNode.removeAttribute('monaco-visible-view-zone');
|
||||
@@ -242,10 +242,10 @@ export class ViewZones extends ViewPart {
|
||||
return false;
|
||||
}
|
||||
|
||||
public layoutZone(id: number): boolean {
|
||||
public layoutZone(id: string): boolean {
|
||||
let changed = false;
|
||||
if (this._zones.hasOwnProperty(id.toString())) {
|
||||
const zone = this._zones[id.toString()];
|
||||
if (this._zones.hasOwnProperty(id)) {
|
||||
const zone = this._zones[id];
|
||||
const props = this._computeWhitespaceProps(zone.delegate);
|
||||
// const newOrdinal = this._getZoneOrdinal(zone.delegate);
|
||||
changed = this._context.viewLayout.changeWhitespace(zone.whitespaceId, props.afterViewLineNumber, props.heightInPx) || changed;
|
||||
@@ -259,9 +259,9 @@ export class ViewZones extends ViewPart {
|
||||
return changed;
|
||||
}
|
||||
|
||||
public shouldSuppressMouseDownOnViewZone(id: number): boolean {
|
||||
if (this._zones.hasOwnProperty(id.toString())) {
|
||||
const zone = this._zones[id.toString()];
|
||||
public shouldSuppressMouseDownOnViewZone(id: string): boolean {
|
||||
if (this._zones.hasOwnProperty(id)) {
|
||||
const zone = this._zones[id];
|
||||
return Boolean(zone.delegate.suppressMouseDown);
|
||||
}
|
||||
return false;
|
||||
@@ -314,7 +314,7 @@ export class ViewZones extends ViewPart {
|
||||
|
||||
let hasVisibleZone = false;
|
||||
for (let i = 0, len = visibleWhitespaces.length; i < len; i++) {
|
||||
visibleZones[visibleWhitespaces[i].id.toString()] = visibleWhitespaces[i];
|
||||
visibleZones[visibleWhitespaces[i].id] = visibleWhitespaces[i];
|
||||
hasVisibleZone = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ interface IDiffEditorWidgetStyle {
|
||||
}
|
||||
|
||||
class VisualEditorState {
|
||||
private _zones: number[];
|
||||
private _zones: string[];
|
||||
private _zonesMap: { [zoneId: string]: boolean; };
|
||||
private _decorations: string[];
|
||||
|
||||
|
||||
@@ -110,21 +110,6 @@ export function createTextBuffer(value: string | model.ITextBufferFactory, defau
|
||||
|
||||
let MODEL_ID = 0;
|
||||
|
||||
/**
|
||||
* Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc.
|
||||
*/
|
||||
function singleLetter(result: number): string {
|
||||
const LETTERS_CNT = (CharCode.Z - CharCode.A + 1);
|
||||
|
||||
result = result % (2 * LETTERS_CNT);
|
||||
|
||||
if (result < LETTERS_CNT) {
|
||||
return String.fromCharCode(CharCode.a + result);
|
||||
}
|
||||
|
||||
return String.fromCharCode(CharCode.A + result - LETTERS_CNT);
|
||||
}
|
||||
|
||||
const LIMIT_FIND_COUNT = 999;
|
||||
export const LONG_LINE_BOUNDARY = 10000;
|
||||
|
||||
@@ -343,7 +328,7 @@ export class TextModel extends Disposable implements model.ITextModel {
|
||||
}
|
||||
});
|
||||
|
||||
this._instanceId = singleLetter(MODEL_ID);
|
||||
this._instanceId = strings.singleLetterHash(MODEL_ID);
|
||||
this._lastDecorationId = 0;
|
||||
this._decorations = Object.create(null);
|
||||
this._decorationsTree = new DecorationsTrees();
|
||||
|
||||
@@ -63,14 +63,14 @@ export class LinesLayout {
|
||||
* @param heightInPx The height of the whitespace, in pixels.
|
||||
* @return An id that can be used later to mutate or delete the whitespace
|
||||
*/
|
||||
public insertWhitespace(afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): number {
|
||||
public insertWhitespace(afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): string {
|
||||
return this._whitespaces.insertWhitespace(afterLineNumber, ordinal, heightInPx, minWidth);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change properties associated with a certain whitespace.
|
||||
*/
|
||||
public changeWhitespace(id: number, newAfterLineNumber: number, newHeight: number): boolean {
|
||||
public changeWhitespace(id: string, newAfterLineNumber: number, newHeight: number): boolean {
|
||||
return this._whitespaces.changeWhitespace(id, newAfterLineNumber, newHeight);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ export class LinesLayout {
|
||||
* @param id The whitespace to remove
|
||||
* @return Returns true if the whitespace is found and it is removed.
|
||||
*/
|
||||
public removeWhitespace(id: number): boolean {
|
||||
public removeWhitespace(id: string): boolean {
|
||||
return this._whitespaces.removeWhitespace(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,13 +173,13 @@ export class ViewLayout extends Disposable implements IViewLayout {
|
||||
|
||||
// ---- IVerticalLayoutProvider
|
||||
|
||||
public addWhitespace(afterLineNumber: number, ordinal: number, height: number, minWidth: number): number {
|
||||
public addWhitespace(afterLineNumber: number, ordinal: number, height: number, minWidth: number): string {
|
||||
return this._linesLayout.insertWhitespace(afterLineNumber, ordinal, height, minWidth);
|
||||
}
|
||||
public changeWhitespace(id: number, newAfterLineNumber: number, newHeight: number): boolean {
|
||||
public changeWhitespace(id: string, newAfterLineNumber: number, newHeight: number): boolean {
|
||||
return this._linesLayout.changeWhitespace(id, newAfterLineNumber, newHeight);
|
||||
}
|
||||
public removeWhitespace(id: number): boolean {
|
||||
public removeWhitespace(id: string): boolean {
|
||||
return this._linesLayout.removeWhitespace(id);
|
||||
}
|
||||
public getVerticalOffsetForLineNumber(lineNumber: number): number {
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
|
||||
export interface IEditorWhitespace {
|
||||
readonly id: number;
|
||||
readonly id: string;
|
||||
readonly afterLineNumber: number;
|
||||
readonly heightInLines: number;
|
||||
}
|
||||
@@ -15,6 +17,10 @@ export interface IEditorWhitespace {
|
||||
*/
|
||||
export class WhitespaceComputer {
|
||||
|
||||
private static INSTANCE_COUNT = 0;
|
||||
|
||||
private readonly _instanceId: string;
|
||||
|
||||
/**
|
||||
* heights[i] is the height in pixels for whitespace at index i
|
||||
*/
|
||||
@@ -48,7 +54,7 @@ export class WhitespaceComputer {
|
||||
/**
|
||||
* ids[i] is the whitespace id of whitespace at index i
|
||||
*/
|
||||
private readonly _ids: number[];
|
||||
private readonly _ids: string[];
|
||||
|
||||
/**
|
||||
* index at which a whitespace is positioned (inside heights, afterLineNumbers, prefixSum members)
|
||||
@@ -65,6 +71,7 @@ export class WhitespaceComputer {
|
||||
private _minWidth: number;
|
||||
|
||||
constructor() {
|
||||
this._instanceId = strings.singleLetterHash(++WhitespaceComputer.INSTANCE_COUNT);
|
||||
this._heights = [];
|
||||
this._minWidths = [];
|
||||
this._ids = [];
|
||||
@@ -113,21 +120,20 @@ export class WhitespaceComputer {
|
||||
* @param heightInPx The height of the whitespace, in pixels.
|
||||
* @return An id that can be used later to mutate or delete the whitespace
|
||||
*/
|
||||
public insertWhitespace(afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): number {
|
||||
public insertWhitespace(afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): string {
|
||||
afterLineNumber = afterLineNumber | 0;
|
||||
ordinal = ordinal | 0;
|
||||
heightInPx = heightInPx | 0;
|
||||
minWidth = minWidth | 0;
|
||||
|
||||
let id = (++this._lastWhitespaceId);
|
||||
let id = this._instanceId + (++this._lastWhitespaceId);
|
||||
let insertionIndex = WhitespaceComputer.findInsertionIndex(this._afterLineNumbers, afterLineNumber, this._ordinals, ordinal);
|
||||
this._insertWhitespaceAtIndex(id, insertionIndex, afterLineNumber, ordinal, heightInPx, minWidth);
|
||||
this._minWidth = -1; /* marker for not being computed */
|
||||
return id;
|
||||
}
|
||||
|
||||
private _insertWhitespaceAtIndex(id: number, insertIndex: number, afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): void {
|
||||
id = id | 0;
|
||||
private _insertWhitespaceAtIndex(id: string, insertIndex: number, afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): void {
|
||||
insertIndex = insertIndex | 0;
|
||||
afterLineNumber = afterLineNumber | 0;
|
||||
ordinal = ordinal | 0;
|
||||
@@ -150,15 +156,14 @@ export class WhitespaceComputer {
|
||||
}
|
||||
}
|
||||
|
||||
this._whitespaceId2Index[id.toString()] = insertIndex;
|
||||
this._whitespaceId2Index[id] = insertIndex;
|
||||
this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, insertIndex - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change properties associated with a certain whitespace.
|
||||
*/
|
||||
public changeWhitespace(id: number, newAfterLineNumber: number, newHeight: number): boolean {
|
||||
id = id | 0;
|
||||
public changeWhitespace(id: string, newAfterLineNumber: number, newHeight: number): boolean {
|
||||
newAfterLineNumber = newAfterLineNumber | 0;
|
||||
newHeight = newHeight | 0;
|
||||
|
||||
@@ -175,13 +180,11 @@ export class WhitespaceComputer {
|
||||
* @param newHeightInPx The new height of the whitespace, in pixels
|
||||
* @return Returns true if the whitespace is found and if the new height is different than the old height
|
||||
*/
|
||||
public changeWhitespaceHeight(id: number, newHeightInPx: number): boolean {
|
||||
id = id | 0;
|
||||
public changeWhitespaceHeight(id: string, newHeightInPx: number): boolean {
|
||||
newHeightInPx = newHeightInPx | 0;
|
||||
|
||||
let sid = id.toString();
|
||||
if (this._whitespaceId2Index.hasOwnProperty(sid)) {
|
||||
let index = this._whitespaceId2Index[sid];
|
||||
if (this._whitespaceId2Index.hasOwnProperty(id)) {
|
||||
let index = this._whitespaceId2Index[id];
|
||||
if (this._heights[index] !== newHeightInPx) {
|
||||
this._heights[index] = newHeightInPx;
|
||||
this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, index - 1);
|
||||
@@ -198,13 +201,11 @@ export class WhitespaceComputer {
|
||||
* @param newAfterLineNumber The new line number the whitespace will follow
|
||||
* @return Returns true if the whitespace is found and if the new line number is different than the old line number
|
||||
*/
|
||||
public changeWhitespaceAfterLineNumber(id: number, newAfterLineNumber: number): boolean {
|
||||
id = id | 0;
|
||||
public changeWhitespaceAfterLineNumber(id: string, newAfterLineNumber: number): boolean {
|
||||
newAfterLineNumber = newAfterLineNumber | 0;
|
||||
|
||||
let sid = id.toString();
|
||||
if (this._whitespaceId2Index.hasOwnProperty(sid)) {
|
||||
let index = this._whitespaceId2Index[sid];
|
||||
if (this._whitespaceId2Index.hasOwnProperty(id)) {
|
||||
let index = this._whitespaceId2Index[id];
|
||||
if (this._afterLineNumbers[index] !== newAfterLineNumber) {
|
||||
// `afterLineNumber` changed for this whitespace
|
||||
|
||||
@@ -236,14 +237,10 @@ export class WhitespaceComputer {
|
||||
* @param id The whitespace to remove
|
||||
* @return Returns true if the whitespace is found and it is removed.
|
||||
*/
|
||||
public removeWhitespace(id: number): boolean {
|
||||
id = id | 0;
|
||||
|
||||
let sid = id.toString();
|
||||
|
||||
if (this._whitespaceId2Index.hasOwnProperty(sid)) {
|
||||
let index = this._whitespaceId2Index[sid];
|
||||
delete this._whitespaceId2Index[sid];
|
||||
public removeWhitespace(id: string): boolean {
|
||||
if (this._whitespaceId2Index.hasOwnProperty(id)) {
|
||||
let index = this._whitespaceId2Index[id];
|
||||
delete this._whitespaceId2Index[id];
|
||||
this._removeWhitespaceAtIndex(index);
|
||||
this._minWidth = -1; /* marker for not being computed */
|
||||
return true;
|
||||
@@ -459,7 +456,7 @@ export class WhitespaceComputer {
|
||||
* @param index The index of the whitespace.
|
||||
* @return `id` of whitespace at `index`.
|
||||
*/
|
||||
public getIdForWhitespaceIndex(index: number): number {
|
||||
public getIdForWhitespaceIndex(index: number): string {
|
||||
index = index | 0;
|
||||
|
||||
return this._ids[index];
|
||||
|
||||
@@ -17,7 +17,7 @@ import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceCompute
|
||||
import { ITheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export interface IViewWhitespaceViewportData {
|
||||
readonly id: number;
|
||||
readonly id: string;
|
||||
readonly afterLineNumber: number;
|
||||
readonly verticalOffset: number;
|
||||
readonly height: number;
|
||||
@@ -74,15 +74,15 @@ export interface IViewLayout {
|
||||
* Reserve rendering space.
|
||||
* @return an identifier that can be later used to remove or change the whitespace.
|
||||
*/
|
||||
addWhitespace(afterLineNumber: number, ordinal: number, height: number, minWidth: number): number;
|
||||
addWhitespace(afterLineNumber: number, ordinal: number, height: number, minWidth: number): string;
|
||||
/**
|
||||
* Change the properties of a whitespace.
|
||||
*/
|
||||
changeWhitespace(id: number, newAfterLineNumber: number, newHeight: number): boolean;
|
||||
changeWhitespace(id: string, newAfterLineNumber: number, newHeight: number): boolean;
|
||||
/**
|
||||
* Remove rendering space
|
||||
*/
|
||||
removeWhitespace(id: number): boolean;
|
||||
removeWhitespace(id: string): boolean;
|
||||
/**
|
||||
* Get the layout information for whitespaces currently in the viewport
|
||||
*/
|
||||
|
||||
@@ -193,7 +193,7 @@ export class CodeLensWidget {
|
||||
|
||||
private readonly _editor: editorBrowser.ICodeEditor;
|
||||
private readonly _viewZone!: CodeLensViewZone;
|
||||
private readonly _viewZoneId!: number;
|
||||
private readonly _viewZoneId!: string;
|
||||
private readonly _contentWidget!: CodeLensContentWidget;
|
||||
private _decorationIds: string[];
|
||||
private _data: CodeLensItem[];
|
||||
|
||||
@@ -116,7 +116,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
private readonly _replaceFocusTracker: dom.IFocusTracker;
|
||||
private readonly _replaceInputFocused: IContextKey<boolean>;
|
||||
private _viewZone?: FindWidgetViewZone;
|
||||
private _viewZoneId?: number;
|
||||
private _viewZoneId?: string;
|
||||
|
||||
private _resizeSash!: Sash;
|
||||
private _resized!: boolean;
|
||||
@@ -224,15 +224,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
if (!this._isVisible) {
|
||||
return;
|
||||
}
|
||||
if (this._viewZoneId === undefined) {
|
||||
return;
|
||||
}
|
||||
this._codeEditor.changeViewZones((accessor) => {
|
||||
if (this._viewZoneId) {
|
||||
accessor.removeZone(this._viewZoneId);
|
||||
}
|
||||
this._viewZoneId = undefined;
|
||||
});
|
||||
this._viewZoneId = undefined;
|
||||
}));
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IMarkdownString } from 'vs/base/common/htmlContent';
|
||||
import { renderMarkdown, RenderOptions } from 'vs/base/browser/htmlContentRenderer';
|
||||
import { renderMarkdown, MarkdownRenderOptions } from 'vs/base/browser/markdownRenderer';
|
||||
import { IOpenerService, NullOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
@@ -33,7 +33,7 @@ export class MarkdownRenderer extends Disposable {
|
||||
super();
|
||||
}
|
||||
|
||||
private getOptions(disposeables: DisposableStore): RenderOptions {
|
||||
private getOptions(disposeables: DisposableStore): MarkdownRenderOptions {
|
||||
return {
|
||||
codeBlockRenderer: (languageAlias, value) => {
|
||||
// In markdown,
|
||||
|
||||
@@ -27,6 +27,7 @@ export const KnownSnippetVariableNames: { [key: string]: true } = Object.freeze(
|
||||
'CURRENT_DAY_NAME_SHORT': true,
|
||||
'CURRENT_MONTH_NAME': true,
|
||||
'CURRENT_MONTH_NAME_SHORT': true,
|
||||
'CURRENT_SECONDS_UNIX': true,
|
||||
'SELECTION': true,
|
||||
'CLIPBOARD': true,
|
||||
'TM_SELECTED_TEXT': true,
|
||||
@@ -245,6 +246,8 @@ export class TimeBasedVariableResolver implements VariableResolver {
|
||||
return TimeBasedVariableResolver.monthNames[new Date().getMonth()];
|
||||
} else if (name === 'CURRENT_MONTH_NAME_SHORT') {
|
||||
return TimeBasedVariableResolver.monthNamesShort[new Date().getMonth()];
|
||||
} else if (name === 'CURRENT_SECONDS_UNIX') {
|
||||
return String(Math.floor(Date.now() / 1000));
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
||||
@@ -281,6 +281,7 @@ suite('Snippet Variables Resolver', function () {
|
||||
assertVariableResolve3(resolver, 'CURRENT_DAY_NAME_SHORT');
|
||||
assertVariableResolve3(resolver, 'CURRENT_MONTH_NAME');
|
||||
assertVariableResolve3(resolver, 'CURRENT_MONTH_NAME_SHORT');
|
||||
assertVariableResolve3(resolver, 'CURRENT_SECONDS_UNIX');
|
||||
});
|
||||
|
||||
test('creating snippet - format-condition doesn\'t work #53617', function () {
|
||||
|
||||
@@ -51,7 +51,7 @@ const WIDGET_ID = 'vs.editor.contrib.zoneWidget';
|
||||
export class ViewZoneDelegate implements IViewZone {
|
||||
|
||||
public domNode: HTMLElement;
|
||||
public id: number = 0; // A valid zone id should be greater than 0
|
||||
public id: string = ''; // A valid zone id should be greater than 0
|
||||
public afterLineNumber: number;
|
||||
public afterColumn: number;
|
||||
public heightInLines: number;
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'vs/css!./accessibilityHelp';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';
|
||||
import { renderFormattedText } from 'vs/base/browser/htmlContentRenderer';
|
||||
import { renderFormattedText } from 'vs/base/browser/formattedTextRenderer';
|
||||
import { alert } from 'vs/base/browser/ui/aria/aria';
|
||||
import { Widget } from 'vs/base/browser/ui/widget';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
|
||||
Reference in New Issue
Block a user