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;
if (group !== panel) {
group.setActive(false);
// group.api._onDidActiveChange.fire({ isActive: false });
// group.api.setActive(false);
} else {
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) => {
const { isVisible } = event;
const { containerApi } = this.params as GridviewInitParameters;
// this.api.setVisible(isVisible);
containerApi.setVisible(this, isVisible);
}),
this.api.onActiveChange(() => {

View File

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

View File

@ -1,7 +1,10 @@
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 { PaneTransfer } from '../dnd/dataTransfer';
import { Emitter, Event } from '../events';
import { IDisposable } from '../lifecycle';
import { Orientation } from '../splitview/core/splitview';
@ -10,7 +13,6 @@ import {
PanePanelInitParameter,
PaneviewPanel,
} from './paneviewPanel';
import { addClasses } from '../dom';
interface ViewContainer {
readonly title: string;

View File

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

View File

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