mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-20 07:09:53 +01:00
Merge branch 'master' into joh/e5host
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
"t": "source.cpp meta.conditional.preprocessor.cpp entity.name.function.preprocessor.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795codeE26",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "entity.name.function: #DCDCAA"
|
||||
|
||||
@@ -549,11 +549,11 @@ class LeafNode implements ISplitView, IDisposable {
|
||||
}
|
||||
}
|
||||
|
||||
setVisible(visible: boolean): void {
|
||||
setVisible(visible: boolean, cachedVisibleSize?: number): void {
|
||||
if (visible) {
|
||||
this._cachedVisibleSize = undefined;
|
||||
} else {
|
||||
this._cachedVisibleSize = this._size;
|
||||
this._cachedVisibleSize = typeof cachedVisibleSize === 'number' ? cachedVisibleSize : this._size;
|
||||
}
|
||||
|
||||
if (this.view.setVisible) {
|
||||
|
||||
@@ -49,7 +49,7 @@ export interface IView {
|
||||
readonly priority?: LayoutPriority;
|
||||
readonly snap?: boolean;
|
||||
layout(size: number, orientation: Orientation): void;
|
||||
setVisible?(visible: boolean): void;
|
||||
setVisible?(visible: boolean, cachedVisibleSize?: number): void;
|
||||
}
|
||||
|
||||
interface ISashEvent {
|
||||
@@ -79,7 +79,7 @@ abstract class ViewItem {
|
||||
return typeof this._cachedVisibleSize === 'undefined';
|
||||
}
|
||||
|
||||
set visible(visible: boolean) {
|
||||
setVisible(visible: boolean, size?: number): void {
|
||||
if (visible === this.visible) {
|
||||
return;
|
||||
}
|
||||
@@ -88,14 +88,14 @@ abstract class ViewItem {
|
||||
this.size = clamp(this._cachedVisibleSize!, this.viewMinimumSize, this.viewMaximumSize);
|
||||
this._cachedVisibleSize = undefined;
|
||||
} else {
|
||||
this._cachedVisibleSize = this.size;
|
||||
this._cachedVisibleSize = typeof size === 'number' ? size : this.size;
|
||||
this.size = 0;
|
||||
}
|
||||
|
||||
dom.toggleClass(this.container, 'visible', visible);
|
||||
|
||||
if (this.view.setVisible) {
|
||||
this.view.setVisible(visible);
|
||||
this.view.setVisible(visible, this._cachedVisibleSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,6 +161,7 @@ interface ISashItem {
|
||||
interface ISashDragSnapState {
|
||||
readonly index: number;
|
||||
readonly limitDelta: number;
|
||||
readonly size: number;
|
||||
}
|
||||
|
||||
interface ISashDragState {
|
||||
@@ -453,7 +454,7 @@ export class SplitView extends Disposable {
|
||||
}
|
||||
|
||||
const viewItem = this.viewItems[index];
|
||||
viewItem.visible = visible;
|
||||
viewItem.setVisible(visible);
|
||||
|
||||
this.distributeEmptySpace(index);
|
||||
this.layoutViews();
|
||||
@@ -552,7 +553,8 @@ export class SplitView extends Disposable {
|
||||
|
||||
snapBefore = {
|
||||
index: snapBeforeIndex,
|
||||
limitDelta: viewItem.visible ? minDelta - halfSize : minDelta + halfSize
|
||||
limitDelta: viewItem.visible ? minDelta - halfSize : minDelta + halfSize,
|
||||
size: viewItem.size
|
||||
};
|
||||
}
|
||||
|
||||
@@ -562,7 +564,8 @@ export class SplitView extends Disposable {
|
||||
|
||||
snapAfter = {
|
||||
index: snapAfterIndex,
|
||||
limitDelta: viewItem.visible ? maxDelta + halfSize : maxDelta - halfSize
|
||||
limitDelta: viewItem.visible ? maxDelta + halfSize : maxDelta - halfSize,
|
||||
size: viewItem.size
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -740,14 +743,14 @@ export class SplitView extends Disposable {
|
||||
const snapView = this.viewItems[snapBefore.index];
|
||||
const visible = delta >= snapBefore.limitDelta;
|
||||
snapped = visible !== snapView.visible;
|
||||
snapView.visible = visible;
|
||||
snapView.setVisible(visible, snapBefore.size);
|
||||
}
|
||||
|
||||
if (!snapped && snapAfter) {
|
||||
const snapView = this.viewItems[snapAfter.index];
|
||||
const visible = delta < snapAfter.limitDelta;
|
||||
snapped = visible !== snapView.visible;
|
||||
snapView.visible = visible;
|
||||
snapView.setVisible(visible, snapAfter.size);
|
||||
}
|
||||
|
||||
if (snapped) {
|
||||
|
||||
@@ -228,7 +228,7 @@ export class MarkerNavigationWidget extends PeekViewWidget {
|
||||
|
||||
protected _fillHead(container: HTMLElement): void {
|
||||
super._fillHead(container);
|
||||
this._actionbarWidget.push(this.actions, { label: false, icon: true });
|
||||
this._actionbarWidget!.push(this.actions, { label: false, icon: true });
|
||||
}
|
||||
|
||||
protected _fillTitleIcon(container: HTMLElement): void {
|
||||
|
||||
@@ -84,12 +84,12 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
|
||||
private _onDidClose = new Emitter<PeekViewWidget>();
|
||||
|
||||
protected _headElement: HTMLDivElement;
|
||||
protected _primaryHeading: HTMLElement;
|
||||
protected _secondaryHeading: HTMLElement;
|
||||
protected _metaHeading: HTMLElement;
|
||||
protected _actionbarWidget: ActionBar;
|
||||
protected _bodyElement: HTMLDivElement;
|
||||
protected _headElement?: HTMLDivElement;
|
||||
protected _primaryHeading?: HTMLElement;
|
||||
protected _secondaryHeading?: HTMLElement;
|
||||
protected _metaHeading?: HTMLElement;
|
||||
protected _actionbarWidget?: ActionBar;
|
||||
protected _bodyElement?: HTMLDivElement;
|
||||
|
||||
constructor(editor: ICodeEditor, options: IPeekViewOptions = {}) {
|
||||
super(editor, options);
|
||||
@@ -139,8 +139,8 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
protected _fillContainer(container: HTMLElement): void {
|
||||
this.setCssClass('peekview-widget');
|
||||
|
||||
this._headElement = dom.$('.head');
|
||||
this._bodyElement = dom.$('.body');
|
||||
this._headElement = dom.$<HTMLDivElement>('.head');
|
||||
this._bodyElement = dom.$<HTMLDivElement>('.body');
|
||||
|
||||
this._fillHead(this._headElement);
|
||||
this._fillBody(this._bodyElement);
|
||||
@@ -151,7 +151,7 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
|
||||
protected _fillHead(container: HTMLElement): void {
|
||||
const titleElement = dom.$('.peekview-title');
|
||||
dom.append(this._headElement, titleElement);
|
||||
dom.append(this._headElement!, titleElement);
|
||||
dom.addStandardDisposableListener(titleElement, 'click', event => this._onTitleClick(event));
|
||||
|
||||
this._fillTitleIcon(titleElement);
|
||||
@@ -161,7 +161,7 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
dom.append(titleElement, this._primaryHeading, this._secondaryHeading, this._metaHeading);
|
||||
|
||||
const actionsContainer = dom.$('.peekview-actions');
|
||||
dom.append(this._headElement, actionsContainer);
|
||||
dom.append(this._headElement!, actionsContainer);
|
||||
|
||||
const actionBarOptions = this._getActionBarOptions();
|
||||
this._actionbarWidget = new ActionBar(actionsContainer, actionBarOptions);
|
||||
@@ -185,20 +185,24 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
}
|
||||
|
||||
public setTitle(primaryHeading: string, secondaryHeading?: string): void {
|
||||
this._primaryHeading.innerHTML = strings.escape(primaryHeading);
|
||||
this._primaryHeading.setAttribute('aria-label', primaryHeading);
|
||||
if (secondaryHeading) {
|
||||
this._secondaryHeading.innerHTML = strings.escape(secondaryHeading);
|
||||
} else {
|
||||
dom.clearNode(this._secondaryHeading);
|
||||
if (this._primaryHeading && this._secondaryHeading) {
|
||||
this._primaryHeading.innerHTML = strings.escape(primaryHeading);
|
||||
this._primaryHeading.setAttribute('aria-label', primaryHeading);
|
||||
if (secondaryHeading) {
|
||||
this._secondaryHeading.innerHTML = strings.escape(secondaryHeading);
|
||||
} else {
|
||||
dom.clearNode(this._secondaryHeading);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public setMetaTitle(value: string): void {
|
||||
if (value) {
|
||||
this._metaHeading.innerHTML = strings.escape(value);
|
||||
} else {
|
||||
dom.clearNode(this._metaHeading);
|
||||
if (this._metaHeading) {
|
||||
if (value) {
|
||||
this._metaHeading.innerHTML = strings.escape(value);
|
||||
} else {
|
||||
dom.clearNode(this._metaHeading);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,11 +224,15 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
}
|
||||
|
||||
protected _doLayoutHead(heightInPixel: number, widthInPixel: number): void {
|
||||
this._headElement.style.height = `${heightInPixel}px`;
|
||||
this._headElement.style.lineHeight = this._headElement.style.height;
|
||||
if (this._headElement) {
|
||||
this._headElement.style.height = `${heightInPixel}px`;
|
||||
this._headElement.style.lineHeight = this._headElement.style.height;
|
||||
}
|
||||
}
|
||||
|
||||
protected _doLayoutBody(heightInPixel: number, widthInPixel: number): void {
|
||||
this._bodyElement.style.height = `${heightInPixel}px`;
|
||||
if (this._bodyElement) {
|
||||
this._bodyElement.style.height = `${heightInPixel}px`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,13 +90,13 @@ export interface IProgress<T> {
|
||||
export class Progress<T> implements IProgress<T> {
|
||||
|
||||
private _callback: (data: T) => void;
|
||||
private _value: T;
|
||||
private _value?: T;
|
||||
|
||||
constructor(callback: (data: T) => void) {
|
||||
this._callback = callback;
|
||||
}
|
||||
|
||||
get value() {
|
||||
get value(): T | undefined {
|
||||
return this._value;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2786,7 +2786,7 @@ declare module 'vscode' {
|
||||
* *Note* that the eol-sequence will be applied to the
|
||||
* whole document.
|
||||
*/
|
||||
newEol: EndOfLine;
|
||||
newEol?: EndOfLine;
|
||||
|
||||
/**
|
||||
* Create a new TextEdit.
|
||||
|
||||
@@ -153,7 +153,7 @@ export class ExtHostDocumentSaveParticipant implements ExtHostDocumentSavePartic
|
||||
resourceEdit.edits.push({
|
||||
range: range && Range.from(range),
|
||||
text: newText,
|
||||
eol: EndOfLine.from(newEol)
|
||||
eol: newEol && EndOfLine.from(newEol)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,11 +151,11 @@ export class ExtHostTextEditorOptions implements vscode.TextEditorOptions {
|
||||
private _proxy: MainThreadTextEditorsShape;
|
||||
private _id: string;
|
||||
|
||||
private _tabSize: number;
|
||||
private _indentSize: number;
|
||||
private _insertSpaces: boolean;
|
||||
private _cursorStyle: TextEditorCursorStyle;
|
||||
private _lineNumbers: TextEditorLineNumbersStyle;
|
||||
private _tabSize!: number;
|
||||
private _indentSize!: number;
|
||||
private _insertSpaces!: boolean;
|
||||
private _cursorStyle!: TextEditorCursorStyle;
|
||||
private _lineNumbers!: TextEditorLineNumbersStyle;
|
||||
|
||||
constructor(proxy: MainThreadTextEditorsShape, id: string, source: IResolvedTextEditorConfiguration) {
|
||||
this._proxy = proxy;
|
||||
|
||||
@@ -442,7 +442,7 @@ export namespace TextEdit {
|
||||
export function from(edit: vscode.TextEdit): modes.TextEdit {
|
||||
return <modes.TextEdit>{
|
||||
text: edit.newText,
|
||||
eol: EndOfLine.from(edit.newEol),
|
||||
eol: edit.newEol && EndOfLine.from(edit.newEol),
|
||||
range: Range.from(edit.range)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -514,7 +514,7 @@ export class TextEdit {
|
||||
|
||||
protected _range: Range;
|
||||
protected _newText: string | null;
|
||||
protected _newEol: EndOfLine;
|
||||
protected _newEol?: EndOfLine;
|
||||
|
||||
get range(): Range {
|
||||
return this._range;
|
||||
@@ -538,11 +538,11 @@ export class TextEdit {
|
||||
this._newText = value;
|
||||
}
|
||||
|
||||
get newEol(): EndOfLine {
|
||||
get newEol(): EndOfLine | undefined {
|
||||
return this._newEol;
|
||||
}
|
||||
|
||||
set newEol(value: EndOfLine) {
|
||||
set newEol(value: EndOfLine | undefined) {
|
||||
if (value && typeof value !== 'number') {
|
||||
throw illegalArgument('newEol');
|
||||
}
|
||||
@@ -550,7 +550,7 @@ export class TextEdit {
|
||||
}
|
||||
|
||||
constructor(range: Range, newText: string | null) {
|
||||
this.range = range;
|
||||
this._range = range;
|
||||
this._newText = newText;
|
||||
}
|
||||
|
||||
@@ -798,7 +798,7 @@ export class Location {
|
||||
}
|
||||
|
||||
uri: URI;
|
||||
range: Range;
|
||||
range!: Range;
|
||||
|
||||
constructor(uri: URI, rangeOrPosition: Range | Position) {
|
||||
this.uri = uri;
|
||||
@@ -861,10 +861,10 @@ export class Diagnostic {
|
||||
|
||||
range: Range;
|
||||
message: string;
|
||||
source: string;
|
||||
code: string | number;
|
||||
severity: DiagnosticSeverity;
|
||||
relatedInformation: DiagnosticRelatedInformation[];
|
||||
source?: string;
|
||||
code?: string | number;
|
||||
relatedInformation?: DiagnosticRelatedInformation[];
|
||||
tags?: DiagnosticTag[];
|
||||
|
||||
constructor(range: Range, message: string, severity: DiagnosticSeverity = DiagnosticSeverity.Error) {
|
||||
@@ -989,7 +989,7 @@ export class SymbolInformation {
|
||||
}
|
||||
|
||||
name: string;
|
||||
location: Location;
|
||||
location!: Location;
|
||||
kind: SymbolKind;
|
||||
containerName: string | undefined;
|
||||
|
||||
@@ -1253,8 +1253,8 @@ export class SignatureInformation {
|
||||
export class SignatureHelp {
|
||||
|
||||
signatures: SignatureInformation[];
|
||||
activeSignature: number;
|
||||
activeParameter: number;
|
||||
activeSignature: number = 0;
|
||||
activeParameter: number = 0;
|
||||
|
||||
constructor() {
|
||||
this.signatures = [];
|
||||
@@ -1310,19 +1310,19 @@ export enum CompletionItemKind {
|
||||
export class CompletionItem implements vscode.CompletionItem {
|
||||
|
||||
label: string;
|
||||
kind: CompletionItemKind | undefined;
|
||||
kind?: CompletionItemKind;
|
||||
detail?: string;
|
||||
documentation?: string | MarkdownString;
|
||||
sortText?: string;
|
||||
filterText?: string;
|
||||
preselect?: boolean;
|
||||
insertText: string | SnippetString;
|
||||
insertText?: string | SnippetString;
|
||||
keepWhitespace?: boolean;
|
||||
range: Range;
|
||||
range?: Range;
|
||||
commitCharacters?: string[];
|
||||
textEdit: TextEdit;
|
||||
additionalTextEdits: TextEdit[];
|
||||
command: vscode.Command;
|
||||
textEdit?: TextEdit;
|
||||
additionalTextEdits?: TextEdit[];
|
||||
command?: vscode.Command;
|
||||
|
||||
constructor(label: string, kind?: CompletionItemKind) {
|
||||
this.label = label;
|
||||
|
||||
@@ -386,7 +386,7 @@ export class CallHierarchyTreePeekWidget extends PeekViewWidget {
|
||||
};
|
||||
this._changeDirectionAction = new ChangeHierarchyDirectionAction(this._direction, changeDirection);
|
||||
this._disposables.add(this._changeDirectionAction);
|
||||
this._actionbarWidget.push(this._changeDirectionAction, { icon: true, label: false });
|
||||
this._actionbarWidget!.push(this._changeDirectionAction, { icon: true, label: false });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ class DirtyDiffWidget extends PeekViewWidget {
|
||||
const changeTypeColor = getChangeTypeColor(this.themeService.getTheme(), changeType);
|
||||
this.style({ frameColor: changeTypeColor, arrowColor: changeTypeColor });
|
||||
|
||||
this._actionbarWidget.context = [this.model.modified!.uri, this.model.changes, index];
|
||||
this._actionbarWidget!.context = [this.model.modified!.uri, this.model.changes, index];
|
||||
this.show(position, height);
|
||||
this.editor.focus();
|
||||
}
|
||||
@@ -255,11 +255,11 @@ class DirtyDiffWidget extends PeekViewWidget {
|
||||
|
||||
this._disposables.add(previous);
|
||||
this._disposables.add(next);
|
||||
this._actionbarWidget.push([previous, next], { label: false, icon: true });
|
||||
this._actionbarWidget!.push([previous, next], { label: false, icon: true });
|
||||
|
||||
const actions: IAction[] = [];
|
||||
this._disposables.add(createAndFillInActionBarActions(this.menu, { shouldForwardArgs: true }, actions));
|
||||
this._actionbarWidget.push(actions, { label: false, icon: true });
|
||||
this._actionbarWidget!.push(actions, { label: false, icon: true });
|
||||
}
|
||||
|
||||
protected _getActionBarOptions(): IActionBarOptions {
|
||||
|
||||
Reference in New Issue
Block a user