Reduce indent levels for switch/case

This commit is contained in:
Matt Bierner 2022-03-11 13:11:59 -08:00
parent 5a7b43ee27
commit b83e48cf00
No known key found for this signature in database
GPG key ID: 099C331567E11888

View file

@ -563,11 +563,11 @@ var requirejs = (function() {
}
switch (data.type) {
case 'initialized':
case 'initialized': {
this.initializeWebViewState();
break;
case 'dimension':
{
}
case 'dimension': {
for (const update of data.updates) {
const height = update.height;
if (update.isOutput) {
@ -583,8 +583,7 @@ var requirejs = (function() {
}
break;
}
case 'mouseenter':
{
case 'mouseenter': {
const resolvedResult = this.resolveOutputId(data.id);
if (resolvedResult) {
const latestCell = this.notebookEditor.getCellByInfo(resolvedResult.cellInfo);
@ -594,8 +593,7 @@ var requirejs = (function() {
}
break;
}
case 'mouseleave':
{
case 'mouseleave': {
const resolvedResult = this.resolveOutputId(data.id);
if (resolvedResult) {
const latestCell = this.notebookEditor.getCellByInfo(resolvedResult.cellInfo);
@ -605,8 +603,7 @@ var requirejs = (function() {
}
break;
}
case 'outputFocus':
{
case 'outputFocus': {
const resolvedResult = this.resolveOutputId(data.id);
if (resolvedResult) {
const latestCell = this.notebookEditor.getCellByInfo(resolvedResult.cellInfo);
@ -616,8 +613,7 @@ var requirejs = (function() {
}
break;
}
case 'outputBlur':
{
case 'outputBlur': {
const resolvedResult = this.resolveOutputId(data.id);
if (resolvedResult) {
const latestCell = this.notebookEditor.getCellByInfo(resolvedResult.cellInfo);
@ -627,20 +623,17 @@ var requirejs = (function() {
}
break;
}
case 'scroll-ack':
{
case 'scroll-ack': {
// const date = new Date();
// const top = data.data.top;
// console.log('ack top ', top, ' version: ', data.version, ' - ', date.getMinutes() + ':' + date.getSeconds() + ':' + date.getMilliseconds());
break;
}
case 'scroll-to-reveal':
{
case 'scroll-to-reveal': {
this.notebookEditor.setScrollTop(data.scrollTop);
break;
}
case 'did-scroll-wheel':
{
case 'did-scroll-wheel': {
this.notebookEditor.triggerScroll({
...data.payload,
preventDefault: () => { },
@ -648,8 +641,7 @@ var requirejs = (function() {
});
break;
}
case 'focus-editor':
{
case 'focus-editor': {
const cell = this.notebookEditor.getCellById(data.cellId);
if (cell) {
if (data.focusNext) {
@ -660,13 +652,11 @@ var requirejs = (function() {
}
break;
}
case 'clicked-data-url':
{
case 'clicked-data-url': {
this._onDidClickDataLink(data);
break;
}
case 'clicked-link':
{
case 'clicked-link': {
let linkToOpen: URI | string | undefined;
if (matchesScheme(data.href, Schemas.command)) {
const ret = /command\:workbench\.action\.openLargeOutput\?(.*)/.exec(data.href);
@ -717,18 +707,15 @@ var requirejs = (function() {
}
break;
}
case 'customKernelMessage':
{
case 'customKernelMessage': {
this._onMessage.fire({ message: data.message });
break;
}
case 'customRendererMessage':
{
case 'customRendererMessage': {
this.rendererMessaging?.postMessage(data.rendererId, data.message);
break;
}
case 'clickMarkupCell':
{
case 'clickMarkupCell': {
const cell = this.notebookEditor.getCellById(data.cellId);
if (cell) {
if (data.shiftKey || (isMacintosh ? data.metaKey : data.ctrlKey)) {
@ -741,8 +728,7 @@ var requirejs = (function() {
}
break;
}
case 'contextMenuMarkupCell':
{
case 'contextMenuMarkupCell': {
const cell = this.notebookEditor.getCellById(data.cellId);
if (cell) {
// Focus the cell first
@ -766,8 +752,7 @@ var requirejs = (function() {
}
break;
}
case 'toggleMarkupPreview':
{
case 'toggleMarkupPreview': {
const cell = this.notebookEditor.getCellById(data.cellId);
if (cell && !this.notebookEditor.creationOptions.isReadOnly) {
this.notebookEditor.setMarkupCellEditState(data.cellId, CellEditState.Editing);
@ -775,34 +760,29 @@ var requirejs = (function() {
}
break;
}
case 'mouseEnterMarkupCell':
{
case 'mouseEnterMarkupCell': {
const cell = this.notebookEditor.getCellById(data.cellId);
if (cell instanceof MarkupCellViewModel) {
cell.cellIsHovered = true;
}
break;
}
case 'mouseLeaveMarkupCell':
{
case 'mouseLeaveMarkupCell': {
const cell = this.notebookEditor.getCellById(data.cellId);
if (cell instanceof MarkupCellViewModel) {
cell.cellIsHovered = false;
}
break;
}
case 'cell-drag-start':
{
case 'cell-drag-start': {
this.notebookEditor.didStartDragMarkupCell(data.cellId, data);
break;
}
case 'cell-drag':
{
case 'cell-drag': {
this.notebookEditor.didDragMarkupCell(data.cellId, data);
break;
}
case 'cell-drop':
{
case 'cell-drop': {
this.notebookEditor.didDropMarkupCell(data.cellId, {
dragOffsetY: data.dragOffsetY,
ctrlKey: data.ctrlKey,
@ -810,13 +790,11 @@ var requirejs = (function() {
});
break;
}
case 'cell-drag-end':
{
case 'cell-drag-end': {
this.notebookEditor.didEndDragMarkupCell(data.cellId);
break;
}
case 'renderedMarkup':
{
case 'renderedMarkup': {
const cell = this.notebookEditor.getCellById(data.cellId);
if (cell instanceof MarkupCellViewModel) {
cell.renderedHtml = data.html;
@ -825,8 +803,7 @@ var requirejs = (function() {
this._handleHighlightCodeBlock(data.codeBlocks);
break;
}
case 'renderedCellOutput':
{
case 'renderedCellOutput': {
this._handleHighlightCodeBlock(data.codeBlocks);
break;
}