Skip to content

Commit c3084e8

Browse files
committed
Merge branch 'hotfix-0.6.1'
2 parents 7305575 + fbf5846 commit c3084e8

File tree

7 files changed

+43
-32
lines changed

7 files changed

+43
-32
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

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

5+
## v0.6.1 [#](https://github.com/appliedengesign/vscode-gcode-syntax/releases/tag/v0.6.1)
6+
7+
### Fixes
8+
9+
- Fixed missing icons in tree / stats views
10+
- Removed redundant refresh icons in stats view
11+
- Added placeholder for stats without auto refresh enabled
12+
513
## v0.6.0 [#](https://github.com/appliedengesign/vscode-gcode-syntax/releases/tag/v0.6.0)
614

715
### New Features

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Visit our [projects page](https://github.com/appliedengdesign/vscode-gcode-synta
135135

136136
## Changelog
137137

138-
Latest Version: v0.6.0
138+
Latest Version: v0.6.1
139139

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

package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "G-Code Syntax",
44
"shortName": "G-Code",
55
"description": "Turn VSCode into a fully capable G-Code editor, including language support & more.",
6-
"version": "0.6.0",
6+
"version": "0.6.1",
77
"license": "MIT",
88
"publisher": "appliedengdesign",
99
"author": {
@@ -277,7 +277,7 @@
277277
},
278278
{
279279
"command": "gcode.views.stats.refresh",
280-
"when": "view == gcode.views.stats && config.gcode.statsEnable",
280+
"when": "view == gcode.views.stats",
281281
"group": "navigation"
282282
},
283283
{
@@ -286,13 +286,6 @@
286286
"group": "navigation"
287287
}
288288
],
289-
"view/item/context": [
290-
{
291-
"command": "gcode.views.stats.refresh",
292-
"when": "view == gcode.views.stats && config.gcode.statsEnable",
293-
"group": "inline"
294-
}
295-
],
296289
"commandPalette": [
297290
{
298291
"command": "gcode.views.navTree.refresh",

src/control.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -118,23 +118,10 @@ export class Control {
118118
);
119119

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

124-
if (config.getParam('views.stats.enabled')) {
125-
Logger.log('Loading Stats View...');
126-
context.subscriptions.push((this._statsView = new StatsView()));
127-
} else {
128-
let disposable: Disposable;
129-
// eslint-disable-next-line prefer-const
130-
disposable = configuration.onDidChange(e => {
131-
if (configuration.changed(e, 'views.stats.enabled')) {
132-
disposable.dispose();
133-
Logger.log('Loading Stats View...');
134-
context.subscriptions.push((this._statsView = new StatsView()));
135-
}
136-
});
137-
}
124+
Logger.log(`Stats AutoRefresh: ${configuration.getParam('views.stats.autoRefresh') ? 'Enabled' : 'Disabled'}`);
138125

139126
// Load Support Heart to Statusbar
140127
this._statusBarControl.updateStatusBar(

src/util/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export const constants: IConstants = {
4646
},
4747
extensionOutputChannelName: gcode.packageJSON.shortName,
4848
extensionQualifiedId: extensionQualifiedId,
49-
gcodeIcon: path.join(__dirname, '..', '..', 'resources', 'icons', 'gcode.svg'),
50-
iconsPath: path.join(__dirname, '..', '..', 'resources', 'icons'),
49+
gcodeIcon: path.join(__dirname, '..', 'resources', 'icons', 'gcode.svg'),
50+
iconsPath: path.join(__dirname, '..', 'resources', 'icons'),
5151
iconExt: '.svg',
5252
langId: gcode.packageJSON.contributes.languages[0].id,
5353
urls: {

src/views/nodes/StatsNode.ts renamed to src/views/nodes/statsNode.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const enum StatsType {
1414
ToolChanges,
1515
RunTime,
1616
Error,
17+
Info,
1718
}
1819

1920
export class StatsNode extends ViewNode {
@@ -28,6 +29,8 @@ export class StatsNode extends ViewNode {
2829
private tTip?: string,
2930
) {
3031
super(name, desc, ResourceType.Stats);
32+
33+
this.setIcon();
3134
}
3235

3336
setIcon(): void {

src/views/statsView.ts

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
* -------------------------------------------------------------------------------------------- */
55
'use strict';
66

7-
import { commands, ConfigurationChangeEvent, TextDocumentChangeEvent, TreeItemCollapsibleState, window } from 'vscode';
7+
import {
8+
commands,
9+
ConfigurationChangeEvent,
10+
TextDocumentChangeEvent,
11+
ThemeIcon,
12+
TreeItemCollapsibleState,
13+
window,
14+
} from 'vscode';
815
import { Control } from '../control';
916
import { configuration } from '../util/config';
1017
import { constants, Contexts } from '../util/constants';
@@ -21,7 +28,6 @@ const StatsViewInfo = {
2128
ViewName: 'Stats',
2229
Config: {
2330
AutoRefresh: 'views.stats.autoRefresh',
24-
Enabled: 'views.stats.enabled',
2531
MaxAutoRefresh: 'views.maxAutoRefresh',
2632
},
2733
Context: Contexts.ViewsStatsEnabled,
@@ -104,7 +110,7 @@ export class StatsView extends GView<StatsNode> {
104110
} else {
105111
void Control.setContext(Contexts.ViewsStatsEnabled, false);
106112

107-
this._children = [];
113+
this._children = [this.placeholder()];
108114
this._onDidChangeTreeData.fire(undefined);
109115
}
110116
}
@@ -122,7 +128,7 @@ export class StatsView extends GView<StatsNode> {
122128
} else {
123129
void Control.setContext(Contexts.ViewsStatsEnabled, false);
124130

125-
this._children = [];
131+
this._children = [this.placeholder()];
126132
this._onDidChangeTreeData.fire(undefined);
127133
}
128134
}
@@ -258,4 +264,18 @@ export class StatsView extends GView<StatsNode> {
258264
return false;
259265
}
260266
}
267+
268+
private placeholder(): StatsNode {
269+
const ph = new StatsNode(
270+
StatsType.Info,
271+
'AutoRefresh is Disabled',
272+
undefined,
273+
ResourceType.Stats,
274+
TreeItemCollapsibleState.None,
275+
);
276+
277+
ph.iconPath = new ThemeIcon('extensions-info-message');
278+
279+
return ph;
280+
}
261281
}

0 commit comments

Comments
 (0)