chore: fix sonar code smells

This commit is contained in:
mathuo 2021-11-16 22:11:25 +00:00
parent 760c28ff8c
commit 2faf43ef80
No known key found for this signature in database
GPG Key ID: C6EEDEFD6CA07281
6 changed files with 5 additions and 19 deletions

View File

@ -352,12 +352,8 @@ export class GridviewComponent
const group = groupItem.value; const group = groupItem.value;
if (group !== panel) { if (group !== panel) {
group.setActive(false); group.setActive(false);
// group.api._onDidActiveChange.fire({ isActive: false });
// group.api.setActive(false);
} else { } else {
group.setActive(true); group.setActive(true);
// group.api._onDidActiveChange.fire({ isActive: true });
// group.setActive(true);
} }
}); });
}) })

View File

@ -132,7 +132,6 @@ export abstract class GridviewPanel
this.api.onVisibilityChange((event) => { this.api.onVisibilityChange((event) => {
const { isVisible } = event; const { isVisible } = event;
const { containerApi } = this.params as GridviewInitParameters; const { containerApi } = this.params as GridviewInitParameters;
// this.api.setVisible(isVisible);
containerApi.setVisible(this, isVisible); containerApi.setVisible(this, isVisible);
}), }),
this.api.onActiveChange(() => { this.api.onActiveChange(() => {

View File

@ -608,7 +608,6 @@ export class Groupview extends CompositeDisposable implements IGroupview {
this.tabsContainer.hide(); this.tabsContainer.hide();
this.container.appendChild(this.watermark.element); this.container.appendChild(this.watermark.element);
// this.contentContainer.openPanel(this.watermark);
this.watermark.updateParentGroup(this.parent, true); this.watermark.updateParentGroup(this.parent, true);
} }
if (!this.isEmpty && this.watermark) { if (!this.isEmpty && this.watermark) {

View File

@ -1,7 +1,10 @@
import { DragHandler } from '../dnd/abstractDragHandler'; import { DragHandler } from '../dnd/abstractDragHandler';
import { getPaneData, LocalSelectionTransfer } from '../dnd/dataTransfer'; import {
getPaneData,
LocalSelectionTransfer,
PaneTransfer,
} from '../dnd/dataTransfer';
import { Droptarget, DroptargetEvent, Position } from '../dnd/droptarget'; import { Droptarget, DroptargetEvent, Position } from '../dnd/droptarget';
import { PaneTransfer } from '../dnd/dataTransfer';
import { Emitter, Event } from '../events'; import { Emitter, Event } from '../events';
import { IDisposable } from '../lifecycle'; import { IDisposable } from '../lifecycle';
import { Orientation } from '../splitview/core/splitview'; import { Orientation } from '../splitview/core/splitview';
@ -10,7 +13,6 @@ import {
PanePanelInitParameter, PanePanelInitParameter,
PaneviewPanel, PaneviewPanel,
} from './paneviewPanel'; } from './paneviewPanel';
import { addClasses } from '../dom';
interface ViewContainer { interface ViewContainer {
readonly title: string; readonly title: string;

View File

@ -856,27 +856,20 @@ export class Splitview {
(position > 0 || this.startSnappingEnabled) (position > 0 || this.startSnappingEnabled)
) { ) {
this.updateSash(sash, SashState.MINIMUM); this.updateSash(sash, SashState.MINIMUM);
// sash.state = SashState.Minimum;
} else if ( } else if (
snappedAfter && snappedAfter &&
collapsesDown[index] && collapsesDown[index] &&
(position < this.contentSize || this.endSnappingEnabled) (position < this.contentSize || this.endSnappingEnabled)
) { ) {
// sash.state = SashState.Maximum;
this.updateSash(sash, SashState.MAXIMUM); this.updateSash(sash, SashState.MAXIMUM);
} else { } else {
// sash.state = SashState.Disabled;
this.updateSash(sash, SashState.DISABLED); this.updateSash(sash, SashState.DISABLED);
} }
} else if (min && !max) { } else if (min && !max) {
// sash.state = SashState.Minimum;
this.updateSash(sash, SashState.MINIMUM); this.updateSash(sash, SashState.MINIMUM);
} else if (!min && max) { } else if (!min && max) {
// sash.state = SashState.Maximum;
this.updateSash(sash, SashState.MAXIMUM); this.updateSash(sash, SashState.MAXIMUM);
} else { } else {
// sash.state = SashState.Enabled;
this.updateSash(sash, SashState.ENABLED); this.updateSash(sash, SashState.ENABLED);
} }
} }

View File

@ -195,18 +195,15 @@ export class SplitviewComponent
this.getPanels() this.getPanels()
.filter((v) => v !== view) .filter((v) => v !== view)
.forEach((v) => { .forEach((v) => {
// v.api._;
v.api._onDidActiveChange.fire({ isActive: false }); v.api._onDidActiveChange.fire({ isActive: false });
if (!skipFocus) { if (!skipFocus) {
v.focus(); v.focus();
} }
// v.setActive(false, skipFocus);
}); });
view.api._onDidActiveChange.fire({ isActive: true }); view.api._onDidActiveChange.fire({ isActive: true });
if (!skipFocus) { if (!skipFocus) {
view.focus(); view.focus();
} }
// view.setActive(true, skipFocus);
} }
getPanels(): SplitviewPanel[] { getPanels(): SplitviewPanel[] {