Merge VS Code 1.23.1 (#1520)

This commit is contained in:
Matt Irvine
2018-06-05 11:24:51 -07:00
committed by GitHub
parent e3baf5c443
commit 0c58f09e59
3651 changed files with 74249 additions and 48599 deletions

View File

@@ -150,7 +150,7 @@ export class PlanXmlParser {
this.doc = this.parser.parseFromString(planXml, 'application/xml');
this.planXml = planXml;
let queryPlanNode = this.findChildren(this.doc.childNodes[0], 'QueryPlan');
let queryPlanNode = this.findChildren(this.doc.children[0], 'QueryPlan');
if (queryPlanNode && queryPlanNode.length > 0) {
this.root = new PlanNode();
let ops = this.createPlanNodes(queryPlanNode[0], 'RelOp', this.root);
@@ -192,25 +192,25 @@ export class PlanXmlParser {
return list;
}
private findChildren(node: Node, elementName: string, untilNode: string = undefined): Node[] {
let nodes: Node[] = [];
if (node === undefined) {
private findChildren(element: Element, elementName: string, untilNode: string = undefined): Element[] {
let elements: Element[] = [];
if (element === undefined) {
return undefined;
}
for (var index = 0; index < node.childNodes.length; index++) {
if (node.childNodes[index].nodeName.toLocaleLowerCase() === elementName.toLocaleLowerCase()) {
nodes = nodes.concat(node.childNodes[index]);
for (var index = 0; index < element.childNodes.length; index++) {
if (element.childNodes[index].nodeName.toLocaleLowerCase() === elementName.toLocaleLowerCase()) {
elements = elements.concat(element.children[index]);
}
}
if (nodes.length > 0) {
return nodes;
if (elements.length > 0) {
return elements;
}
for (var index = 0; index < node.childNodes.length; index++) {
if (untilNode && node.childNodes[index].nodeName === untilNode) {
for (var index = 0; index < element.childNodes.length; index++) {
if (untilNode && element.childNodes[index].nodeName === untilNode) {
continue;
}
let result = this.findChildren(node.childNodes[index], elementName, untilNode);
let result = this.findChildren(element.children[index], elementName, untilNode);
if (result !== undefined) {
return result;
}
@@ -219,10 +219,10 @@ export class PlanXmlParser {
return undefined;
}
private createPlanNodes(node: Node, elementName: string, root: PlanNode): PlanNode[] {
private createPlanNodes(element: Element, elementName: string, root: PlanNode): PlanNode[] {
let nodePlans: PlanNode[] = [];
let children = this.findChildren(node, elementName);
let children = this.findChildren(element, elementName);
if (children) {
for (var index = 0; index < children.length; index++) {
let childNode = children[index];
@@ -249,38 +249,38 @@ export class PlanXmlParser {
return nodePlans;
}
private convertToPlanNode(node: Node): PlanNode {
private convertToPlanNode(element: Element): PlanNode {
let planNode = new PlanNode();
planNode.id = this.findAttribute(node.attributes, 'NodeId');
planNode.logicalOp = this.findAttribute(node.attributes, 'LogicalOp');
planNode.physicalOp = this.findAttribute(node.attributes, 'PhysicalOp');
planNode.subtreeCost = +this.findAttribute(node.attributes, 'EstimatedTotalSubtreeCost');
planNode.estimateRows = this.findAttribute(node.attributes, 'EstimateRows');
planNode.estimateCpu = this.findAttribute(node.attributes, 'EstimateCPU');
planNode.estimateIo = this.findAttribute(node.attributes, 'EstimateIO');
planNode.estimateRebinds = this.findAttribute(node.attributes, 'EstimateRebinds');
planNode.estimateRewinds = this.findAttribute(node.attributes, 'EstimateRewinds');
planNode.parallel = this.findAttribute(node.attributes, 'Parallel') === '1';
planNode.partitioned = this.findAttribute(node.attributes, 'Partitioned') === '1';
planNode.id = this.findAttribute(element.attributes, 'NodeId');
planNode.logicalOp = this.findAttribute(element.attributes, 'LogicalOp');
planNode.physicalOp = this.findAttribute(element.attributes, 'PhysicalOp');
planNode.subtreeCost = +this.findAttribute(element.attributes, 'EstimatedTotalSubtreeCost');
planNode.estimateRows = this.findAttribute(element.attributes, 'EstimateRows');
planNode.estimateCpu = this.findAttribute(element.attributes, 'EstimateCPU');
planNode.estimateIo = this.findAttribute(element.attributes, 'EstimateIO');
planNode.estimateRebinds = this.findAttribute(element.attributes, 'EstimateRebinds');
planNode.estimateRewinds = this.findAttribute(element.attributes, 'EstimateRewinds');
planNode.parallel = this.findAttribute(element.attributes, 'Parallel') === '1';
planNode.partitioned = this.findAttribute(element.attributes, 'Partitioned') === '1';
return planNode;
}
private convertToRuntimeInfo(node: Node): RuntimePerThread {
private convertToRuntimeInfo(element: Element): RuntimePerThread {
let runtimeNode = new RuntimePerThread();
runtimeNode.actualExecutionMode = this.findAttribute(node.attributes, 'ActualExecutionMode');
runtimeNode.actualExecutions = +this.findAttribute(node.attributes, 'ActualExecutions');
runtimeNode.actualRow = +this.findAttribute(node.attributes, 'ActualRows');
runtimeNode.threadId = +this.findAttribute(node.attributes, 'Thread');
runtimeNode.actualExecutionMode = this.findAttribute(element.attributes, 'ActualExecutionMode');
runtimeNode.actualExecutions = +this.findAttribute(element.attributes, 'ActualExecutions');
runtimeNode.actualRow = +this.findAttribute(element.attributes, 'ActualRows');
runtimeNode.threadId = +this.findAttribute(element.attributes, 'Thread');
return runtimeNode;
}
private convertToObject(node: Node): IndexObject {
private convertToObject(element: Element): IndexObject {
let objectNode = new IndexObject();
objectNode.database = this.findAttribute(node.attributes, 'Database');
objectNode.index = this.findAttribute(node.attributes, 'Index');
objectNode.indexKind = this.findAttribute(node.attributes, 'IndexKind');
objectNode.schema = this.findAttribute(node.attributes, 'Schema');
objectNode.table = this.findAttribute(node.attributes, 'Table');
objectNode.database = this.findAttribute(element.attributes, 'Database');
objectNode.index = this.findAttribute(element.attributes, 'Index');
objectNode.indexKind = this.findAttribute(element.attributes, 'IndexKind');
objectNode.schema = this.findAttribute(element.attributes, 'Schema');
objectNode.table = this.findAttribute(element.attributes, 'Table');
return objectNode;
}

View File

@@ -6,7 +6,6 @@
import 'vs/css!sql/parts/query/editor/media/queryEditor';
import * as DOM from 'vs/base/browser/dom';
import { TPromise } from 'vs/base/common/winjs.base';
import { Dimension, Builder } from 'vs/base/browser/builder';
import { EditorOptions } from 'vs/workbench/common/editor';
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
@@ -41,11 +40,11 @@ export class QueryPlanEditor extends BaseEditor {
}
/**
* Called to create the editor in the parent builder.
* Called to create the editor in the parent element.
*/
public createEditor(parent: Builder): void {
public createEditor(parent: HTMLElement): void {
//Enable scrollbars when drawing area is larger than viewport
parent.overflow('auto');
parent.style.overflow = 'auto';
//Set background of parent to white (same as .qp-root from src\sql\parts\grid\load\css\qp.css)
//This is because the bottom-most tooltips can extend past the drawing area, which causes the
//scrolling area to have gaps on the bottom and left. So if the colors aren't matched then
@@ -54,7 +53,7 @@ export class QueryPlanEditor extends BaseEditor {
//during the load - but changing the background color was the simplest and least error prone
//(plus it's probable that we won't be using this control in the future anyways if development)
//continues on the Query plan feature
parent.background('#fff');
parent.style.background = '#fff';
}
/**
@@ -67,7 +66,7 @@ export class QueryPlanEditor extends BaseEditor {
* Updates the internal variable keeping track of the editor's size, and re-calculates the sash position.
* To be called when the container of this editor changes size.
*/
public layout(dimension: Dimension): void {
public layout(dimension: DOM.Dimension): void {
}
public setInput(input: QueryPlanInput, options: EditorOptions): TPromise<void> {
@@ -78,7 +77,7 @@ export class QueryPlanEditor extends BaseEditor {
if (!input.hasInitialized) {
this.bootstrapAngular(input);
}
this.revealElementWithTagName(input.uniqueSelector, this.getContainer().getHTMLElement());
this.revealElementWithTagName(input.uniqueSelector, this.getContainer());
return super.setInput(input, options);
}
@@ -114,7 +113,7 @@ export class QueryPlanEditor extends BaseEditor {
let uniqueSelector = this.instantiationService.invokeFunction(bootstrapAngular,
QueryPlanModule,
this.getContainer().getHTMLElement(),
this.getContainer(),
QUERYPLAN_SELECTOR,
params);
input.setUniqueSelector(uniqueSelector);