-
Notifications
You must be signed in to change notification settings - Fork 17
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
Initial version supporting multiple workspace roots #48
Conversation
package.json
Outdated
"command": "weAudit.setupRepositoriesCurrent", | ||
"when": "view == gitConfig", | ||
"group": "navigation@2" | ||
}, | ||
{ | ||
"command": "weAudit.setupRepositoriesAll", | ||
"when": "view == gitConfig", | ||
"group": "navigation@3" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might be able to only show the setupRepositoriesAll
button when there are multiple repos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved in 88aff0e
src/codeMarker.ts
Outdated
// if (!this.rootPath) { // TODO: Should not happen? | ||
// return; | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove or uncomment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved in 9ae4bf7
src/codeMarker.ts
Outdated
* Toggle a file as audited. | ||
* @param uri the `uri` of the target file. | ||
* @param relativePath the relative path of the target file to this workspace root. | ||
* @returns A list of `uri`s to decorate and the relevant username. TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved in 9ae4bf7
|
||
return [urisToDecorate, relevantUsername]; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the following functions are missing return types on their signatures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved in 9ae4bf7
src/codeMarker.ts
Outdated
* @returns `true` if the file is in the AuditedFiles, `false` if not. | ||
*/ | ||
isAudited(path: string) { | ||
return this.auditedFiles.find((entry) => entry.path === path); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function does not return true or false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved in 9ae4bf7
src/multiConfigs.ts
Outdated
const disposable = vscode.workspace.onDidChangeWorkspaceFolders(listener); | ||
context.subscriptions.push(disposable); | ||
|
||
this.activeConfigs = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.activeConfigs
is already set on line 31
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved in 9ae4bf7
src/multiConfigs.ts
Outdated
// if (parsedPath.name === this.username && this.activeConfigs.length === 0) { | ||
// this.activeConfigs.push(entry); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be uncommented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved in 9ae4bf7
<div class="detailsDiv"> | ||
<vscode-dropdown position="below" id="workspace-root-list-dropdown"> </vscode-dropdown> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could hide this if there is only one workspace. We can leave it as future enhancement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left it for now
src/panels/gitConfigPanel.ts
Outdated
// TODO error | ||
return; | ||
} | ||
vscode.commands.executeCommand("weAudit.updateGitConfig", rootPath, message.clientURL, message.auditURL, message.commitHash); | ||
return; | ||
case "choose-workspace-root": | ||
rootPath = this.dirToPathMap.get(message.rootDir); | ||
if (rootPath === undefined) { | ||
// TODO error | ||
return; | ||
} | ||
//this.currentRootPath = message.rootPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of todos and commented code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved in 9ae4bf7
src/webview/gitConfigMain.ts
Outdated
rootList.textContent = ""; | ||
for (let i = 0; i < message.rootDirs.length; i++) { | ||
const option = document.createElement("vscode-option"); | ||
//option.value = message.rootDirs[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove it if we don't need it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved in 9ae4bf7
There is a bug that causes issues to disappear from one workspace. To reproduce:
|
|
…workspace folders.
… containing each other
src/multiConfigs.ts
Outdated
@@ -11,7 +11,7 @@ let darkEyePath: vscode.Uri; | |||
export class MultipleSavedFindingsTree implements vscode.TreeDataProvider<ConfigTreeEntry> { | |||
private configurationEntries: ConfigurationEntry[]; | |||
private rootEntries: WorkspaceRootEntry[]; | |||
private rootPaths: string[]; | |||
private rootPathsAndLabels: [string, string][]; | |||
private activeConfigs: ConfigurationEntry[]; | |||
private username: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
username is not used here anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't find an eslint config that warns about this
src/panels/gitConfigPanel.ts
Outdated
@@ -14,57 +13,60 @@ export function activateGitConfigWebview(context: vscode.ExtensionContext) { | |||
class GitConfigProvider implements vscode.WebviewViewProvider { | |||
public static readonly viewType = "gitConfig"; | |||
private _disposables: vscode.Disposable[] = []; | |||
private currentRootPath: string; | |||
private currentRootPathAndLabel: [string, string]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rewrite this with an interface so that we don't have to do [0] and [1] through the code?
src/codeMarker.ts
Outdated
@@ -1217,8 +1523,7 @@ export class CodeMarker implements vscode.TreeDataProvider<TreeEntry> { | |||
|
|||
private workspaces: MultiRootManager; | |||
private username: string; | |||
//private currentlySelectedUsernames: string[]; | |||
private currentlySelectedConfigs: ConfigurationEntry[]; | |||
//private currentlySelectedConfigs: ConfigurationEntry[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
src/codeMarker.ts
Outdated
vscode.commands.registerCommand("weAudit.manageConfiguration", (config: ConfigurationEntry, select: boolean) => { | ||
return this.manageConfiguration(config, select); | ||
}); | ||
// // Returns whether a configuration is currently selected and optionally selects it if not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
src/codeMarker.ts
Outdated
} | ||
return true; | ||
} | ||
// /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
…with locations in multiple workspace roots
…cations in different workspace roots
This PR adds support for multiple workspace roots. It is currently in draft for testing purposes.