ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / workbench / services / keybinding / test / browser / keybindingEditing.test.ts 281 строк · изменён 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
import assert from 'assert' ;
import * as json from '../../../../../base/common/json.js' ;
import { KeyCode } from '../../../../../base/common/keyCodes.js' ;
import { KeyCodeChord } from '../../../../../base/common/keybindings.js' ;
import { OS } from '../../../../../base/common/platform.js' ;
import { ContextKeyExpr } from '../../../../../platform/contextkey/common/contextkey.js' ;
import { IEnvironmentService } from '../../../../../platform/environment/common/environment.js' ;
import { IFileService } from
TestInstantiationService
IUserFriendlyKeybinding
ResolvedKeybindingItem
USLayoutResolvedKeybinding
NullLogService
KeybindingsEditingService
ITextFileService
TestEnvironmentService workbenchInstantiationService
FileService
Schemas
FileUserDataProvider
TestConfigurationService
joinPath
InMemoryFileSystemProvider
VSBuffer
UserDataProfilesService
UserDataProfileService
IUserDataProfileService
UriIdentityService
ensureNoDisposablesAreLeakedInTestSuite
metaKey
ctrlKey
altKey
shiftKey
scheme
disposables
instantiationService TestInstantiationService
fileService IFileService
environmentService IEnvironmentService
userDataProfileService IUserDataProfileService
testObject KeybindingsEditingService
environmentService TestEnvironmentService
logService
fileService disposables logService
fileSystemProvider disposables
disposables fileService scheme fileSystemProvider
userFolder
fileService userFolder
configService
configService
uriIdentityService disposables fileService
userDataProfilesService disposables environmentService fileService uriIdentityService logService
userDataProfileService disposables userDataProfilesService defaultProfile
disposables fileService Schemas vscodeUserData disposables scheme fileSystemProvider Schemas vscodeUserData userDataProfilesService uriIdentityService
instantiationService
fileService
configService
environmentService
disposables
testObject disposables instantiationService KeybindingsEditingService
fileService userDataProfileService currentProfile keybindingsResource VSBuffer
testObject firstChord keyCode KeyCode Escape
assert
error
assert error message
fileService userDataProfileService currentProfile keybindingsResource VSBuffer
testObject firstChord keyCode KeyCode Escape
assert
error
assert error message
instantiationService ITextFileService
testObject firstChord keyCode KeyCode Escape
assert
error assert error message
fileService userDataProfileService currentProfile keybindingsResource VSBuffer
testObject firstChord keyCode KeyCode Escape
assert
error
assert error message
fileService userDataProfileService currentProfile keybindingsResource VSBuffer
expected IUserFriendlyKeybinding key command key command
testObject firstChord keyCode KeyCode Escape command
assert expected
expected IUserFriendlyKeybinding key command key command
testObject firstChord keyCode KeyCode Escape command
assert expected
command key
expected IUserFriendlyKeybinding key command key command key command
testObject firstChord keyCode KeyCode Escape command
assert expected
expected IUserFriendlyKeybinding key command
testObject firstChord keyCode KeyCode Escape command
assert expected
expected IUserFriendlyKeybinding key command
testObject command
assert expected
expected IUserFriendlyKeybinding key command
testObject command
assert expected
key command
expected IUserFriendlyKeybinding key command
testObject firstChord keyCode KeyCode Escape command isDefault
assert expected
key command key command
expected IUserFriendlyKeybinding key command key command
testObject firstChord keyCode KeyCode Escape command isDefault
assert expected
key command key command systemWide
expected IUserFriendlyKeybinding key command key command systemWide
testObject firstChord keyCode KeyCode Escape command isDefault
assert expected
expected IUserFriendlyKeybinding key command
testObject command firstChord keyCode KeyCode KeyC modifiers altKey
assert expected
expected IUserFriendlyKeybinding key command
testObject command firstChord keyCode KeyCode KeyC modifiers altKey
testObject command firstChord keyCode KeyCode KeyC modifiers altKey
testObject command firstChord keyCode KeyCode KeyC modifiers altKey
testObject command firstChord keyCode KeyCode KeyC modifiers altKey
testObject command firstChord keyCode KeyCode KeyC modifiers altKey
assert expected
key command
testObject command firstChord keyCode KeyCode KeyC modifiers altKey isDefault
assert
key command
testObject command firstChord keyCode KeyCode KeyC modifiers altKey isDefault
assert
key command
testObject command isDefault
assert
key command
key command
key command
testObject command isDefault
assert
key command
expected IUserFriendlyKeybinding key command key command
testObject command isDefault
assert expected
key command
expected IUserFriendlyKeybinding key command key command when
testObject command isDefault
assert expected
key command when
expected IUserFriendlyKeybinding key command when key command when
testObject command isDefault
assert expected
key command when key command when
expected IUserFriendlyKeybinding key command when key command when
testObject command isDefault when
assert expected
key command when
expected IUserFriendlyKeybinding key command when key command
testObject command isDefault
assert expected
keybindings IUserFriendlyKeybinding
fileService userDataProfileService currentProfile keybindingsResource VSBuffer keybindings
IUserFriendlyKeybinding
json fileService userDataProfileService currentProfile keybindingsResource value
command when isDefault firstChord secondChord command when isDefault firstChord keyCode KeyCode modifiers Modifiers secondChord keyCode KeyCode modifiers Modifiers ResolvedKeybindingItem
chord keyCode KeyCode modifiers Modifiers KeyCodeChord
ctrlKey shiftKey altKey metaKey chord modifiers ctrlKey shiftKey altKey metaKey
ctrlKey shiftKey altKey metaKey chord keyCode
chords KeyCodeChord
firstChord
chords firstChord
secondChord
chords secondChord
keybinding chords length chords
keybinding command when ContextKeyExpr when isDefault isDefault
'../../../../../platform/files/common/files.js'
;
import
{
}
from
'../../../../../platform/instantiation/test/common/instantiationServiceMock.js'
;
import
{
}
from
'../../../../../platform/keybinding/common/keybinding.js'
;
import
{
}
from
'../../../../../platform/keybinding/common/resolvedKeybindingItem.js'
;
import
{
}
from
'../../../../../platform/keybinding/common/usLayoutResolvedKeybinding.js'
;
import
{
}
from
'../../../../../platform/log/common/log.js'
;
import
{
}
from
'../../common/keybindingEditing.js'
;
import
{
}
from
'../../../textfile/common/textfiles.js'
;
import
{
,
}
from
'../../../../test/browser/workbenchTestServices.js'
;
import
{
}
from
'../../../../../platform/files/common/fileService.js'
;
import
{
}
from
'../../../../../base/common/network.js'
;
import
{
URI
}
from
'../../../../../base/common/uri.js'
;
import
{
}
from
'../../../../../platform/userData/common/fileUserDataProvider.js'
;
import
{
}
from
'../../../../../platform/configuration/test/common/testConfigurationService.js'
;
import
{
}
from
'../../../../../base/common/resources.js'
;
import
{
}
from
'../../../../../platform/files/common/inMemoryFilesystemProvider.js'
;
import
{
}
from
'../../../../../base/common/buffer.js'
;
import
{
}
from
'../../../../../platform/userDataProfile/common/userDataProfile.js'
;
import
{
}
from
'../../../userDataProfile/common/userDataProfileService.js'
;
import
{
}
from
'../../../userDataProfile/common/userDataProfile.js'
;
import
{
}
from
'../../../../../platform/uriIdentity/common/uriIdentityService.js'
;
import
{
}
from
'../../../../../base/test/common/utils.js'
;
interface
Modifiers
{
?
:
boolean
;
?
:
boolean
;
?
:
boolean
;
?
:
boolean
;
}
const
ROOT
=
URI
.
file
(
'tests'
)
.
with
(
{
:
'vscode-tests'
}
)
;
suite
(
'KeybindingsEditing'
,
(
)
=>
{
const
=
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
let
:
;
let
:
;
let
:
;
let
:
;
let
:
;
setup
(
async
(
)
=>
{
=
;
const
=
new
NullLogService
(
)
;
=
.
add
(
new
FileService
(
)
)
;
const
=
.
add
(
new
InMemoryFileSystemProvider
(
)
)
;
.
add
(
.
registerProvider
(
ROOT
.
,
)
)
;
const
=
joinPath
(
ROOT
,
'User'
)
;
await
.
createFolder
(
)
;
const
=
new
TestConfigurationService
(
)
;
.
setUserConfiguration
(
'files'
,
{
'eol'
:
'\n'
}
)
;
const
=
.
add
(
new
UriIdentityService
(
)
)
;
const
=
.
add
(
new
UserDataProfilesService
(
,
,
,
)
)
;
=
.
add
(
new
UserDataProfileService
(
.
)
)
;
.
add
(
.
registerProvider
(
.
,
.
add
(
new
FileUserDataProvider
(
ROOT
.
,
,
.
,
,
,
new
NullLogService
(
)
)
)
)
)
;
=
workbenchInstantiationService
(
{
fileService
:
(
)
=>
,
configurationService
:
(
)
=>
,
environmentService
:
(
)
=>
}
,
)
;
=
.
add
(
.
createInstance
(
)
)
;
}
)
;
test
(
'errors cases - parse errors'
,
async
(
)
=>
{
await
.
writeFile
(
.
.
,
.
fromString
(
',,,,,,,,,,,,,,'
)
)
;
try
{
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
{
:
.
}
}
)
,
'alt+c'
,
undefined
)
;
.
fail
(
'Should fail with parse errors'
)
;
}
catch
(
)
{
.
strictEqual
(
.
,
'Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again.'
)
;
}
}
)
;
test
(
'errors cases - parse errors 2'
,
async
(
)
=>
{
await
.
writeFile
(
.
.
,
.
fromString
(
'[{"key": }]'
)
)
;
try
{
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
{
:
.
}
}
)
,
'alt+c'
,
undefined
)
;
.
fail
(
'Should fail with parse errors'
)
;
}
catch
(
)
{
.
strictEqual
(
.
,
'Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again.'
)
;
}
}
)
;
test
(
'errors cases - dirty'
,
(
)
=>
{
.
stub
(
,
'isDirty'
,
true
)
;
return
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
{
:
.
}
}
)
,
'alt+c'
,
undefined
)
.
then
(
(
)
=>
.
fail
(
'Should fail with dirty error'
)
,
=>
.
strictEqual
(
.
,
'Unable to write because the keybindings configuration file has unsaved changes. Please save it first and then try again.'
)
)
;
}
)
;
test
(
'errors cases - did not find an array'
,
async
(
)
=>
{
await
.
writeFile
(
.
.
,
.
fromString
(
'{"key": "alt+c", "command": "hello"}'
)
)
;
try
{
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
{
:
.
}
}
)
,
'alt+c'
,
undefined
)
;
.
fail
(
'Should fail'
)
;
}
catch
(
)
{
.
strictEqual
(
.
,
'Unable to write to the keybindings configuration file. It has an object which is not of type Array. Please open the file to clean up and try again.'
)
;
}
}
)
;
test
(
'edit a default keybinding to an empty file'
,
async
(
)
=>
{
await
.
writeFile
(
.
.
,
.
fromString
(
''
)
)
;
const
:
[
]
=
[
{
:
'alt+c'
,
:
'a'
}
,
{
:
'escape'
,
:
'-a'
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
{
:
.
}
,
:
'a'
}
)
,
'alt+c'
,
undefined
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'edit a default keybinding to an empty array'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
)
;
const
:
[
]
=
[
{
:
'alt+c'
,
:
'a'
}
,
{
:
'escape'
,
:
'-a'
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
{
:
.
}
,
:
'a'
}
)
,
'alt+c'
,
undefined
)
;
return
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'edit a default keybinding in an existing array'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'b'
,
:
'shift+c'
}
)
;
const
:
[
]
=
[
{
:
'shift+c'
,
:
'b'
}
,
{
:
'alt+c'
,
:
'a'
}
,
{
:
'escape'
,
:
'-a'
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
{
:
.
}
,
:
'a'
}
)
,
'alt+c'
,
undefined
)
;
return
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'add another keybinding'
,
async
(
)
=>
{
const
:
[
]
=
[
{
:
'alt+c'
,
:
'a'
}
]
;
await
.
addKeybinding
(
aResolvedKeybindingItem
(
{
:
{
:
.
}
,
:
'a'
}
)
,
'alt+c'
,
undefined
)
;
return
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'add a new default keybinding'
,
async
(
)
=>
{
const
:
[
]
=
[
{
:
'alt+c'
,
:
'a'
}
]
;
await
.
addKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
}
)
,
'alt+c'
,
undefined
)
;
return
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'add a new default keybinding using edit'
,
async
(
)
=>
{
const
:
[
]
=
[
{
:
'alt+c'
,
:
'a'
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
}
)
,
'alt+c'
,
undefined
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'edit an user keybinding'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'escape'
,
:
'b'
}
)
;
const
:
[
]
=
[
{
:
'alt+c'
,
:
'b'
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
{
:
.
}
,
:
'b'
,
:
false
}
)
,
'alt+c'
,
undefined
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'edit an user keybinding with more than one element'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'escape'
,
:
'b'
}
,
{
:
'alt+shift+g'
,
:
'c'
}
)
;
const
:
[
]
=
[
{
:
'alt+c'
,
:
'b'
}
,
{
:
'alt+shift+g'
,
:
'c'
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
{
:
.
}
,
:
'b'
,
:
false
}
)
,
'alt+c'
,
undefined
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'edit a user keybinding preserves systemWide on other entries'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'escape'
,
:
'b'
}
,
{
:
'alt+shift+g'
,
:
'c'
,
:
true
}
)
;
const
:
[
]
=
[
{
:
'alt+c'
,
:
'b'
}
,
{
:
'alt+shift+g'
,
:
'c'
,
:
true
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
{
:
.
}
,
:
'b'
,
:
false
}
)
,
'alt+c'
,
undefined
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'remove a default keybinding'
,
async
(
)
=>
{
const
:
[
]
=
[
{
:
'alt+c'
,
:
'-a'
}
]
;
await
.
removeKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
,
:
{
:
.
,
:
{
:
true
}
}
}
)
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'remove a default keybinding should not ad duplicate entries'
,
async
(
)
=>
{
const
:
[
]
=
[
{
:
'alt+c'
,
:
'-a'
}
]
;
await
.
removeKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
,
:
{
:
.
,
:
{
:
true
}
}
}
)
)
;
await
.
removeKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
,
:
{
:
.
,
:
{
:
true
}
}
}
)
)
;
await
.
removeKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
,
:
{
:
.
,
:
{
:
true
}
}
}
)
)
;
await
.
removeKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
,
:
{
:
.
,
:
{
:
true
}
}
}
)
)
;
await
.
removeKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
,
:
{
:
.
,
:
{
:
true
}
}
}
)
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'remove a user keybinding'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'alt+c'
,
:
'b'
}
)
;
await
.
removeKeybinding
(
aResolvedKeybindingItem
(
{
:
'b'
,
:
{
:
.
,
:
{
:
true
}
}
,
:
false
}
)
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
[
]
)
;
}
)
;
test
(
'reset an edited keybinding'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'alt+c'
,
:
'b'
}
)
;
await
.
resetKeybinding
(
aResolvedKeybindingItem
(
{
:
'b'
,
:
{
:
.
,
:
{
:
true
}
}
,
:
false
}
)
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
[
]
)
;
}
)
;
test
(
'reset a removed keybinding'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'alt+c'
,
:
'-b'
}
)
;
await
.
resetKeybinding
(
aResolvedKeybindingItem
(
{
:
'b'
,
:
false
}
)
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
[
]
)
;
}
)
;
test
(
'reset multiple removed keybindings'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'alt+c'
,
:
'-b'
}
)
;
await
writeToKeybindingsFile
(
{
:
'alt+shift+c'
,
:
'-b'
}
)
;
await
writeToKeybindingsFile
(
{
:
'escape'
,
:
'-b'
}
)
;
await
.
resetKeybinding
(
aResolvedKeybindingItem
(
{
:
'b'
,
:
false
}
)
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
[
]
)
;
}
)
;
test
(
'add a new keybinding to unassigned keybinding'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'alt+c'
,
:
'-a'
}
)
;
const
:
[
]
=
[
{
:
'alt+c'
,
:
'-a'
}
,
{
:
'shift+alt+c'
,
:
'a'
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
,
:
false
}
)
,
'shift+alt+c'
,
undefined
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'add when expression'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'alt+c'
,
:
'-a'
}
)
;
const
:
[
]
=
[
{
:
'alt+c'
,
:
'-a'
}
,
{
:
'shift+alt+c'
,
:
'a'
,
:
'editorTextFocus'
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
,
:
false
}
)
,
'shift+alt+c'
,
'editorTextFocus'
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'update command and when expression'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'alt+c'
,
:
'-a'
,
:
'editorTextFocus && !editorReadonly'
}
)
;
const
:
[
]
=
[
{
:
'alt+c'
,
:
'-a'
,
:
'editorTextFocus && !editorReadonly'
}
,
{
:
'shift+alt+c'
,
:
'a'
,
:
'editorTextFocus'
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
,
:
false
}
)
,
'shift+alt+c'
,
'editorTextFocus'
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'update when expression'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'alt+c'
,
:
'-a'
,
:
'editorTextFocus && !editorReadonly'
}
,
{
:
'shift+alt+c'
,
:
'a'
,
:
'editorTextFocus && !editorReadonly'
}
)
;
const
:
[
]
=
[
{
:
'alt+c'
,
:
'-a'
,
:
'editorTextFocus && !editorReadonly'
}
,
{
:
'shift+alt+c'
,
:
'a'
,
:
'editorTextFocus'
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
,
:
false
,
:
'editorTextFocus && !editorReadonly'
}
)
,
'shift+alt+c'
,
'editorTextFocus'
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
test
(
'remove when expression'
,
async
(
)
=>
{
await
writeToKeybindingsFile
(
{
:
'alt+c'
,
:
'-a'
,
:
'editorTextFocus && !editorReadonly'
}
)
;
const
:
[
]
=
[
{
:
'alt+c'
,
:
'-a'
,
:
'editorTextFocus && !editorReadonly'
}
,
{
:
'shift+alt+c'
,
:
'a'
}
]
;
await
.
editKeybinding
(
aResolvedKeybindingItem
(
{
:
'a'
,
:
false
}
)
,
'shift+alt+c'
,
undefined
)
;
.
deepStrictEqual
(
await
getUserKeybindings
(
)
,
)
;
}
)
;
async
function
writeToKeybindingsFile
(
...
:
[
]
)
:
Promise
<
void
>
{
await
.
writeFile
(
.
.
,
.
fromString
(
JSON
.
stringify
(
||
[
]
)
)
)
;
}
async
function
getUserKeybindings
(
)
:
Promise
<
[
]
>
{
return
.
parse
(
(
await
.
readFile
(
.
.
)
)
.
.
toString
(
)
)
;
}
function
aResolvedKeybindingItem
(
{
,
,
,
,
}
:
{
?
:
string
;
?
:
string
;
?
:
boolean
;
?
:
{
:
;
?
:
}
;
?
:
{
:
;
?
:
}
}
)
:
{
const
aSimpleKeybinding
=
function
(
:
{
:
;
?
:
}
)
:
{
const
{
,
,
,
}
=
.
||
{
:
false
,
:
false
,
:
false
,
:
false
}
;
return
new
KeyCodeChord
(
!
,
!
,
!
,
!
,
.
)
;
}
;
const
:
[
]
=
[
]
;
if
(
)
{
.
push
(
aSimpleKeybinding
(
)
)
;
if
(
)
{
.
push
(
aSimpleKeybinding
(
)
)
;
}
}
const
=
.
>
0
?
new
USLayoutResolvedKeybinding
(
,
OS
)
:
undefined
;
return
new
ResolvedKeybindingItem
(
,
||
'some command'
,
null
,
?
.
deserialize
(
)
:
undefined
,
===
undefined
?
true
:
,
null
,
false
)
;
}
}
)
;