Skip to content

Commit

Permalink
Merge branch 'hotfix-0.6.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecentola committed Apr 21, 2021
2 parents 7305575 + fbf5846 commit c3084e8
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 32 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All changes to G-Code Language Extension will be documented here.

## v0.6.1 [#](https://github.com/appliedengesign/vscode-gcode-syntax/releases/tag/v0.6.1)

### Fixes

- Fixed missing icons in tree / stats views
- Removed redundant refresh icons in stats view
- Added placeholder for stats without auto refresh enabled

## v0.6.0 [#](https://github.com/appliedengesign/vscode-gcode-syntax/releases/tag/v0.6.0)

### New Features
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Visit our [projects page](https://github.com/appliedengdesign/vscode-gcode-synta

## Changelog

Latest Version: v0.6.0
Latest Version: v0.6.1

Please refer to our [CHANGELOG](https://github.com/appliedengdesign/vscode-gcode-syntax/blob/master/CHANGELOG.md) doc.

Expand Down
11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "G-Code Syntax",
"shortName": "G-Code",
"description": "Turn VSCode into a fully capable G-Code editor, including language support & more.",
"version": "0.6.0",
"version": "0.6.1",
"license": "MIT",
"publisher": "appliedengdesign",
"author": {
Expand Down Expand Up @@ -277,7 +277,7 @@
},
{
"command": "gcode.views.stats.refresh",
"when": "view == gcode.views.stats && config.gcode.statsEnable",
"when": "view == gcode.views.stats",
"group": "navigation"
},
{
Expand All @@ -286,13 +286,6 @@
"group": "navigation"
}
],
"view/item/context": [
{
"command": "gcode.views.stats.refresh",
"when": "view == gcode.views.stats && config.gcode.statsEnable",
"group": "inline"
}
],
"commandPalette": [
{
"command": "gcode.views.navTree.refresh",
Expand Down
19 changes: 3 additions & 16 deletions src/control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,10 @@ export class Control {
);

// Load Stats View
Logger.log(`Stats: ${configuration.getParam('views.stats.enabled') ? 'Enabled' : 'Disabled'}`);
Logger.log(`Stats AutoRefresh: ${configuration.getParam('views.stats.autoRefresh') ? 'Enabled' : 'Disabled'}`);
Logger.log('Loading Stats View...');
context.subscriptions.push((this._statsView = new StatsView()));

if (config.getParam('views.stats.enabled')) {
Logger.log('Loading Stats View...');
context.subscriptions.push((this._statsView = new StatsView()));
} else {
let disposable: Disposable;
// eslint-disable-next-line prefer-const
disposable = configuration.onDidChange(e => {
if (configuration.changed(e, 'views.stats.enabled')) {
disposable.dispose();
Logger.log('Loading Stats View...');
context.subscriptions.push((this._statsView = new StatsView()));
}
});
}
Logger.log(`Stats AutoRefresh: ${configuration.getParam('views.stats.autoRefresh') ? 'Enabled' : 'Disabled'}`);

// Load Support Heart to Statusbar
this._statusBarControl.updateStatusBar(
Expand Down
4 changes: 2 additions & 2 deletions src/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export const constants: IConstants = {
},
extensionOutputChannelName: gcode.packageJSON.shortName,
extensionQualifiedId: extensionQualifiedId,
gcodeIcon: path.join(__dirname, '..', '..', 'resources', 'icons', 'gcode.svg'),
iconsPath: path.join(__dirname, '..', '..', 'resources', 'icons'),
gcodeIcon: path.join(__dirname, '..', 'resources', 'icons', 'gcode.svg'),
iconsPath: path.join(__dirname, '..', 'resources', 'icons'),
iconExt: '.svg',
langId: gcode.packageJSON.contributes.languages[0].id,
urls: {
Expand Down
3 changes: 3 additions & 0 deletions src/views/nodes/StatsNode.ts → src/views/nodes/statsNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const enum StatsType {
ToolChanges,
RunTime,
Error,
Info,
}

export class StatsNode extends ViewNode {
Expand All @@ -28,6 +29,8 @@ export class StatsNode extends ViewNode {
private tTip?: string,
) {
super(name, desc, ResourceType.Stats);

this.setIcon();
}

setIcon(): void {
Expand Down
28 changes: 24 additions & 4 deletions src/views/statsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
* -------------------------------------------------------------------------------------------- */
'use strict';

import { commands, ConfigurationChangeEvent, TextDocumentChangeEvent, TreeItemCollapsibleState, window } from 'vscode';
import {
commands,
ConfigurationChangeEvent,
TextDocumentChangeEvent,
ThemeIcon,
TreeItemCollapsibleState,
window,
} from 'vscode';
import { Control } from '../control';
import { configuration } from '../util/config';
import { constants, Contexts } from '../util/constants';
Expand All @@ -21,7 +28,6 @@ const StatsViewInfo = {
ViewName: 'Stats',
Config: {
AutoRefresh: 'views.stats.autoRefresh',
Enabled: 'views.stats.enabled',
MaxAutoRefresh: 'views.maxAutoRefresh',
},
Context: Contexts.ViewsStatsEnabled,
Expand Down Expand Up @@ -104,7 +110,7 @@ export class StatsView extends GView<StatsNode> {
} else {
void Control.setContext(Contexts.ViewsStatsEnabled, false);

this._children = [];
this._children = [this.placeholder()];
this._onDidChangeTreeData.fire(undefined);
}
}
Expand All @@ -122,7 +128,7 @@ export class StatsView extends GView<StatsNode> {
} else {
void Control.setContext(Contexts.ViewsStatsEnabled, false);

this._children = [];
this._children = [this.placeholder()];
this._onDidChangeTreeData.fire(undefined);
}
}
Expand Down Expand Up @@ -258,4 +264,18 @@ export class StatsView extends GView<StatsNode> {
return false;
}
}

private placeholder(): StatsNode {
const ph = new StatsNode(
StatsType.Info,
'AutoRefresh is Disabled',
undefined,
ResourceType.Stats,
TreeItemCollapsibleState.None,
);

ph.iconPath = new ThemeIcon('extensions-info-message');

return ph;
}
}

0 comments on commit c3084e8

Please sign in to comment.