Skip to content

Commit

Permalink
Fix element names bug (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanraposo committed Jan 14, 2021
1 parent 9dd0bb4 commit 409d6de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
14 changes: 6 additions & 8 deletions src/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,20 +570,18 @@ export class Element extends vscode.TreeItem {
command: 'showElementInfo',
arguments: [this],
};

if (viewMode === ViewMode.standard) {
this.label = this.elementData.groupedName;
}

if (viewMode === ViewMode.palette) {
this.label = this.elementData.titleName;
}
this.dataProvider = dataProvider;

this.update();
}

private update(): void {
if (this.dataProvider.viewMode === ViewMode.standard) {
this.label = this.elementData.groupedName;
}
if (this.dataProvider.viewMode === ViewMode.palette) {
this.label = this.elementData.titleName;
}
this.colorConfig = this.dataProvider.colorConfigs[this.elementData.fullName];
const effectiveColor = getEffectiveColor(this.colorConfig);
if (effectiveColor) {
Expand Down
3 changes: 1 addition & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { ElementProvider, ViewMode } from './elements';
import { InfoProvider } from './info';
import { TargetingModeStatusBarItem } from './statusbar';

let elementProvider: ElementProvider;
let infoProvider: InfoProvider;

const config = getConfig();
Expand All @@ -26,7 +25,7 @@ export function activate(context: vscode.ExtensionContext) {
vscode.window.registerTreeDataProvider('codeui.views.info', infoProvider);
registerCommand('showElementInfo', (element) => infoProvider.updateSelectedElement(element));

elementProvider = new ElementProvider(ViewMode.standard);
let elementProvider: ElementProvider = new ElementProvider(ViewMode.standard);
vscode.window.registerTreeDataProvider('codeui.views.elements', elementProvider);
registerCommand('customize', (element) => elementProvider.customize(element));
registerCommand('adjustBrightness', (element) => elementProvider.adjustBrightness(element));
Expand Down

0 comments on commit 409d6de

Please sign in to comment.