ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / workbench / contrib / files / common / files.ts 278 строк · изменён 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
import { URI } from '../../../../base/common/uri.js' ;
import { IEditorOptions } from '../../../../editor/common/config/editorOptions.js' ;
import { IWorkbenchEditorConfiguration, IEditorIdentifier, EditorResourceAccessor, SideBySideEditor } from '../../../common/editor.js' ;
import { EditorInput } from '../../../common/editor/editorInput.js' ;
import { IFilesConfiguration as PlatformIFilesConfiguration, FileChangeType, IFileService } from '../../../../platform/files/common/files.js' ;
import { ContextKeyExpr, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'
ITextModelContentProvider
Disposable DisposableStore MutableDisposable
ITextModel
IModelService
ILanguageService ILanguageSelection
ITextFileService
InputFocusedContextKey
IEditorGroup
Event
ITextEditorOptions
IEditorService
localize
IExpression
ExplorerViewletVisibleContext type description
FoldersViewVisibleContext type description
ExplorerFolderContext type description
ExplorerResourceReadonlyContext type description
ExplorerResourceWritableContext ExplorerResourceReadonlyContext
ExplorerResourceParentReadOnlyContext type description
ExplorerResourceAvailableEditorIdsContext
ExplorerRootContext type description
ExplorerResourceCut type description
ExplorerResourceMoveableToTrash type description
FilesExplorerFocusedContext type description
OpenEditorsFocusedContext type description
ExplorerFocusedContext type description
ExplorerFindProviderActive type description
ExplorerCompressedFocusContext type description
ExplorerCompressedFirstFocusContext type description
ExplorerCompressedLastFocusContext type description
ViewHasSomeCollapsibleRootItemContext type description
FilesExplorerFocusCondition ContextKeyExpr FoldersViewVisibleContext FilesExplorerFocusedContext ContextKeyExpr InputFocusedContextKey
ExplorerFocusCondition ContextKeyExpr FoldersViewVisibleContext ExplorerFocusedContext ContextKeyExpr InputFocusedContextKey
IWorkbenchEditorConfiguration
explorer
openEditors
visible
sortOrder
autoReveal
autoRevealExclude IExpression
enableDragAndDrop
confirmDelete
enableUndo
confirmUndo UndoConfirmLevel
expandSingleFolderWorkspaces
sortOrder SortOrder
sortOrderLexicographicOptions LexicographicOptions
sortOrderReverse
decorations
colors
badges
incrementalNaming
excludeGitIgnore
fileNesting
enabled
expand
patterns parent
autoOpenDroppedFile
editor IEditorOptions
resource
isDirectory
SortOrder
Default
Mixed
FilesFirst
Type
Modified
FoldersNestsFiles
UndoConfirmLevel
Verbose
Default
Light
LexicographicOptions
Default
Upper
Lower
Unicode
sortOrder SortOrder
lexicographicOptions LexicographicOptions
reverse
fileWatcherDisposable
textFileService ITextFileService
fileService IFileService
languageService ILanguageService
modelService IModelService
resource scheme label editorService IEditorService options ITextEditorOptions
editorService
original resource TextFileContentProvider scheme resource
modified resource
label
options
scheme resource
resource scheme query scheme resource scheme query resource query
resource
scheme query resource query
resource scheme query
resource ITextModel
resource query
savedFileResource TextFileContentProvider resource
codeEditorModel resource
fileWatcherDisposable value
disposables
fileWatcherDisposable value disposables
disposables fileService changes
changes savedFileResource FileChangeType
resource
codeEditorModel
disposables Event codeEditorModel onWillDispose fileWatcherDisposable
codeEditorModel
resource createAsNeeded ITextModel
resource createAsNeeded ITextModel
resource createAsNeeded ITextModel
savedFileResource TextFileContentProvider resource
content textFileService savedFileResource
codeEditorModel modelService resource
codeEditorModel
modelService codeEditorModel content value
createAsNeeded
textFileModel modelService savedFileResource
languageSelector ILanguageSelection
textFileModel
languageSelector languageService textFileModel
languageSelector languageService savedFileResource
codeEditorModel modelService content value languageSelector resource
codeEditorModel
id
_editor EditorInput _group IEditorGroup
id OpenEditor
_editor
_group
_group id
_group editor
_group editor
EditorResourceAccessor editor supportSideBySide SideBySideEditor
;
import
{
}
from
'../../../../editor/common/services/resolverService.js'
;
import
{
,
,
}
from
'../../../../base/common/lifecycle.js'
;
import
{
}
from
'../../../../editor/common/model.js'
;
import
{
}
from
'../../../../editor/common/services/model.js'
;
import
{
,
}
from
'../../../../editor/common/languages/language.js'
;
import
{
}
from
'../../../services/textfile/common/textfiles.js'
;
import
{
}
from
'../../../../platform/contextkey/common/contextkeys.js'
;
import
{
}
from
'../../../services/editor/common/editorGroupsService.js'
;
import
{
}
from
'../../../../base/common/event.js'
;
import
{
}
from
'../../../../platform/editor/common/editor.js'
;
import
{
}
from
'../../../services/editor/common/editorService.js'
;
import
{
}
from
'../../../../nls.js'
;
import
{
}
from
'../../../../base/common/glob.js'
;
export
const
VIEWLET_ID
=
'workbench.view.explorer'
;
export
const
VIEW_ID
=
'workbench.explorer.fileView'
;
export
const
=
new
RawContextKey< boolean >
(
'explorerViewletVisible'
,
true
,
{
:
'boolean'
,
:
localize
(
'explorerViewletVisible'
,
"True when the EXPLORER viewlet is visible."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'foldersViewVisible'
,
true
,
{
:
'boolean'
,
:
localize
(
'foldersViewVisible'
,
"True when the FOLDERS view (the file tree within the explorer view container) is visible."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'explorerResourceIsFolder'
,
false
,
{
:
'boolean'
,
:
localize
(
'explorerResourceIsFolder'
,
"True when the focused item in the EXPLORER is a folder."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'explorerResourceReadonly'
,
false
,
{
:
'boolean'
,
:
localize
(
'explorerResourceReadonly'
,
"True when the focused item in the EXPLORER is read-only."
)
}
)
;
export
const
=
.
toNegated
(
)
;
export
const
=
new
RawContextKey< boolean >
(
'explorerResourceParentReadonly'
,
false
,
{
:
'boolean'
,
:
localize
(
'explorerResourceParentReadonly'
,
"True when the focused item in the EXPLORER's parent is read-only."
)
}
)
;
export
const
=
new
RawContextKey< string >
(
'explorerResourceAvailableEditorIds'
,
''
)
;
export
const
=
new
RawContextKey< boolean >
(
'explorerResourceIsRoot'
,
false
,
{
:
'boolean'
,
:
localize
(
'explorerResourceIsRoot'
,
"True when the focused item in the EXPLORER is a root folder."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'explorerResourceCut'
,
false
,
{
:
'boolean'
,
:
localize
(
'explorerResourceCut'
,
"True when an item in the EXPLORER has been cut for cut and paste."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'explorerResourceMoveableToTrash'
,
false
,
{
:
'boolean'
,
:
localize
(
'explorerResourceMoveableToTrash'
,
"True when the focused item in the EXPLORER can be moved to trash."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'filesExplorerFocus'
,
true
,
{
:
'boolean'
,
:
localize
(
'filesExplorerFocus'
,
"True when the focus is inside the EXPLORER view."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'openEditorsFocus'
,
true
,
{
:
'boolean'
,
:
localize
(
'openEditorsFocus'
,
"True when the focus is inside the OPEN EDITORS view."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'explorerViewletFocus'
,
true
,
{
:
'boolean'
,
:
localize
(
'explorerViewletFocus'
,
"True when the focus is inside the EXPLORER viewlet."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'explorerFindProviderActive'
,
false
,
{
:
'boolean'
,
:
localize
(
'explorerFindProviderActive'
,
"True when the explorer tree is using the explorer find provider."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'explorerViewletCompressedFocus'
,
true
,
{
:
'boolean'
,
:
localize
(
'explorerViewletCompressedFocus'
,
"True when the focused item in the EXPLORER view is a compact item."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'explorerViewletCompressedFirstFocus'
,
true
,
{
:
'boolean'
,
:
localize
(
'explorerViewletCompressedFirstFocus'
,
"True when the focus is inside a compact item's first part in the EXPLORER view."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'explorerViewletCompressedLastFocus'
,
true
,
{
:
'boolean'
,
:
localize
(
'explorerViewletCompressedLastFocus'
,
"True when the focus is inside a compact item's last part in the EXPLORER view."
)
}
)
;
export
const
=
new
RawContextKey< boolean >
(
'viewHasSomeCollapsibleItem'
,
false
,
{
:
'boolean'
,
:
localize
(
'viewHasSomeCollapsibleItem'
,
"True when a workspace in the EXPLORER view has some collapsible root child."
)
}
)
;
export
const
=
.
and
(
,
,
.
not
(
)
)
;
export
const
=
.
and
(
,
,
.
not
(
)
)
;
export
const
TEXT_FILE_EDITOR_ID
=
'workbench.editors.files.textFileEditor'
;
export
const
FILE_EDITOR_INPUT_ID
=
'workbench.editors.files.fileEditorInput'
;
export
const
BINARY_FILE_EDITOR_ID
=
'workbench.editors.files.binaryFileEditor'
;
export
const
BINARY_TEXT_FILE_MODE
=
'code-text-binary'
;
export
interface
IFilesConfiguration
extends
PlatformIFilesConfiguration
,
{
:
{
:
{
:
number
;
:
'editorOrder'
|
'alphabetical'
|
'fullPath'
;
}
;
:
boolean
|
'focusNoScroll'
;
:
;
:
boolean
;
:
boolean
;
:
boolean
;
:
;
:
boolean
;
:
;
:
;
:
boolean
;
:
{
:
boolean
;
:
boolean
;
}
;
:
'simple'
|
'smart'
|
'disabled'
;
:
boolean
;
:
{
:
boolean
;
:
boolean
;
:
{
[
:
string
]
:
string
}
;
}
;
:
boolean
;
}
;
:
;
}
export
interface
IFileResource
{
:
URI
;
?
:
boolean
;
}
export
const
enum
{
=
'default'
,
=
'mixed'
,
=
'filesFirst'
,
=
'type'
,
=
'modified'
,
=
'foldersNestsFiles'
,
}
export
const
enum
{
=
'verbose'
,
=
'default'
,
=
'light'
,
}
export
const
enum
{
=
'default'
,
=
'upper'
,
=
'lower'
,
=
'unicode'
,
}
export
interface
ISortOrderConfiguration
{
:
;
:
;
:
boolean
;
}
export
class
TextFileContentProvider
extends
Disposable
implements
ITextModelContentProvider
{
private
readonly
=
this
.
_register
(
new
MutableDisposable
(
)
)
;
constructor
(
@ ITextFileService
private
readonly
:
,
@ IFileService
private
readonly
:
,
@ ILanguageService
private
readonly
:
,
@ IModelService
private
readonly
:
)
{
super
(
)
;
}
static
async
open
(
:
URI
,
:
string
,
:
string
,
:
,
?
:
)
:
Promise
<
void
>
{
await
.
openEditor
(
{
:
{
:
.
resourceToTextFile
(
,
)
}
,
:
{
}
,
,
}
)
;
}
private
static
resourceToTextFile
(
:
string
,
:
URI
)
:
URI
{
return
.
with
(
{
,
:
JSON
.
stringify
(
{
:
.
,
:
.
}
)
}
)
;
}
private
static
textFileToResource
(
:
URI
)
:
URI
{
const
{
,
}
=
JSON
.
parse
(
.
)
;
return
.
with
(
{
,
}
)
;
}
async
provideTextContent
(
:
URI
)
:
Promise
<
|
null
>
{
if
(
!
.
)
{
return
null
;
}
const
=
.
textFileToResource
(
)
;
const
=
await
this
.
resolveEditorModel
(
)
;
if
(
!
this
.
.
)
{
const
=
new
DisposableStore
(
)
;
this
.
.
=
;
.
add
(
this
.
.
onDidFilesChange
(
=>
{
if
(
.
contains
(
,
.
UPDATED
)
)
{
this
.
resolveEditorModel
(
,
false
)
;
}
}
)
)
;
if
(
)
{
.
add
(
.
once
(
.
)
(
(
)
=>
this
.
.
clear
(
)
)
)
;
}
}
return
;
}
private
resolveEditorModel
(
:
URI
,
?
:
true
)
:
Promise
<
>
;
private
resolveEditorModel
(
:
URI
,
?
:
boolean
)
:
Promise
<
|
null
>
;
private
async
resolveEditorModel
(
:
URI
,
:
boolean
=
true
)
:
Promise
<
|
null
>
{
const
=
.
textFileToResource
(
)
;
const
=
await
this
.
.
readStream
(
)
;
let
=
this
.
.
getModel
(
)
;
if
(
)
{
this
.
.
updateModel
(
,
.
)
;
}
else
if
(
)
{
const
=
this
.
.
getModel
(
)
;
let
:
;
if
(
)
{
=
this
.
.
createById
(
.
getLanguageId
(
)
)
;
}
else
{
=
this
.
.
createByFilepathOrFirstLine
(
)
;
}
=
this
.
.
createModel
(
.
,
,
)
;
}
return
;
}
}
export
class
OpenEditor
implements
IEditorIdentifier
{
private
:
number
;
private
static
COUNTER
=
0
;
constructor
(
private
:
,
private
:
)
{
this
.
=
.
COUNTER
++
;
}
get
editor
(
)
{
return
this
.
;
}
get
group
(
)
{
return
this
.
;
}
get
groupId
(
)
{
return
this
.
.
;
}
getId
(
)
:
string
{
return
` openeditor: ${ this . groupId} : ${ this . id} `
;
}
isPreview
(
)
:
boolean
{
return
!
this
.
.
isPinned
(
this
.
)
;
}
isSticky
(
)
:
boolean
{
return
this
.
.
isSticky
(
this
.
)
;
}
getResource
(
)
:
URI
|
undefined
{
return
.
getOriginalUri
(
this
.
,
{
:
.
PRIMARY
}
)
;
}
}