Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9fb2eb60
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,发现更多精彩内容 >>
提交
9fb2eb60
编写于
5月 23, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
上级
c47cdcfe
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
23 deletion
+26
-23
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+0
-21
src/vs/workbench/parts/search/browser/openFileHandler.ts
src/vs/workbench/parts/search/browser/openFileHandler.ts
+2
-1
src/vs/workbench/parts/search/browser/searchViewlet.ts
src/vs/workbench/parts/search/browser/searchViewlet.ts
+1
-1
src/vs/workbench/parts/search/common/search.ts
src/vs/workbench/parts/search/common/search.ts
+23
-0
未找到文件。
src/vs/workbench/common/editor.ts
浏览文件 @
9fb2eb60
...
...
@@ -12,8 +12,6 @@ import URI from 'vs/base/common/uri';
import
{
IDisposable
,
dispose
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IEditor
,
ICommonCodeEditor
,
IEditorViewState
,
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IEditorInput
,
IEditorModel
,
IEditorOptions
,
ITextEditorOptions
,
IBaseResourceInput
,
Position
,
Verbosity
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
IInstantiationService
,
IConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
...
...
@@ -818,25 +816,6 @@ export class TextDiffEditorOptions extends TextEditorOptions {
public
autoRevealFirstChange
:
boolean
;
}
/**
* Helper to return all opened editors with resources not belonging to the currently opened workspace.
*/
export
function
getOutOfWorkspaceEditorResources
(
editorGroupService
:
IEditorGroupService
,
contextService
:
IWorkspaceContextService
):
URI
[]
{
const
resources
:
URI
[]
=
[];
editorGroupService
.
getStacksModel
().
groups
.
forEach
(
group
=>
{
const
editors
=
group
.
getEditors
();
editors
.
forEach
(
editor
=>
{
const
fileResource
=
toResource
(
editor
,
{
supportSideBySide
:
true
,
filter
:
'
file
'
});
if
(
fileResource
&&
!
contextService
.
isInsideWorkspace
(
fileResource
))
{
resources
.
push
(
fileResource
);
}
});
});
return
resources
;
}
export
interface
IStacksModelChangeEvent
{
group
:
IEditorGroup
;
editor
?:
IEditorInput
;
...
...
src/vs/workbench/parts/search/browser/openFileHandler.ts
浏览文件 @
9fb2eb60
...
...
@@ -21,7 +21,7 @@ import { IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen';
import
{
QuickOpenEntry
,
QuickOpenModel
}
from
'
vs/base/parts/quickopen/browser/quickOpenModel
'
;
import
{
QuickOpenHandler
,
EditorQuickOpenEntry
}
from
'
vs/workbench/browser/quickopen
'
;
import
{
QueryBuilder
}
from
'
vs/workbench/parts/search/common/searchQuery
'
;
import
{
EditorInput
,
getOutOfWorkspaceEditorResources
,
IWorkbenchEditorConfiguration
}
from
'
vs/workbench/common/editor
'
;
import
{
EditorInput
,
IWorkbenchEditorConfiguration
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
...
...
@@ -31,6 +31,7 @@ import { IQueryOptions, ISearchService, ISearchStats, ISearchQuery } from 'vs/pl
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IRange
}
from
'
vs/editor/common/core/range
'
;
import
{
getOutOfWorkspaceEditorResources
}
from
"
vs/workbench/parts/search/common/search
"
;
export
class
FileQuickOpenModel
extends
QuickOpenModel
{
...
...
src/vs/workbench/parts/search/browser/searchViewlet.ts
浏览文件 @
9fb2eb60
...
...
@@ -27,7 +27,6 @@ import { Tree } from 'vs/base/parts/tree/browser/treeImpl';
import
{
Scope
}
from
'
vs/workbench/common/memento
'
;
import
{
IPreferencesService
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
getOutOfWorkspaceEditorResources
}
from
'
vs/workbench/common/editor
'
;
import
{
FileChangeType
,
FileChangesEvent
,
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
Viewlet
}
from
'
vs/workbench/browser/viewlet
'
;
import
{
Match
,
FileMatch
,
SearchModel
,
FileMatchOrMatch
,
IChangeEvent
,
ISearchWorkbenchService
}
from
'
vs/workbench/parts/search/common/searchModel
'
;
...
...
@@ -61,6 +60,7 @@ import FileResultsNavigation from 'vs/workbench/browser/fileResultsNavigation';
import
{
attachListStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
IOutputService
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
getOutOfWorkspaceEditorResources
}
from
"
vs/workbench/parts/search/common/search
"
;
export
class
SearchViewlet
extends
Viewlet
{
...
...
src/vs/workbench/parts/search/common/search.ts
浏览文件 @
9fb2eb60
...
...
@@ -12,6 +12,10 @@ import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import
{
ISearchConfiguration
}
from
'
vs/platform/search/common/search
'
;
import
glob
=
require
(
'
vs/base/common/glob
'
);
import
{
SymbolInformation
}
from
'
vs/editor/common/modes
'
;
import
{
IEditorGroupService
}
from
"
vs/workbench/services/group/common/groupService
"
;
import
{
IWorkspaceContextService
}
from
"
vs/platform/workspace/common/workspace
"
;
import
URI
from
"
vs/base/common/uri
"
;
import
{
toResource
}
from
"
vs/workbench/common/editor
"
;
export
interface
IWorkspaceSymbolProvider
{
provideWorkspaceSymbols
(
search
:
string
):
TPromise
<
SymbolInformation
[]
>
;
...
...
@@ -79,3 +83,22 @@ export interface IWorkbenchSearchConfiguration extends ISearchConfiguration {
useIgnoreFilesByDefault
:
boolean
};
}
/**
* Helper to return all opened editors with resources not belonging to the currently opened workspace.
*/
export
function
getOutOfWorkspaceEditorResources
(
editorGroupService
:
IEditorGroupService
,
contextService
:
IWorkspaceContextService
):
URI
[]
{
const
resources
:
URI
[]
=
[];
editorGroupService
.
getStacksModel
().
groups
.
forEach
(
group
=>
{
const
editors
=
group
.
getEditors
();
editors
.
forEach
(
editor
=>
{
const
fileResource
=
toResource
(
editor
,
{
supportSideBySide
:
true
,
filter
:
'
file
'
});
if
(
fileResource
&&
!
contextService
.
isInsideWorkspace
(
fileResource
))
{
resources
.
push
(
fileResource
);
}
});
});
return
resources
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录