mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-21 21:01:06 -05:00
Prettier backfill
This commit is contained in:
@@ -10,26 +10,26 @@ export interface GitCommit {
|
||||
|
||||
class GitService {
|
||||
private commits: GitCommit[] | null = null
|
||||
private lastQuery: string = ''
|
||||
private lastQuery: string = ""
|
||||
|
||||
async searchCommits(query: string = ''): Promise<GitCommit[]> {
|
||||
async searchCommits(query: string = ""): Promise<GitCommit[]> {
|
||||
if (query === this.lastQuery && this.commits) {
|
||||
return this.commits
|
||||
}
|
||||
|
||||
// Request search from extension
|
||||
vscode.postMessage({ type: 'searchCommits', query })
|
||||
|
||||
vscode.postMessage({ type: "searchCommits", query })
|
||||
|
||||
// Wait for response
|
||||
const response = await new Promise<GitCommit[]>((resolve) => {
|
||||
const handler = (event: MessageEvent) => {
|
||||
const message = event.data
|
||||
if (message.type === 'commitSearchResults') {
|
||||
window.removeEventListener('message', handler)
|
||||
if (message.type === "commitSearchResults") {
|
||||
window.removeEventListener("message", handler)
|
||||
resolve(message.commits)
|
||||
}
|
||||
}
|
||||
window.addEventListener('message', handler)
|
||||
window.addEventListener("message", handler)
|
||||
})
|
||||
|
||||
this.commits = response
|
||||
@@ -39,8 +39,8 @@ class GitService {
|
||||
|
||||
clearCache() {
|
||||
this.commits = null
|
||||
this.lastQuery = ''
|
||||
this.lastQuery = ""
|
||||
}
|
||||
}
|
||||
|
||||
export const gitService = new GitService()
|
||||
export const gitService = new GitService()
|
||||
|
||||
Reference in New Issue
Block a user