Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
15b1f599
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 搜索 >>
提交
15b1f599
编写于
9月 25, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
less use of toResource with filter: file
上级
d99c7d8e
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
75 addition
and
51 deletion
+75
-51
src/vs/base/common/resources.ts
src/vs/base/common/resources.ts
+18
-0
src/vs/platform/files/common/files.ts
src/vs/platform/files/common/files.ts
+3
-2
src/vs/workbench/browser/parts/editor/editorStatus.ts
src/vs/workbench/browser/parts/editor/editorStatus.ts
+16
-12
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+8
-5
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
+1
-1
src/vs/workbench/common/editor/rangeDecorations.ts
src/vs/workbench/common/editor/rangeDecorations.ts
+3
-4
src/vs/workbench/parts/files/browser/fileCommands.ts
src/vs/workbench/parts/files/browser/fileCommands.ts
+1
-1
src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts
...workbench/parts/files/common/editors/fileEditorTracker.ts
+5
-5
src/vs/workbench/parts/markers/browser/markersPanel.ts
src/vs/workbench/parts/markers/browser/markersPanel.ts
+15
-15
src/vs/workbench/parts/search/browser/searchActions.ts
src/vs/workbench/parts/search/browser/searchActions.ts
+2
-3
src/vs/workbench/parts/search/common/search.ts
src/vs/workbench/parts/search/common/search.ts
+3
-3
未找到文件。
src/vs/base/common/resources.ts
浏览文件 @
15b1f599
...
...
@@ -6,6 +6,7 @@
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
uri
from
'
vs/base/common/uri
'
;
import
{
equalsIgnoreCase
}
from
'
vs/base/common/strings
'
;
export
function
basenameOrAuthority
(
resource
:
uri
):
string
{
return
paths
.
basename
(
resource
.
fsPath
)
||
resource
.
authority
;
...
...
@@ -19,6 +20,23 @@ export function isEqualOrParent(first: uri, second: uri, ignoreCase?: boolean):
return
false
;
}
export
function
isEqual
(
first
:
uri
,
second
:
uri
,
ignoreCase
?:
boolean
):
boolean
{
const
identityEquals
=
(
first
===
second
);
if
(
identityEquals
)
{
return
true
;
}
if
(
!
first
||
!
second
)
{
return
false
;
}
if
(
ignoreCase
)
{
return
equalsIgnoreCase
(
first
.
toString
(),
second
.
toString
());
}
return
first
.
toString
()
===
second
.
toString
();
}
export
function
dirname
(
resource
:
uri
):
uri
{
return
resource
.
with
({
path
:
paths
.
dirname
(
resource
.
path
)
...
...
src/vs/platform/files/common/files.ts
浏览文件 @
15b1f599
...
...
@@ -15,6 +15,7 @@ import Event from 'vs/base/common/event';
import
{
beginsWithIgnoreCase
}
from
'
vs/base/common/strings
'
;
import
{
IProgress
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
isEqualOrParent
,
isEqual
}
from
'
vs/base/common/resources
'
;
export
const
IFileService
=
createDecorator
<
IFileService
>
(
'
fileService
'
);
...
...
@@ -274,10 +275,10 @@ export class FileChangesEvent extends events.Event {
// For deleted also return true when deleted folder is parent of target path
if
(
type
===
FileChangeType
.
DELETED
)
{
return
paths
.
isEqualOrParent
(
resource
.
fsPath
,
change
.
resource
.
fsPath
,
!
isLinux
/* ignorecase */
);
return
isEqualOrParent
(
resource
,
change
.
resource
,
!
isLinux
/* ignorecase */
);
}
return
paths
.
isEqual
(
resource
.
fsPath
,
change
.
resource
.
fsPath
,
!
isLinux
/* ignorecase */
);
return
isEqual
(
resource
,
change
.
resource
,
!
isLinux
/* ignorecase */
);
});
}
...
...
src/vs/workbench/browser/parts/editor/editorStatus.ts
浏览文件 @
15b1f599
...
...
@@ -696,7 +696,7 @@ export class EditorStatus implements IStatusbarItem {
private
onResourceEncodingChange
(
resource
:
uri
):
void
{
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
if
(
activeEditor
)
{
const
activeResource
=
toResource
(
activeEditor
.
input
,
{
supportSideBySide
:
true
,
filter
:
[
'
file
'
,
'
untitled
'
]
});
const
activeResource
=
toResource
(
activeEditor
.
input
,
{
supportSideBySide
:
true
});
if
(
activeResource
&&
activeResource
.
toString
()
===
resource
.
toString
())
{
return
this
.
onEncodingChange
(
<
IBaseEditor
>
activeEditor
);
// only update if the encoding changed for the active resource
}
...
...
@@ -766,6 +766,7 @@ export class ChangeModeAction extends Action {
@
IPreferencesService
private
preferencesService
:
IPreferencesService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
ICommandService
private
commandService
:
ICommandService
,
@
IUntitledEditorService
private
untitledEditorService
:
IUntitledEditorService
,
@
IConfigurationEditingService
private
configurationEditService
:
IConfigurationEditingService
)
{
super
(
actionId
,
actionLabel
);
...
...
@@ -779,7 +780,10 @@ export class ChangeModeAction extends Action {
}
const
textModel
=
editorWidget
.
getModel
();
const
fileResource
=
toResource
(
activeEditor
.
input
,
{
supportSideBySide
:
true
,
filter
:
'
file
'
});
let
resource
=
toResource
(
activeEditor
.
input
,
{
supportSideBySide
:
true
});
if
(
resource
.
scheme
===
'
untitled
'
&&
!
this
.
untitledEditorService
.
hasAssociatedFilePath
(
resource
))
{
resource
=
void
0
;
// no configuration for untitled resources (e.g. "Untitled-1")
}
// Compute mode
let
currentModeId
:
string
;
...
...
@@ -818,7 +822,7 @@ export class ChangeModeAction extends Action {
};
});
if
(
fileR
esource
)
{
if
(
r
esource
)
{
picks
[
0
].
separator
=
{
border
:
true
,
label
:
nls
.
localize
(
'
languagesPicks
'
,
"
languages (identifier)
"
)
};
}
...
...
@@ -826,15 +830,14 @@ export class ChangeModeAction extends Action {
let
configureModeAssociations
:
IPickOpenEntry
;
let
configureModeSettings
:
IPickOpenEntry
;
let
galleryAction
:
Action
;
if
(
fileR
esource
)
{
const
ext
=
paths
.
extname
(
fileResource
.
fsPath
)
||
paths
.
basename
(
fileR
esource
.
fsPath
);
if
(
r
esource
)
{
const
ext
=
paths
.
extname
(
resource
.
fsPath
)
||
paths
.
basename
(
r
esource
.
fsPath
);
galleryAction
=
this
.
instantiationService
.
createInstance
(
ShowLanguageExtensionsAction
,
ext
);
if
(
galleryAction
.
enabled
)
{
picks
.
unshift
(
galleryAction
);
}
configureModeSettings
=
{
label
:
nls
.
localize
(
'
configureModeSettings
'
,
"
Configure '{0}' language based settings...
"
,
currentModeId
)
};
picks
.
unshift
(
configureModeSettings
);
configureModeAssociations
=
{
label
:
nls
.
localize
(
'
configureAssociationsExt
'
,
"
Configure File Association for '{0}'...
"
,
ext
)
};
...
...
@@ -845,7 +848,8 @@ export class ChangeModeAction extends Action {
const
autoDetectMode
:
IPickOpenEntry
=
{
label
:
nls
.
localize
(
'
autoDetect
'
,
"
Auto Detect
"
)
};
if
(
fileResource
)
{
if
(
resource
)
{
picks
.
unshift
(
autoDetectMode
);
}
...
...
@@ -861,7 +865,7 @@ export class ChangeModeAction extends Action {
// User decided to permanently configure associations, return right after
if
(
pick
===
configureModeAssociations
)
{
this
.
configureFileAssociation
(
fileR
esource
);
this
.
configureFileAssociation
(
r
esource
);
return
;
}
...
...
@@ -896,7 +900,7 @@ export class ChangeModeAction extends Action {
// Find mode
let
mode
:
TPromise
<
IMode
>
;
if
(
pick
===
autoDetectMode
)
{
mode
=
this
.
modeService
.
getOrCreateModeByFilenameOrFirstLine
(
toResource
(
activeEditor
.
input
,
{
supportSideBySide
:
true
,
filter
:
[
'
file
'
,
'
untitled
'
]
}).
fsPath
,
textModel
.
getLineContent
(
1
));
mode
=
this
.
modeService
.
getOrCreateModeByFilenameOrFirstLine
(
toResource
(
activeEditor
.
input
,
{
supportSideBySide
:
true
}).
fsPath
,
textModel
.
getLineContent
(
1
));
}
else
{
mode
=
this
.
modeService
.
getOrCreateModeByLanguageName
(
pick
.
label
);
}
...
...
@@ -1111,12 +1115,12 @@ export class ChangeEncodingAction extends Action {
return
void
0
;
}
const
resource
=
toResource
(
activeEditor
.
input
,
{
filter
:
[
'
file
'
,
'
untitled
'
],
supportSideBySide
:
true
});
const
resource
=
toResource
(
activeEditor
.
input
,
{
supportSideBySide
:
true
});
return
TPromise
.
timeout
(
50
/* quick open is sensitive to being opened so soon after another */
)
.
then
(()
=>
{
if
(
!
resource
||
resource
.
scheme
!==
'
file
'
)
{
return
TPromise
.
as
(
null
);
// encoding detection only possible for
file resources
if
(
!
resource
||
!
this
.
fileService
.
canHandleResource
(
resource
)
)
{
return
TPromise
.
as
(
null
);
// encoding detection only possible for
resources the file service can handle
}
return
this
.
fileService
.
resolveContent
(
resource
,
{
autoGuessEncoding
:
true
,
acceptTextOnly
:
true
}).
then
(
content
=>
content
.
encoding
,
err
=>
null
);
...
...
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
15b1f599
...
...
@@ -670,12 +670,15 @@ export class TabsTitleControl extends TitleControl {
e
.
dataTransfer
.
effectAllowed
=
'
copyMove
'
;
// Insert transfer accordingly
const
fileResource
=
toResource
(
editor
,
{
supportSideBySide
:
true
,
filter
:
'
file
'
});
if
(
fileResource
)
{
const
resource
=
fileResource
.
toString
();
e
.
dataTransfer
.
setData
(
'
URL
'
,
resource
);
// enables cross window DND of tabs
e
.
dataTransfer
.
setData
(
'
DownloadURL
'
,
[
MIME_BINARY
,
editor
.
getName
(),
resource
].
join
(
'
:
'
));
// enables support to drag a tab as file to desktop
const
resource
=
toResource
(
editor
,
{
supportSideBySide
:
true
});
if
(
resource
)
{
const
resourceStr
=
resource
.
toString
();
e
.
dataTransfer
.
setData
(
'
URL
'
,
resourceStr
);
// enables cross window DND of tabs
e
.
dataTransfer
.
setData
(
'
text/plain
'
,
getPathLabel
(
resource
));
// enables dropping tab resource path into text controls
if
(
resource
.
scheme
===
'
file
'
)
{
e
.
dataTransfer
.
setData
(
'
DownloadURL
'
,
[
MIME_BINARY
,
editor
.
getName
(),
resourceStr
].
join
(
'
:
'
));
// enables support to drag a tab as file to desktop
}
}
}));
...
...
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
浏览文件 @
15b1f599
...
...
@@ -195,7 +195,7 @@ export class TitlebarPart extends Part implements ITitleService {
// Compute folder resource
// Single Root Workspace: always the root single workspace in this case
// Otherwise: root folder of the currently active file if any
let
folder
=
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
FOLDER
?
workspace
.
folders
[
0
]
:
this
.
contextService
.
getWorkspaceFolder
(
toResource
(
input
,
{
supportSideBySide
:
true
,
filter
:
'
file
'
}));
let
folder
=
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
FOLDER
?
workspace
.
folders
[
0
]
:
this
.
contextService
.
getWorkspaceFolder
(
toResource
(
input
,
{
supportSideBySide
:
true
}));
// Variables
const
activeEditorShort
=
input
?
input
.
getTitle
(
Verbosity
.
SHORT
)
:
''
;
...
...
src/vs/workbench/common/editor/rangeDecorations.ts
浏览文件 @
15b1f599
...
...
@@ -9,7 +9,6 @@ import Event, { Emitter } from 'vs/base/common/event';
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
toResource
}
from
'
vs/workbench/common/editor
'
;
import
{
isEqual
}
from
'
vs/base/common/paths
'
;
import
{
IRange
}
from
'
vs/editor/common/core/range
'
;
import
{
CursorChangeReason
,
ICursorPositionChangedEvent
}
from
'
vs/editor/common/controller/cursorEvents
'
;
import
{
ModelDecorationOptions
}
from
'
vs/editor/common/model/textModelWithDecorations
'
;
...
...
@@ -56,9 +55,9 @@ export class RangeHighlightDecorations implements IDisposable {
}
private
getEditor
(
resourceRange
:
IRangeHighlightDecoration
):
editorCommon
.
ICommonCodeEditor
{
const
fileResource
=
toResource
(
this
.
editorService
.
getActiveEditorInput
(),
{
filter
:
'
file
'
}
);
if
(
fileR
esource
)
{
if
(
isEqual
(
fileResource
.
fsPath
,
resourceRange
.
resource
.
fsPath
))
{
const
resource
=
toResource
(
this
.
editorService
.
getActiveEditorInput
()
);
if
(
r
esource
)
{
if
(
resource
.
toString
()
===
resourceRange
.
resource
.
toString
(
))
{
return
<
editorCommon
.
ICommonCodeEditor
>
this
.
editorService
.
getActiveEditor
().
getControl
();
}
}
...
...
src/vs/workbench/parts/files/browser/fileCommands.ts
浏览文件 @
15b1f599
...
...
@@ -35,7 +35,7 @@ export const copyPathCommand = (accessor: ServicesAccessor, resource?: URI) => {
const
editorService
=
accessor
.
get
(
IWorkbenchEditorService
);
const
activeEditor
=
editorService
.
getActiveEditor
();
resource
=
activeEditor
?
toResource
(
activeEditor
.
input
,
{
supportSideBySide
:
true
,
filter
:
'
file
'
})
:
void
0
;
resource
=
activeEditor
?
toResource
(
activeEditor
.
input
,
{
supportSideBySide
:
true
})
:
void
0
;
if
(
activeEditor
)
{
editorGroupService
.
focusGroup
(
activeEditor
.
position
);
// focus back to active editor group
}
...
...
src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts
浏览文件 @
15b1f599
...
...
@@ -266,10 +266,10 @@ export class FileEditorTracker implements IWorkbenchContribution {
private
handleUpdatesToVisibleBinaryEditors
(
e
:
FileChangesEvent
):
void
{
const
editors
=
this
.
editorService
.
getVisibleEditors
();
editors
.
forEach
(
editor
=>
{
const
fileResource
=
toResource
(
editor
.
input
,
{
filter
:
'
file
'
,
supportSideBySide
:
true
});
const
resource
=
toResource
(
editor
.
input
,
{
supportSideBySide
:
true
});
// Binary editor that should reload from event
if
(
fileResource
&&
editor
.
getId
()
===
BINARY_FILE_EDITOR_ID
&&
(
e
.
contains
(
fileResource
,
FileChangeType
.
UPDATED
)
||
e
.
contains
(
fileR
esource
,
FileChangeType
.
ADDED
)))
{
if
(
resource
&&
editor
.
getId
()
===
BINARY_FILE_EDITOR_ID
&&
(
e
.
contains
(
resource
,
FileChangeType
.
UPDATED
)
||
e
.
contains
(
r
esource
,
FileChangeType
.
ADDED
)))
{
this
.
editorService
.
openEditor
(
editor
.
input
,
{
forceOpen
:
true
,
preserveFocus
:
true
},
editor
.
position
).
done
(
null
,
errors
.
onUnexpectedError
);
}
});
...
...
@@ -305,9 +305,9 @@ export class FileEditorTracker implements IWorkbenchContribution {
private
handleOutOfWorkspaceWatchers
():
void
{
const
visibleOutOfWorkspacePaths
=
new
ResourceMap
<
URI
>
();
this
.
editorService
.
getVisibleEditors
().
map
(
editor
=>
{
return
toResource
(
editor
.
input
,
{
supportSideBySide
:
true
,
filter
:
'
file
'
});
}).
filter
(
fileR
esource
=>
{
return
!!
fileResource
&&
!
this
.
contextService
.
isInsideWorkspace
(
fileR
esource
);
return
toResource
(
editor
.
input
,
{
supportSideBySide
:
true
});
}).
filter
(
r
esource
=>
{
return
!!
resource
&&
this
.
fileService
.
canHandleResource
(
resource
)
&&
!
this
.
contextService
.
isInsideWorkspace
(
r
esource
);
}).
forEach
(
resource
=>
{
visibleOutOfWorkspacePaths
.
set
(
resource
,
resource
);
});
...
...
src/vs/workbench/parts/markers/browser/markersPanel.ts
浏览文件 @
15b1f599
...
...
@@ -47,7 +47,7 @@ export class MarkersPanel extends Panel {
private
delayedRefresh
:
Delayer
<
void
>
;
private
lastSelectedRelativeTop
:
number
=
0
;
private
currentActive
Fil
e
:
URI
=
null
;
private
currentActive
Resourc
e
:
URI
=
null
;
private
hasToAutoReveal
:
boolean
;
private
tree
:
Tree
.
ITree
;
...
...
@@ -63,7 +63,7 @@ export class MarkersPanel extends Panel {
private
messageBox
:
HTMLElement
;
private
markerFocusContextKey
:
IContextKey
<
boolean
>
;
private
current
Fil
eGotAddedToMarkersData
:
boolean
=
false
;
private
current
Resourc
eGotAddedToMarkersData
:
boolean
=
false
;
constructor
(
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
...
...
@@ -256,31 +256,31 @@ export class MarkersPanel extends Panel {
}
private
onMarkerChanged
(
changedResources
:
URI
[])
{
this
.
current
FileGotAddedToMarkersData
=
this
.
currentFileGotAddedToMarkersData
||
this
.
isCurrentFil
eGotAddedToMarkersData
(
changedResources
);
this
.
current
ResourceGotAddedToMarkersData
=
this
.
currentResourceGotAddedToMarkersData
||
this
.
isCurrentResourc
eGotAddedToMarkersData
(
changedResources
);
this
.
updateResources
(
changedResources
);
this
.
delayedRefresh
.
trigger
(()
=>
{
this
.
refreshPanel
();
this
.
updateRangeHighlights
();
if
(
this
.
current
Fil
eGotAddedToMarkersData
)
{
if
(
this
.
current
Resourc
eGotAddedToMarkersData
)
{
this
.
autoReveal
();
this
.
current
Fil
eGotAddedToMarkersData
=
false
;
this
.
current
Resourc
eGotAddedToMarkersData
=
false
;
}
});
}
private
isCurrent
Fil
eGotAddedToMarkersData
(
changedResources
:
URI
[])
{
if
(
!
this
.
currentActive
Fil
e
)
{
private
isCurrent
Resourc
eGotAddedToMarkersData
(
changedResources
:
URI
[])
{
if
(
!
this
.
currentActive
Resourc
e
)
{
return
false
;
}
const
resourceForCurrentActive
File
=
this
.
getResourceForCurrentActiveFil
e
();
if
(
resourceForCurrentActive
Fil
e
)
{
const
resourceForCurrentActive
Resource
=
this
.
getResourceForCurrentActiveResourc
e
();
if
(
resourceForCurrentActive
Resourc
e
)
{
return
false
;
}
return
changedResources
.
some
(
r
=>
r
.
toString
()
===
this
.
currentActive
Fil
e
.
toString
());
return
changedResources
.
some
(
r
=>
r
.
toString
()
===
this
.
currentActive
Resourc
e
.
toString
());
}
private
onEditorsChanged
():
void
{
this
.
currentActive
File
=
toResource
(
this
.
editorService
.
getActiveEditorInput
(),
{
filter
:
'
file
'
}
);
this
.
currentActive
Resource
=
toResource
(
this
.
editorService
.
getActiveEditorInput
()
);
this
.
autoReveal
();
}
...
...
@@ -340,7 +340,7 @@ export class MarkersPanel extends Panel {
}
private
revealMarkersForCurrentActiveEditor
(
focus
:
boolean
=
false
):
void
{
let
currentActiveResource
=
this
.
getResourceForCurrentActive
Fil
e
();
let
currentActiveResource
=
this
.
getResourceForCurrentActive
Resourc
e
();
if
(
currentActiveResource
)
{
if
(
this
.
tree
.
isExpanded
(
currentActiveResource
)
&&
this
.
hasSelectedMarkerFor
(
currentActiveResource
))
{
this
.
tree
.
reveal
(
this
.
tree
.
getSelection
()[
0
],
this
.
lastSelectedRelativeTop
);
...
...
@@ -360,10 +360,10 @@ export class MarkersPanel extends Panel {
}
}
private
getResourceForCurrentActive
Fil
e
():
Resource
{
if
(
this
.
currentActive
Fil
e
)
{
private
getResourceForCurrentActive
Resourc
e
():
Resource
{
if
(
this
.
currentActive
Resourc
e
)
{
let
resources
=
this
.
markersModel
.
filteredResources
.
filter
((
resource
):
boolean
=>
{
return
this
.
currentActive
Fil
e
.
toString
()
===
resource
.
uri
.
toString
();
return
this
.
currentActive
Resourc
e
.
toString
()
===
resource
.
uri
.
toString
();
});
return
resources
.
length
>
0
?
resources
[
0
]
:
null
;
}
...
...
src/vs/workbench/parts/search/browser/searchActions.ts
浏览文件 @
15b1f599
...
...
@@ -6,7 +6,6 @@
import
nls
=
require
(
'
vs/nls
'
);
import
DOM
=
require
(
'
vs/base/browser/dom
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
resources
=
require
(
'
vs/base/common/resources
'
);
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
URI
from
'
vs/base/common/uri
'
;
...
...
@@ -634,9 +633,9 @@ export class ReplaceAction extends AbstractSearchAndReplaceAction {
}
private
hasToOpenFile
():
boolean
{
const
file
=
toResource
(
this
.
editorService
.
getActiveEditorInput
()
,
{
filter
:
'
file
'
}
);
const
file
=
toResource
(
this
.
editorService
.
getActiveEditorInput
());
if
(
file
)
{
return
paths
.
isEqual
(
file
.
fsPath
,
this
.
element
.
parent
().
resource
().
fsPath
);
return
file
.
toString
()
===
this
.
element
.
parent
().
resource
().
toString
(
);
}
return
false
;
}
...
...
src/vs/workbench/parts/search/common/search.ts
浏览文件 @
15b1f599
...
...
@@ -93,9 +93,9 @@ export function getOutOfWorkspaceEditorResources(editorGroupService: IEditorGrou
editorGroupService
.
getStacksModel
().
groups
.
forEach
(
group
=>
{
const
editors
=
group
.
getEditors
();
editors
.
forEach
(
editor
=>
{
const
fileResource
=
toResource
(
editor
,
{
supportSideBySide
:
true
,
filter
:
'
file
'
});
if
(
fileResource
&&
!
contextService
.
isInsideWorkspace
(
fileR
esource
))
{
resources
.
push
(
fileR
esource
);
const
resource
=
toResource
(
editor
,
{
supportSideBySide
:
true
});
if
(
resource
&&
!
contextService
.
isInsideWorkspace
(
r
esource
))
{
resources
.
push
(
r
esource
);
}
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录