Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4e2caaa6
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4e2caaa6
编写于
10月 07, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use array.find in more places of re-implementing it with for loops
上级
d1b81e23
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
42 addition
and
123 deletion
+42
-123
src/vs/editor/contrib/gotoError/gotoError.ts
src/vs/editor/contrib/gotoError/gotoError.ts
+2
-7
src/vs/editor/test/common/modes/supports/characterPair.test.ts
...s/editor/test/common/modes/supports/characterPair.test.ts
+3
-7
src/vs/platform/files/test/node/diskFileService.test.ts
src/vs/platform/files/test/node/diskFileService.test.ts
+4
-10
src/vs/workbench/browser/editor.ts
src/vs/workbench/browser/editor.ts
+2
-7
src/vs/workbench/browser/parts/editor/editorDropTarget.ts
src/vs/workbench/browser/parts/editor/editorDropTarget.ts
+2
-7
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
+2
-8
src/vs/workbench/common/notifications.ts
src/vs/workbench/common/notifications.ts
+3
-18
src/vs/workbench/contrib/output/common/outputLinkComputer.ts
src/vs/workbench/contrib/output/common/outputLinkComputer.ts
+3
-8
src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts
...bench/contrib/preferences/browser/preferencesRenderers.ts
+2
-6
src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
...vs/workbench/contrib/tasks/browser/abstractTaskService.ts
+2
-6
src/vs/workbench/contrib/terminal/browser/terminalService.ts
src/vs/workbench/contrib/terminal/browser/terminalService.ts
+3
-7
src/vs/workbench/services/credentials/browser/credentialsService.ts
...kbench/services/credentials/browser/credentialsService.ts
+7
-11
src/vs/workbench/services/themes/browser/fileIconThemeStore.ts
...s/workbench/services/themes/browser/fileIconThemeStore.ts
+4
-13
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+3
-8
未找到文件。
src/vs/editor/contrib/gotoError/gotoError.ts
浏览文件 @
4e2caaa6
...
...
@@ -20,7 +20,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import
{
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
MarkerNavigationWidget
}
from
'
./gotoErrorWidget
'
;
import
{
compare
}
from
'
vs/base/common/strings
'
;
import
{
binarySearch
}
from
'
vs/base/common/arrays
'
;
import
{
binarySearch
,
find
}
from
'
vs/base/common/arrays
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
MenuRegistry
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
...
...
@@ -173,12 +173,7 @@ class MarkerModel {
}
public
findMarkerAtPosition
(
pos
:
Position
):
IMarker
|
undefined
{
for
(
const
marker
of
this
.
_markers
)
{
if
(
Range
.
containsPosition
(
marker
,
pos
))
{
return
marker
;
}
}
return
undefined
;
return
find
(
this
.
_markers
,
marker
=>
Range
.
containsPosition
(
marker
,
pos
));
}
public
get
total
()
{
...
...
src/vs/editor/test/common/modes/supports/characterPair.test.ts
浏览文件 @
4e2caaa6
...
...
@@ -8,6 +8,7 @@ import { StandardTokenType } from 'vs/editor/common/modes';
import
{
CharacterPairSupport
}
from
'
vs/editor/common/modes/supports/characterPair
'
;
import
{
TokenText
,
createFakeScopedLineTokens
}
from
'
vs/editor/test/common/modesTestUtils
'
;
import
{
StandardAutoClosingPairConditional
}
from
'
vs/editor/common/modes/languageConfiguration
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
suite
(
'
CharacterPairSupport
'
,
()
=>
{
...
...
@@ -53,13 +54,8 @@ suite('CharacterPairSupport', () => {
assert
.
deepEqual
(
characaterPairSupport
.
getSurroundingPairs
(),
[]);
});
function
findAutoClosingPair
(
characterPairSupport
:
CharacterPairSupport
,
character
:
string
):
StandardAutoClosingPairConditional
|
null
{
for
(
const
autoClosingPair
of
characterPairSupport
.
getAutoClosingPairs
())
{
if
(
autoClosingPair
.
open
===
character
)
{
return
autoClosingPair
;
}
}
return
null
;
function
findAutoClosingPair
(
characterPairSupport
:
CharacterPairSupport
,
character
:
string
):
StandardAutoClosingPairConditional
|
undefined
{
return
find
(
characterPairSupport
.
getAutoClosingPairs
(),
autoClosingPair
=>
autoClosingPair
.
open
===
character
);
}
function
testShouldAutoClose
(
characterPairSupport
:
CharacterPairSupport
,
line
:
TokenText
[],
character
:
string
,
column
:
number
):
boolean
{
...
...
src/vs/platform/files/test/node/diskFileService.test.ts
浏览文件 @
4e2caaa6
...
...
@@ -21,19 +21,13 @@ import { isLinux, isWindows } from 'vs/base/common/platform';
import
{
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
import
{
VSBuffer
,
VSBufferReadable
,
toVSBufferReadableStream
,
VSBufferReadableStream
,
bufferToReadable
,
bufferToStream
}
from
'
vs/base/common/buffer
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
function
getByName
(
root
:
IFileStat
,
name
:
string
):
IFileStat
|
null
{
function
getByName
(
root
:
IFileStat
,
name
:
string
):
IFileStat
|
undefined
{
if
(
root
.
children
===
undefined
)
{
return
null
;
return
undefined
;
}
for
(
const
child
of
root
.
children
)
{
if
(
child
.
name
===
name
)
{
return
child
;
}
}
return
null
;
return
find
(
root
.
children
,
child
=>
child
.
name
===
name
);
}
function
toLineByLineReadable
(
content
:
string
):
VSBufferReadable
{
...
...
src/vs/workbench/browser/editor.ts
浏览文件 @
4e2caaa6
...
...
@@ -8,6 +8,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
BaseEditor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
IConstructorSignature0
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
export
interface
IEditorDescriptor
{
instantiate
(
instantiationService
:
IInstantiationService
):
BaseEditor
;
...
...
@@ -140,13 +141,7 @@ class EditorRegistry implements IEditorRegistry {
}
getEditorById
(
editorId
:
string
):
EditorDescriptor
|
undefined
{
for
(
const
editor
of
this
.
editors
)
{
if
(
editor
.
getId
()
===
editorId
)
{
return
editor
;
}
}
return
undefined
;
return
find
(
this
.
editors
,
editor
=>
editor
.
getId
()
===
editorId
);
}
getEditors
():
readonly
EditorDescriptor
[]
{
...
...
src/vs/workbench/browser/parts/editor/editorDropTarget.ts
浏览文件 @
4e2caaa6
...
...
@@ -16,6 +16,7 @@ import { GroupDirection, MergeGroupMode } from 'vs/workbench/services/editor/com
import
{
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
interface
IDropOperation
{
splitDirection
?:
GroupDirection
;
...
...
@@ -544,13 +545,7 @@ export class EditorDropTarget extends Themable {
private
findTargetGroupView
(
child
:
HTMLElement
):
IEditorGroupView
|
undefined
{
const
groups
=
this
.
accessor
.
groups
;
for
(
const
groupView
of
groups
)
{
if
(
isAncestor
(
child
,
groupView
.
element
))
{
return
groupView
;
}
}
return
undefined
;
return
find
(
groups
,
groupView
=>
isAncestor
(
child
,
groupView
.
element
));
}
private
updateContainer
(
isDraggedOver
:
boolean
):
void
{
...
...
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
浏览文件 @
4e2caaa6
...
...
@@ -27,7 +27,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
import
{
IStorageService
,
StorageScope
,
IWorkspaceStorageChangeEvent
}
from
'
vs/platform/storage/common/storage
'
;
import
{
Parts
,
IWorkbenchLayoutService
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
coalesce
}
from
'
vs/base/common/arrays
'
;
import
{
coalesce
,
find
}
from
'
vs/base/common/arrays
'
;
import
{
StandardMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
ToggleStatusbarVisibilityAction
}
from
'
vs/workbench/browser/actions/layoutActions
'
;
import
{
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
...
...
@@ -176,13 +176,7 @@ class StatusbarViewModel extends Disposable {
}
findEntry
(
container
:
HTMLElement
):
IStatusbarViewModelEntry
|
undefined
{
for
(
const
entry
of
this
.
_entries
)
{
if
(
entry
.
container
===
container
)
{
return
entry
;
}
}
return
undefined
;
return
find
(
this
.
_entries
,
entry
=>
entry
.
container
===
container
);
}
getEntries
(
alignment
:
StatusbarAlignment
):
IStatusbarViewModelEntry
[]
{
...
...
src/vs/workbench/common/notifications.ts
浏览文件 @
4e2caaa6
...
...
@@ -12,6 +12,7 @@ import { Action } from 'vs/base/common/actions';
import
{
isErrorWithActions
}
from
'
vs/base/common/errorsWithActions
'
;
import
{
startsWith
}
from
'
vs/base/common/strings
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
find
,
equals
}
from
'
vs/base/common/arrays
'
;
export
interface
INotificationsModel
{
...
...
@@ -169,13 +170,7 @@ export class NotificationsModel extends Disposable implements INotificationsMode
}
private
findNotification
(
item
:
INotificationViewItem
):
INotificationViewItem
|
undefined
{
for
(
const
notification
of
this
.
_notifications
)
{
if
(
notification
.
equals
(
item
))
{
return
notification
;
}
}
return
undefined
;
return
find
(
this
.
_notifications
,
notification
=>
notification
.
equals
(
item
));
}
private
createViewItem
(
notification
:
INotification
):
INotificationViewItem
|
null
{
...
...
@@ -641,17 +636,7 @@ export class NotificationViewItem extends Disposable implements INotificationVie
const
primaryActions
=
(
this
.
_actions
&&
this
.
_actions
.
primary
)
||
[];
const
otherPrimaryActions
=
(
other
.
actions
&&
other
.
actions
.
primary
)
||
[];
if
(
primaryActions
.
length
!==
otherPrimaryActions
.
length
)
{
return
false
;
}
for
(
let
i
=
0
;
i
<
primaryActions
.
length
;
i
++
)
{
if
((
primaryActions
[
i
].
id
+
primaryActions
[
i
].
label
)
!==
(
otherPrimaryActions
[
i
].
id
+
otherPrimaryActions
[
i
].
label
))
{
return
false
;
}
}
return
true
;
return
equals
(
primaryActions
,
otherPrimaryActions
,
(
a
,
b
)
=>
(
a
.
id
+
a
.
label
)
===
(
b
.
id
+
b
.
label
));
}
}
...
...
src/vs/workbench/contrib/output/common/outputLinkComputer.ts
浏览文件 @
4e2caaa6
...
...
@@ -12,6 +12,7 @@ import * as strings from 'vs/base/common/strings';
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
isWindows
}
from
'
vs/base/common/platform
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
export
interface
ICreateData
{
workspaceFolders
:
string
[];
...
...
@@ -44,15 +45,9 @@ export class OutputLinkComputer {
});
}
private
getModel
(
uri
:
string
):
IMirrorModel
|
null
{
private
getModel
(
uri
:
string
):
IMirrorModel
|
undefined
{
const
models
=
this
.
ctx
.
getMirrorModels
();
for
(
const
model
of
models
)
{
if
(
model
.
uri
.
toString
()
===
uri
)
{
return
model
;
}
}
return
null
;
return
find
(
models
,
model
=>
model
.
uri
.
toString
()
===
uri
);
}
public
computeLinks
(
uri
:
string
):
Promise
<
ILink
[]
>
{
...
...
src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts
浏览文件 @
4e2caaa6
...
...
@@ -32,6 +32,7 @@ import { DefaultSettingsEditorModel, SettingsEditorModel, WorkspaceConfiguration
import
{
IMarkerService
,
IMarkerData
,
MarkerSeverity
,
MarkerTag
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
EditorOption
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
export
interface
IPreferencesRenderer
<
T
>
extends
IDisposable
{
readonly
preferencesModel
:
IPreferencesEditorModel
<
T
>
;
...
...
@@ -321,12 +322,7 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR
const
{
key
,
overrideOf
}
=
setting
;
if
(
overrideOf
)
{
const
setting
=
this
.
getSetting
(
overrideOf
);
for
(
const
override
of
setting
!
.
overrides
!
)
{
if
(
override
.
key
===
key
)
{
return
override
;
}
}
return
undefined
;
return
find
(
setting
!
.
overrides
!
,
override
=>
override
.
key
===
key
);
}
const
settingsGroups
=
this
.
filterResult
?
this
.
filterResult
.
filteredGroups
:
this
.
preferencesModel
.
settingsGroups
;
return
this
.
getPreference
(
key
,
settingsGroups
);
...
...
src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
浏览文件 @
4e2caaa6
...
...
@@ -77,6 +77,7 @@ import { applyEdits } from 'vs/base/common/jsonEdit';
import
{
ITextEditor
}
from
'
vs/workbench/common/editor
'
;
import
{
ITextEditorSelection
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IPreferencesService
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
export
namespace
ConfigureTaskAction
{
export
const
ID
=
'
workbench.action.tasks.configureTaskRunner
'
;
...
...
@@ -515,12 +516,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
if
(
!
values
)
{
return
undefined
;
}
for
(
const
task
of
values
)
{
if
(
task
.
matches
(
key
,
compareId
))
{
return
task
;
}
}
return
undefined
;
return
find
(
values
,
task
=>
task
.
matches
(
key
,
compareId
));
});
}
...
...
src/vs/workbench/contrib/terminal/browser/terminalService.ts
浏览文件 @
4e2caaa6
...
...
@@ -29,6 +29,7 @@ import { escapeNonWindowsPath } from 'vs/workbench/contrib/terminal/common/termi
import
{
isWindows
,
isMacintosh
,
OperatingSystem
}
from
'
vs/base/common/platform
'
;
import
{
basename
}
from
'
vs/base/common/path
'
;
import
{
IOpenFileRequest
}
from
'
vs/platform/windows/common/windows
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
interface
IExtHostReadyEntry
{
promise
:
Promise
<
void
>
;
...
...
@@ -414,13 +415,8 @@ export class TerminalService implements ITerminalService {
instance
.
addDisposable
(
instance
.
onFocus
(
this
.
_onActiveInstanceChanged
.
fire
,
this
.
_onActiveInstanceChanged
));
}
private
_getTabForInstance
(
instance
:
ITerminalInstance
):
ITerminalTab
|
null
{
for
(
const
tab
of
this
.
_terminalTabs
)
{
if
(
tab
.
terminalInstances
.
indexOf
(
instance
)
!==
-
1
)
{
return
tab
;
}
}
return
null
;
private
_getTabForInstance
(
instance
:
ITerminalInstance
):
ITerminalTab
|
undefined
{
return
find
(
this
.
_terminalTabs
,
tab
=>
tab
.
terminalInstances
.
indexOf
(
instance
)
!==
-
1
);
}
public
showPanel
(
focus
?:
boolean
):
Promise
<
void
>
{
...
...
src/vs/workbench/services/credentials/browser/credentialsService.ts
浏览文件 @
4e2caaa6
...
...
@@ -6,6 +6,7 @@
import
{
ICredentialsService
}
from
'
vs/platform/credentials/common/credentials
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
export
interface
ICredentialsProvider
{
getPassword
(
service
:
string
,
account
:
string
):
Promise
<
string
|
null
>
;
...
...
@@ -14,7 +15,7 @@ export interface ICredentialsProvider {
deletePassword
(
service
:
string
,
account
:
string
):
Promise
<
boolean
>
;
findPassword
(
service
:
string
):
Promise
<
string
|
null
>
;
findCredentials
(
service
:
string
):
Promise
<
Array
<
{
account
:
string
,
password
:
string
}
>>
;
findCredentials
(
service
:
string
):
Promise
<
Array
<
{
account
:
string
,
password
:
string
;
}
>>
;
}
export
class
BrowserCredentialsService
implements
ICredentialsService
{
...
...
@@ -47,7 +48,7 @@ export class BrowserCredentialsService implements ICredentialsService {
return
this
.
credentialsProvider
.
findPassword
(
service
);
}
findCredentials
(
service
:
string
):
Promise
<
Array
<
{
account
:
string
,
password
:
string
}
>>
{
findCredentials
(
service
:
string
):
Promise
<
Array
<
{
account
:
string
,
password
:
string
;
}
>>
{
return
this
.
credentialsProvider
.
findCredentials
(
service
);
}
}
...
...
@@ -88,17 +89,12 @@ class InMemoryCredentialsProvider implements ICredentialsProvider {
return
credential
?
credential
.
password
:
null
;
}
private
doFindPassword
(
service
:
string
,
account
?:
string
):
ICredential
|
null
{
for
(
const
credential
of
this
.
credentials
)
{
if
(
credential
.
service
===
service
&&
(
typeof
account
!==
'
string
'
||
credential
.
account
===
account
))
{
return
credential
;
}
}
return
null
;
private
doFindPassword
(
service
:
string
,
account
?:
string
):
ICredential
|
undefined
{
return
find
(
this
.
credentials
,
credential
=>
credential
.
service
===
service
&&
(
typeof
account
!==
'
string
'
||
credential
.
account
===
account
));
}
async
findCredentials
(
service
:
string
):
Promise
<
Array
<
{
account
:
string
,
password
:
string
}
>>
{
async
findCredentials
(
service
:
string
):
Promise
<
Array
<
{
account
:
string
,
password
:
string
;
}
>>
{
return
this
.
credentials
.
filter
(
credential
=>
credential
.
service
===
service
)
.
map
(({
account
,
password
})
=>
({
account
,
password
}));
...
...
src/vs/workbench/services/themes/browser/fileIconThemeStore.ts
浏览文件 @
4e2caaa6
...
...
@@ -14,6 +14,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import
{
FileIconThemeData
}
from
'
vs/workbench/services/themes/browser/fileIconThemeData
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
const
iconThemeExtPoint
=
ExtensionsRegistry
.
registerExtensionPoint
<
IThemeExtensionPoint
[]
>
({
extensionPoint
:
'
iconThemes
'
,
...
...
@@ -62,7 +63,7 @@ export class FileIconThemeStore extends Disposable {
private
initialize
()
{
iconThemeExtPoint
.
setHandler
((
extensions
)
=>
{
const
previousIds
:
{
[
key
:
string
]:
boolean
}
=
{};
const
previousIds
:
{
[
key
:
string
]:
boolean
;
}
=
{};
const
added
:
FileIconThemeData
[]
=
[];
for
(
const
theme
of
this
.
knownIconThemes
)
{
previousIds
[
theme
.
id
]
=
true
;
...
...
@@ -131,12 +132,7 @@ export class FileIconThemeStore extends Disposable {
return
Promise
.
resolve
(
FileIconThemeData
.
noIconTheme
());
}
return
this
.
getFileIconThemes
().
then
(
allIconSets
=>
{
for
(
let
iconSet
of
allIconSets
)
{
if
(
iconSet
.
id
===
iconTheme
)
{
return
iconSet
;
}
}
return
undefined
;
return
find
(
allIconSets
,
iconSet
=>
iconSet
.
id
===
iconTheme
);
});
}
...
...
@@ -145,12 +141,7 @@ export class FileIconThemeStore extends Disposable {
return
Promise
.
resolve
(
FileIconThemeData
.
noIconTheme
());
}
return
this
.
getFileIconThemes
().
then
(
allIconSets
=>
{
for
(
let
iconSet
of
allIconSets
)
{
if
(
iconSet
.
settingsId
===
settingsId
)
{
return
iconSet
;
}
}
return
undefined
;
return
find
(
allIconSets
,
iconSet
=>
iconSet
.
settingsId
===
settingsId
);
});
}
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
4e2caaa6
...
...
@@ -91,6 +91,7 @@ import { INativeOpenDialogOptions, MessageBoxReturnValue, SaveDialogReturnValue,
import
{
IBackupMainService
,
IWorkspaceBackupInfo
}
from
'
vs/platform/backup/electron-main/backup
'
;
import
{
IEmptyWindowBackupInfo
}
from
'
vs/platform/backup/node/backup
'
;
import
{
IDialogMainService
}
from
'
vs/platform/dialogs/electron-main/dialogs
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
export
function
createFileInput
(
instantiationService
:
IInstantiationService
,
resource
:
URI
):
FileEditorInput
{
return
instantiationService
.
createInstance
(
FileEditorInput
,
resource
,
undefined
,
undefined
);
...
...
@@ -700,14 +701,8 @@ export class TestEditorGroupsService implements IEditorGroupsService {
return
this
.
groups
;
}
getGroup
(
identifier
:
number
):
IEditorGroup
{
for
(
const
group
of
this
.
groups
)
{
if
(
group
.
id
===
identifier
)
{
return
group
;
}
}
return
undefined
!
;
getGroup
(
identifier
:
number
):
IEditorGroup
|
undefined
{
return
find
(
this
.
groups
,
group
=>
group
.
id
===
identifier
);
}
getLabel
(
_identifier
:
number
):
string
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录