ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / platform / agentHost / test / node / copilotGitProject.test.ts 146 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import assert from 'assert' ;
import { URI } from '../../../../base/common/uri.js' ;
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js' ;
import { tryResolvePrimaryWorktreeRoot, type IAgentHostGitService , type IBranch , type IDefaultBranch } from '../../common/agentHostGitService.js' ;
import { projectFromCopilotContext, projectFromRepository, resolveGitProject } from '../../node/copilot/copilotGitProject.js' ;
class TestAgentHostGitService implements IAgentHostGitService {
_serviceBrand
repositoryRoot
worktreeRoots
worktreeRootCalls
IDefaultBranch
IBranch
IBranch
IBranch
repositoryRoot
worktreeRootCalls
worktreeRoots
gitService TestAgentHostGitService
gitService
gitService repositoryRoot
gitService worktreeRoots
project gitService
assert
uri project uri
displayName project displayName
uri
displayName
gitService repositoryRoot
project gitService
assert
uri project uri
displayName project displayName
uri
displayName
primaryRoot
checkoutA
checkoutB
gitService worktreeRoots primaryRoot checkoutA checkoutB
roots
gitService checkoutA
gitService checkoutB
assert
worktreeRootCalls gitService worktreeRootCalls
roots roots root root
worktreeRootCalls
roots primaryRoot primaryRoot
assert gitService
project repository gitService
assert
uri project uri
displayName project displayName
uri
displayName
project
assert
uri project uri
displayName project displayName
uri
displayName
declare
readonly
:
undefined
;
:
URI
|
undefined
;
:
URI
[
]
=
[
]
;
=
0
;
async
getCurrentBranch
(
)
:
Promise
<
string
|
undefined
>
{
return
undefined
;
}
async
getDefaultBranch
(
)
:
Promise
<
|
undefined
>
{
return
undefined
;
}
async
getBranch
(
)
:
Promise
<
|
undefined
>
{
return
undefined
;
}
async
getRefs
(
)
:
Promise
<
[
]
>
{
return
[
]
;
}
async
getBranches
(
)
:
Promise
<
[
]
>
{
return
[
]
;
}
async
getRepositoryRoot
(
)
:
Promise
<
URI
|
undefined
>
{
return
this
.
;
}
async
getWorktreeRoots
(
)
:
Promise
<
URI
[
]
>
{
this
.
++
;
return
this
.
;
}
async
addWorktree
(
)
:
Promise
<
void
>
{
}
async
copyWorktreeIncludeFiles
(
)
:
Promise
<
void
>
{
}
async
addExistingWorktree
(
)
:
Promise
<
void
>
{
}
async
removeWorktree
(
)
:
Promise
<
void
>
{
}
async
branchExists
(
)
:
Promise
<
boolean
>
{
return
false
;
}
async
createBranch
(
)
:
Promise
<
void
>
{
}
async
hasUncommittedChanges
(
)
:
Promise
<
boolean
>
{
return
false
;
}
async
commitAll
(
)
:
Promise
<
void
>
{
}
async
mergeBranch
(
)
:
Promise
<
string
>
{
return
''
;
}
async
restore
(
)
:
Promise
<
void
>
{
}
async
hasUpstream
(
)
:
Promise
<
boolean
>
{
return
false
;
}
async
pull
(
)
:
Promise
<
void
>
{
}
async
push
(
)
:
Promise
<
void
>
{
}
async
getSessionGitState
(
)
:
Promise
<
undefined
>
{
return
undefined
;
}
async
computeSessionFileDiffs
(
)
:
Promise
<
undefined
>
{
return
undefined
;
}
async
showBlob
(
)
:
Promise
<
undefined
>
{
return
undefined
;
}
async
captureWorkingTreeAsTree
(
)
:
Promise
<
undefined
>
{
return
undefined
;
}
async
commitTree
(
)
:
Promise
<
undefined
>
{
return
undefined
;
}
async
updateRef
(
)
:
Promise
<
void
>
{
}
async
deleteRefs
(
)
:
Promise
<
void
>
{
}
async
revParse
(
)
:
Promise
<
undefined
>
{
return
undefined
;
}
async
resolveBranchBaselineCommit
(
)
:
Promise
<
string
|
undefined
>
{
return
undefined
;
}
async
overlayPathIntoTree
(
)
:
Promise
<
string
|
undefined
>
{
return
undefined
;
}
async
diffTreePaths
(
)
:
Promise
<
string
[
]
|
undefined
>
{
return
undefined
;
}
async
computeFileDiffsBetweenRefs
(
)
:
Promise
<
undefined
>
{
return
undefined
;
}
async
getFetchRemoteUrls
(
)
:
Promise
<
undefined
>
{
return
undefined
;
}
async
getUntrackedPaths
(
)
:
Promise
<
[
]
>
{
return
[
]
;
}
async
getBranchDiffSafetyInfo
(
)
:
Promise
<
undefined
>
{
return
undefined
;
}
async
getDiffPatchBetweenRefs
(
)
:
Promise
<
undefined
>
{
return
undefined
;
}
}
suite
(
'Copilot Git Project'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
let
:
;
setup
(
(
)
=>
{
=
new
TestAgentHostGitService
(
)
;
}
)
;
test
(
'resolves a repository project from a worktree working directory'
,
async
(
)
=>
{
.
=
URI
.
file
(
'/workspace/worktree-checkout'
)
;
.
=
[
URI
.
file
(
'/workspace/source-repo'
)
]
;
const
=
await
resolveGitProject
(
URI
.
file
(
'/workspace/worktree-checkout'
)
,
)
;
.
deepStrictEqual
(
{
:
?.
.
toString
(
)
,
:
?.
,
}
,
{
:
URI
.
file
(
'/workspace/source-repo'
)
.
toString
(
)
,
:
'source-repo'
,
}
)
;
}
)
;
test
(
'resolves the repository itself for a normal git working directory'
,
async
(
)
=>
{
.
=
URI
.
file
(
'/workspace/normal-repo'
)
;
const
=
await
resolveGitProject
(
URI
.
file
(
'/workspace/normal-repo'
)
,
)
;
.
deepStrictEqual
(
{
:
?.
.
toString
(
)
,
:
?.
,
}
,
{
:
URI
.
file
(
'/workspace/normal-repo'
)
.
toString
(
)
,
:
'normal-repo'
,
}
)
;
}
)
;
test
(
'deduplicates concurrent resolution across linked worktrees'
,
async
(
)
=>
{
const
=
URI
.
file
(
'/workspace/source-repo'
)
;
const
=
URI
.
file
(
'/workspace/source-repo.worktrees/a'
)
;
const
=
URI
.
file
(
'/workspace/source-repo.worktrees/b'
)
;
.
=
[
,
,
]
;
const
=
await
Promise
.
all
(
[
tryResolvePrimaryWorktreeRoot
(
,
)
,
tryResolvePrimaryWorktreeRoot
(
,
)
,
]
)
;
.
deepStrictEqual
(
{
:
.
,
:
.
map
(
=>
?.
toString
(
)
)
,
}
,
{
:
1
,
:
[
.
toString
(
)
,
.
toString
(
)
]
,
}
)
;
}
)
;
test
(
'returns undefined outside a git working tree'
,
async
(
)
=>
{
.
strictEqual
(
await
resolveGitProject
(
URI
.
file
(
'/workspace/plain-folder'
)
,
)
,
undefined
)
;
}
)
;
test
(
'falls back to repository context when no git project is available'
,
async
(
)
=>
{
const
=
await
projectFromCopilotContext
(
{
:
'microsoft/vscode'
}
,
)
;
.
deepStrictEqual
(
{
:
?.
.
toString
(
)
,
:
?.
,
}
,
{
:
'https://github.com/microsoft/vscode'
,
:
'vscode'
,
}
)
;
}
)
;
test
(
'parses repository URLs'
,
(
)
=>
{
const
=
projectFromRepository
(
'https://github.com/microsoft/vscode.git'
)
;
.
deepStrictEqual
(
{
:
?.
.
toString
(
)
,
:
?.
,
}
,
{
:
'https://github.com/microsoft/vscode.git'
,
:
'vscode'
,
}
)
;
}
)
;
}
)
;