Skip to content

Commit 3887c88

Browse files
author
Tom Saunders
committed
1.1.0
1 parent 21c516a commit 3887c88

File tree

8 files changed

+896
-2093
lines changed

8 files changed

+896
-2093
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { "extends": "airbnb-base" };

.eslintrc.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ All notable changes to the "vscode-workspace-explorer" extension will be documen
88
* Added additional details to docs
99

1010
## 1.0.3
11-
* Updated .vscodeignore to not include animations.
11+
* Updated .vscodeignore to not include animations.
12+
13+
## 1.1.0
14+
* Updated workspaceDataTreeProvider.js to support symlinks. Thanks to
15+
@Xaryphon for providing the initial version of the code for this feature.

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ None
117117

118118
# Release Notes
119119

120+
## 1.1.0
121+
* Added support for symlinked directories.
122+
123+
Workspace Explorer will now follow symlinked directories to find
124+
.code-workspace files and image files. Thanks to @Xaryphon for providing
125+
the initial version of the code for this feature.
126+
120127
## 1.0.3
121128
* Updated .vscodeignore to not include animations.
122129

@@ -170,11 +177,15 @@ in the **Workspace Storage Directory**.
170177
* Add collapse all button to collapse the sub-folders.
171178
* Add expand all button to expand all sub-folders.
172179

180+
# Contributors
181+
* Tom Saunders (original author, primary maintainer)
182+
* Xaryphon
183+
173184
# Testers
174185
Special thanks to the project testers.
175186
* Renaud Talon
176187
* Robert Tomcik
177188
* Ryan Gold
178189

