Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to show/hide the current project in the project list #146

Merged
merged 1 commit into from
Oct 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@
"default": false,
"description": "Should the project be opened using a New Window when you click the Status Bar?"
},
"projectManager.removeCurrentProjectFromList": {
"type": "boolean",
"default": true,
"description": "Should the current project be hidden in the list of available projects?"
},
"projectManager.sortList": {
"type": "string",
"default": "Name",
Expand Down
16 changes: 8 additions & 8 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function activate(context: vscode.ExtensionContext) {
value => ({}), // done
value => vscode.window.showInformationMessage("Could not open the project!"));
});

// register commands (here, because it needs to be used right below if an invalid JSON is present)
vscode.commands.registerCommand("projectManager.saveProject", () => saveProject());
vscode.commands.registerCommand("projectManager.refreshProjects", () => refreshProjects());
Expand All @@ -80,7 +80,7 @@ export function activate(context: vscode.ExtensionContext) {

let statusItem: vscode.StatusBarItem;
showStatusBar();

// function commands
function showStatusBar(projectName?: string) {
let showStatusConfig = vscode.workspace.getConfiguration("projectManager").get("showProjectNameInStatusBar");
Expand Down Expand Up @@ -141,14 +141,14 @@ export function activate(context: vscode.ExtensionContext) {
for (let i = 0, l = array1.length; i < l; i++) {
if (array1[i] instanceof Array && array2[i] instanceof Array) {
if (!array1[i].equals(array2[i])) {
return false;
return false;
}
} else {
if (array1[i] !== array2[i]) {
return false;
if (array1[i] !== array2[i]) {
return false;
}
}
}
}
}
return true;
}

Expand Down Expand Up @@ -490,7 +490,7 @@ export function activate(context: vscode.ExtensionContext) {
}

function removeRootPath(items: any[]): any[] {
if (!vscode.workspace.rootPath) {
if (!vscode.workspace.rootPath || !vscode.workspace.getConfiguration("projectManager").get("removeCurrentProjectFromList")) {
return items;
} else {
return items.filter(value => value.description.toString().toLowerCase() !== vscode.workspace.rootPath.toLowerCase());
Expand Down