Skip to content

Commit 078592d

Browse files
committed
Refactor imports
Signed-off-by: Mike Centola <[email protected]>
1 parent 58a901d commit 078592d

File tree

3 files changed

+44
-35
lines changed

3 files changed

+44
-35
lines changed

src/providers/gcodeParser.ts

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import * as vscode from 'vscode';
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Applied Eng & Design All rights reserved.
3+
* Licensed under the MIT License. See License.md in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
'use strict';
6+
import { Range, TreeItemCollapsibleState } from 'vscode';
27
import {GCodeTreeNode} from './gcodeTree';
38

49
export class GCodeParser {
@@ -72,14 +77,14 @@ export class GCodeParser {
7277
case '0' :
7378
node = new GCodeTreeNode(
7479
'Rapid',
75-
vscode.TreeItemCollapsibleState.None,
80+
TreeItemCollapsibleState.None,
7681
);
7782
node.tooltip = '[G00] Rapid Motion';
7883
node.setIcon('rapid');
7984
node.command = {
8085
command: 'gcode.gcodeTree.Selection',
8186
title: "",
82-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
87+
arguments: [new Range(lnum, 0, lnum, len)]
8388
};
8489

8590
blocks.push(node);
@@ -90,14 +95,14 @@ export class GCodeParser {
9095
case '1' :
9196
node = new GCodeTreeNode(
9297
'Cutting',
93-
vscode.TreeItemCollapsibleState.None,
98+
TreeItemCollapsibleState.None,
9499
);
95100
node.tooltip = '[G01] Linear]';
96101
node.setIcon('cutting');
97102
node.command = {
98103
command: 'gcode.gcodeTree.Selection',
99104
title: "",
100-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
105+
arguments: [new Range(lnum, 0, lnum, len)]
101106
};
102107

103108
blocks.push(node);
@@ -108,14 +113,14 @@ export class GCodeParser {
108113
case '2' :
109114
node = new GCodeTreeNode(
110115
'CW Cutting',
111-
vscode.TreeItemCollapsibleState.None,
116+
TreeItemCollapsibleState.None,
112117
);
113118
node.tooltip = '[G02] CW Interpolation';
114119
node.setIcon('cwcutting');
115120
node.command = {
116121
command: 'gcode.gcodeTree.Selection',
117122
title: "",
118-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
123+
arguments: [new Range(lnum, 0, lnum, len)]
119124
};
120125

121126
blocks.push(node);
@@ -126,14 +131,14 @@ export class GCodeParser {
126131
case '3' :
127132
node = new GCodeTreeNode(
128133
'CCW Cutting',
129-
vscode.TreeItemCollapsibleState.None,
134+
TreeItemCollapsibleState.None,
130135
);
131136
node.tooltip = '[G03] CCW Interpolation';
132137
node.setIcon('ccwcutting');
133138
node.command = {
134139
command: 'gcode.gcodeTree.Selection',
135140
title: "",
136-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
141+
arguments: [new Range(lnum, 0, lnum, len)]
137142
};
138143

139144
blocks.push(node);
@@ -168,14 +173,14 @@ export class GCodeParser {
168173
case '129':
169174
node = new GCodeTreeNode(
170175
'Work Offset' + ' (G' + argument + ')',
171-
vscode.TreeItemCollapsibleState.None,
176+
TreeItemCollapsibleState.None,
172177
);
173178
node.tooltip = '[G' + argument + '] Work Offset';
174179
node.setIcon('workoffset');
175180
node.command = {
176181
command: 'gcode.gcodeTree.Selection',
177182
title: "",
178-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
183+
arguments: [new Range(lnum, 0, lnum, len)]
179184
};
180185

181186
blocks.push(node);
@@ -185,14 +190,14 @@ export class GCodeParser {
185190
case '154':
186191
node = new GCodeTreeNode(
187192
'Work Offset' + ' (G154 ' + words[i + 1] + ')',
188-
vscode.TreeItemCollapsibleState.None,
193+
TreeItemCollapsibleState.None,
189194
);
190195
node.tooltip = '[G154 ' + words[i + 1] + '] Work Offset';
191196
node.setIcon('workoffset');
192197
node.command = {
193198
command: 'gcode.gcodeTree.Selection',
194199
title: "",
195-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
200+
arguments: [new Range(lnum, 0, lnum, len)]
196201
};
197202

198203
blocks.push(node);
@@ -202,14 +207,14 @@ export class GCodeParser {
202207
case '54.1':
203208
node = new GCodeTreeNode(
204209
'Work Offset' + ' (G54.1 ' + words[i + 1] + ')',
205-
vscode.TreeItemCollapsibleState.None,
210+
TreeItemCollapsibleState.None,
206211
);
207212
node.tooltip = '[G54.1 ' + words[i + 1] + '] Work Offset';
208213
node.setIcon('workoffset');
209214
node.command = {
210215
command: 'gcode.gcodeTree.Selection',
211216
title: "",
212-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
217+
arguments: [new Range(lnum, 0, lnum, len)]
213218
};
214219

215220
blocks.push(node);
@@ -219,14 +224,14 @@ export class GCodeParser {
219224
case '15':
220225
node = new GCodeTreeNode(
221226
'Work Offset' + ' (G15 ' + words[i + 1] + ')',
222-
vscode.TreeItemCollapsibleState.None,
227+
TreeItemCollapsibleState.None,
223228
);
224229
node.tooltip = '[G15 ' + words[i + 1] + '] Work Offset';
225230
node.setIcon('workoffset');
226231
node.command = {
227232
command: 'gcode.gcodeTree.Selection',
228233
title: "",
229-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
234+
arguments: [new Range(lnum, 0, lnum, len)]
230235
};
231236

232237
blocks.push(node);
@@ -236,14 +241,14 @@ export class GCodeParser {
236241
case '65':
237242
node = new GCodeTreeNode(
238243
'Ext Subprogram',
239-
vscode.TreeItemCollapsibleState.None,
244+
TreeItemCollapsibleState.None,
240245
);
241246
node.tooltip = '[G65] Ext Subprogram Call';
242247
node.setIcon('extsubprog');
243248
node.command = {
244249
command: 'gcode.gcodeTree.Selection',
245250
title: "",
246-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
251+
arguments: [new Range(lnum, 0, lnum, len)]
247252
};
248253

249254
blocks.push(node);
@@ -264,14 +269,14 @@ export class GCodeParser {
264269
if (i == 0) { x = 1; } else { x = -1; }
265270
node = new GCodeTreeNode(
266271
'Spindle On ' + words[i + x].substr(1) + 'RPM' + ' CW',
267-
vscode.TreeItemCollapsibleState.None,
272+
TreeItemCollapsibleState.None,
268273
);
269274
node.tooltip = 'Spindle On Clockwise (' + words[i + x].substr(1) + 'RPM)';
270275
node.setIcon('spindlecw');
271276
node.command = {
272277
command: 'gcode.gcodeTree.Selection',
273278
title: "",
274-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
279+
arguments: [new Range(lnum, 0, lnum, len)]
275280
};
276281

277282
blocks.push(node);
@@ -283,14 +288,14 @@ export class GCodeParser {
283288
if (i == 0) { x = 1; } else { x = -1; }
284289
node = new GCodeTreeNode(
285290
'Spindle On ' + words[i + x].substr(1) + 'RPM' + ' CCW',
286-
vscode.TreeItemCollapsibleState.None,
291+
TreeItemCollapsibleState.None,
287292
);
288293
node.tooltip = 'Spindle On Counter Clockwise (' + words[i + x].substr(1) + 'RPM)';
289294
node.setIcon('spindleccw');
290295
node.command = {
291296
command: 'gcode.gcodeTree.Selection',
292297
title: "",
293-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
298+
arguments: [new Range(lnum, 0, lnum, len)]
294299
};
295300

296301
blocks.push(node);
@@ -301,14 +306,14 @@ export class GCodeParser {
301306
case '6' :
302307
node = new GCodeTreeNode(
303308
'Tool Change',
304-
vscode.TreeItemCollapsibleState.None,
309+
TreeItemCollapsibleState.None,
305310
);
306311
node.tooltip = 'Tool Change';
307312
node.setIcon('toolchange');
308313
node.command = {
309314
command: 'gcode.gcodeTree.Selection',
310315
title: "",
311-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
316+
arguments: [new Range(lnum, 0, lnum, len)]
312317
};
313318

314319
blocks.push(node);
@@ -320,14 +325,14 @@ export class GCodeParser {
320325
case '8' :
321326
node = new GCodeTreeNode(
322327
'Coolant On',
323-
vscode.TreeItemCollapsibleState.None,
328+
TreeItemCollapsibleState.None,
324329
);
325330
node.tooltip = 'Coolant Turned On';
326331
node.setIcon('coolanton');
327332
node.command = {
328333
command: 'gcode.gcodeTree.Selection',
329334
title: "",
330-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
335+
arguments: [new Range(lnum, 0, lnum, len)]
331336
};
332337

333338
blocks.push(node);
@@ -338,14 +343,14 @@ export class GCodeParser {
338343
case '9' :
339344
node = new GCodeTreeNode(
340345
'Coolant Off',
341-
vscode.TreeItemCollapsibleState.None,
346+
TreeItemCollapsibleState.None,
342347
);
343348
node.tooltip = 'Coolant Turned Off';
344349
node.setIcon('coolantoff');
345350
node.command = {
346351
command: 'gcode.gcodeTree.Selection',
347352
title: "",
348-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
353+
arguments: [new Range(lnum, 0, lnum, len)]
349354
};
350355

351356
blocks.push(node);
@@ -355,14 +360,14 @@ export class GCodeParser {
355360
case '97':
356361
node = new GCodeTreeNode(
357362
'Local Sub Call',
358-
vscode.TreeItemCollapsibleState.None,
363+
TreeItemCollapsibleState.None,
359364
);
360365
node.tooltip = 'Local Subprogram Call';
361366
node.setIcon('localsubprog');
362367
node.command = {
363368
command: 'gcode.gcodeTree.Selection',
364369
title: "",
365-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
370+
arguments: [new Range(lnum, 0, lnum, len)]
366371
};
367372

368373
blocks.push(node);
@@ -372,14 +377,14 @@ export class GCodeParser {
372377
case '99':
373378
node = new GCodeTreeNode(
374379
'Local Sub Return',
375-
vscode.TreeItemCollapsibleState.None,
380+
TreeItemCollapsibleState.None,
376381
);
377382
node.tooltip = 'Local Subprogram Return';
378383
node.setIcon('subprogreturn');
379384
node.command = {
380385
command: 'gcode.gcodeTree.Selection',
381386
title: "",
382-
arguments: [new vscode.Range(lnum, 0, lnum, len)]
387+
arguments: [new Range(lnum, 0, lnum, len)]
383388
};
384389

385390
blocks.push(node);

src/util/config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Licensed under the MIT License. See License.md in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55
'use strict';
6-
import { mainModule } from "process";
76
import { WorkspaceConfiguration, workspace, ExtensionContext, ConfigurationChangeEvent } from "vscode";
87
import { constants } from './constants';
98
import { Logger } from "./logger";

src/util/statusBar.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
*--------------------------------------------------------------------------------------------*/
55
'use strict';
66

7-
import { ExtensionContext, StatusBarAlignment, StatusBarItem, window } from "vscode";
7+
import {
8+
ExtensionContext,
9+
StatusBarAlignment,
10+
StatusBarItem,
11+
window
12+
} from "vscode";
813

914

1015
export class StatusBar {

0 commit comments

Comments
 (0)