179190
# Additional Attribution
180-
Some icons courtesy of [Material Design](http://material.io).
191+
Some icons courtesy of [Material Design](http://material.io).

extension.js

Lines changed: 93 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,109 @@
1-
///////////////////////////////////////////////////////////////////////////////
2-
/*
3-
Main Extension module. Contains activate function, command registrations,
4-
and registers the Workspace Explorer data tree provider.
5-
6-
@author tomsaunders
7-
8-
*/
9-
10-
///////////////////////////////////////////////////////////////////////////////
11-
// Imports
12-
///////////////////////////////////////////////////////////////////////////////
1+
// ------------------------------------------------------------------ //
2+
// Main Extension module. Contains activate function,
3+
// command registrations, and registers the Workspace Explorer
4+
// data tree provider.
5+
// ------------------------------------------------------------------ //
136

147
const vscode = require('vscode');
15-
const { WorkspaceTreeDataProvider } = require('./workspaceDataTreeProvider');
168
const { spawn } = require('child_process');
17-
const os = require("os");
18-
const fs = require("fs");
19-
const path = require("path");
20-
21-
///////////////////////////////////////////////////////////////////////////////
22-
// Main
23-
///////////////////////////////////////////////////////////////////////////////
9+
const os = require('os');
10+
const fs = require('fs');
11+
const path = require('path');
12+
const { WorkspaceTreeDataProvider } = require('./workspaceDataTreeProvider');
2413

25-
/*
26-
Activates the Extension when the Explorer view-container is open
27-
and the workspace explorer is expanded.
28-
*/
14+
// Activates the Extension when the Explorer view-container is open
15+
// and the workspace explorer is expanded.
2916
function activate() {
30-
/*
31-
Grab the extension version from the package.json file and publish
32-
it on key commands.
33-
*/
34-
let extensionVersion = JSON.parse(
35-
fs.readFileSync(
36-
path.join(
37-
path.dirname(__filename),
38-
'package.json'
39-
),
40-
"utf8"
41-
)).version;
17+
// Grab the extension version from the package.json file and publish
18+
// it on key commands.
19+
const extensionVersion = JSON.parse(
20+
fs.readFileSync(
21+
path.join(
22+
path.dirname(__filename),
23+
'package.json',
24+
),
25+
'utf8',
26+
),
27+
).version;
4228

43-
console.log(
44-
`[vscode-workspace-explorer] ${extensionVersion} ==> Activated`
45-
);
29+
console.log(
30+
`[vscode-workspace-explorer] ${extensionVersion} ==> Activated`,
31+
);
4632

4733

48-
// Identify which application to use.
49-
let applicationName;
50-
if (vscode.env.appName == "Visual Studio Code - Insiders"){
51-
applicationName = "code-insiders";
52-
} else {
53-
applicationName = "code";
54-
}
34+
// Identify which application to use.
35+
let applicationName;
36+
if (vscode.env.appName == 'Visual Studio Code - Insiders') {
37+
applicationName = 'code-insiders';
38+
} else {
39+
applicationName = 'code';
40+
}
5541

56-
// Register open in new window command.
57-
vscode.commands.registerCommand(
58-
"workspaceExplorer.openWorkspaceInNewWindow",
59-
(context) => {
60-
console.log(
61-
`[vscode-workspace-explorer] ${extensionVersion} ==> Opening ` +
62-
`${context.workspaceFileNameAndFilePath} in a new window.`);
63-
let results = spawn(
64-
applicationName,
65-
[`"${context.workspaceFileNameAndFilePath}"`],
66-
{cwd: os.homedir(), detached: true, shell: true}
67-
);
42+
// Register open in new window command.
43+
vscode.commands.registerCommand(
44+
'workspaceExplorer.openWorkspaceInNewWindow',
45+
(context) => {
46+
console.log(
47+
`[vscode-workspace-explorer] ${extensionVersion} ==> Opening `
48+
+ `${context.workspaceFileNameAndFilePath} in a new window.`,
49+
);
50+
const results = spawn(
51+
applicationName,
52+
[`"${context.workspaceFileNameAndFilePath}"`],
53+
{ cwd: os.homedir(), detached: true, shell: true },
54+
);
6855

69-
results.stdout.on('data', (data) => {
70-
console.log(`stdout ${data}`)
71-
})
56+
results.stdout.on('data', (data) => {
57+
console.log(`stdout ${data}`);
58+
});
59+
},
60+
);
7261

73-
});
62+
// Register open in same window command.
63+
vscode.commands.registerCommand(
64+
'workspaceExplorer.openWorkspaceInSameWindow',
65+
(workspaceFileNameAndFilePath) => {
66+
console.log(
67+
`[vscode-workspace-explorer] ${extensionVersion} `
68+
+ '==> Opening '
69+
+ `${workspaceFileNameAndFilePath} in this window.`,
70+
);
71+
spawn(
72+
applicationName,
73+
['-r', `"${workspaceFileNameAndFilePath}"`],
74+
{ cwd: os.homedir(), detached: true, shell: true },
75+
);
76+
},
77+
);
7478

75-
// Register open in same window command.
76-
vscode.commands.registerCommand(
77-
"workspaceExplorer.openWorkspaceInSameWindow",
78-
(workspaceFileNameAndFilePath) => {
79-
console.log(
80-
`[vscode-workspace-explorer] ${extensionVersion} ` +
81-
"==> Opening " +
82-
`${workspaceFileNameAndFilePath} in this window.`);
83-
spawn(
84-
applicationName,
85-
['-r', `"${workspaceFileNameAndFilePath}"`],
86-
{cwd: os.homedir(), detached: true, shell: true}
87-
);
88-
})
79+
// Register Refresh Command.
80+
vscode.commands.registerCommand(
81+
'workspaceExplorer.refreshWorkspaceExplorer',
82+
() => {
83+
console.log(
84+
`[vscode-workspace-explorer] ${extensionVersion} `
85+
+ '==> Refreshing Workspace Explorer',
86+
);
87+
dataTreeProvider.refresh();
88+
},
89+
);
8990

90-
// Register Refresh Command.
91-
vscode.commands.registerCommand(
92-
"workspaceExplorer.refreshWorkspaceExplorer",
93-
() => {
94-
console.log(
95-
`[vscode-workspace-explorer] ${extensionVersion} ` +
96-
"==> Refreshing Workspace Explorer");
97-
dataTreeProvider.refresh();
98-
});
91+
// Register Settings Command.
92+
vscode.commands.registerCommand(
93+
'workspaceExplorer.openWorkspaceExplorerSettings',
94+
() => {
95+
console.log(
96+
`[vscode-workspace-explorer] ${extensionVersion} `
97+
+ '==> Opening Settings for Workspace Explorer',
98+
);
99+
vscode.commands.executeCommand('workbench.action.openSettings2');
100+
},
101+
);
99102

100-
// Register Settings Command.
101-
vscode.commands.registerCommand(
102-
"workspaceExplorer.openWorkspaceExplorerSettings",
103-
() => {
104-
console.log(
105-
`[vscode-workspace-explorer] ${extensionVersion} ` +
106-
"==> Opening Settings for Workspace Explorer");
107-
vscode.commands.executeCommand('workbench.action.openSettings2')
108-
});
109-
110-
// Build tree structure.
111-
const dataTreeProvider = new WorkspaceTreeDataProvider();
112-
vscode.window.registerTreeDataProvider(
113-
"workspaceExplorer", dataTreeProvider
114-
);
115-
103+
// Build tree structure.
104+
const dataTreeProvider = new WorkspaceTreeDataProvider();
105+
vscode.window.registerTreeDataProvider(
106+
'workspaceExplorer', dataTreeProvider,
107+
);
116108
}
117109
exports.activate = activate;

0 commit comments

Comments
 (0)