Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0cd49204
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 搜索 >>
提交
0cd49204
编写于
1月 21, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
recover from EditorGroup.isOpen({ resource }) change
上级
08551d7c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
20 deletion
+9
-20
src/vs/workbench/browser/dnd.ts
src/vs/workbench/browser/dnd.ts
+2
-2
src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts
...kbench/contrib/files/browser/editors/fileEditorTracker.ts
+2
-1
src/vs/workbench/services/search/common/searchService.ts
src/vs/workbench/services/search/common/searchService.ts
+4
-14
src/vs/workbench/services/search/node/searchService.ts
src/vs/workbench/services/search/node/searchService.ts
+1
-3
未找到文件。
src/vs/workbench/browser/dnd.ts
浏览文件 @
0cd49204
...
@@ -243,8 +243,8 @@ export class ResourcesDropHandler {
...
@@ -243,8 +243,8 @@ export class ResourcesDropHandler {
droppedDirtyEditor
.
resource
=
this
.
textFileService
.
untitled
.
create
({
mode
:
droppedDirtyEditor
.
mode
,
encoding
:
droppedDirtyEditor
.
encoding
}).
getResource
();
droppedDirtyEditor
.
resource
=
this
.
textFileService
.
untitled
.
create
({
mode
:
droppedDirtyEditor
.
mode
,
encoding
:
droppedDirtyEditor
.
encoding
}).
getResource
();
}
}
//
Return early if the resource is already dirty in target or opened already as file
//
File: ensure the file is not dirty or opened already
if
(
this
.
textFileService
.
isDirty
(
droppedDirtyEditor
.
resource
)
||
this
.
editorService
.
isOpen
(
this
.
editorService
.
createInput
({
resource
:
droppedDirtyEditor
.
resource
,
forceFile
:
true
})))
{
else
if
(
this
.
textFileService
.
isDirty
(
droppedDirtyEditor
.
resource
)
||
this
.
editorService
.
isOpen
(
this
.
editorService
.
createInput
({
resource
:
droppedDirtyEditor
.
resource
,
forceFile
:
true
})))
{
return
false
;
return
false
;
}
}
...
...
src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts
浏览文件 @
0cd49204
...
@@ -25,6 +25,7 @@ import { timeout, RunOnceWorker } from 'vs/base/common/async';
...
@@ -25,6 +25,7 @@ import { timeout, RunOnceWorker } from 'vs/base/common/async';
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
isEqualOrParent
,
joinPath
}
from
'
vs/base/common/resources
'
;
import
{
isEqualOrParent
,
joinPath
}
from
'
vs/base/common/resources
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
export
class
FileEditorTracker
extends
Disposable
implements
IWorkbenchContribution
{
export
class
FileEditorTracker
extends
Disposable
implements
IWorkbenchContribution
{
...
@@ -288,7 +289,7 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut
...
@@ -288,7 +289,7 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut
return
false
;
// resource must not be pending to save
return
false
;
// resource must not be pending to save
}
}
if
(
this
.
editorService
.
isOpen
(
this
.
editorService
.
createInput
({
resource
,
forceFile
:
true
})))
{
if
(
this
.
editorService
.
isOpen
(
this
.
editorService
.
createInput
({
resource
,
forceFile
:
resource
.
scheme
!==
Schemas
.
untitled
,
forceUntitled
:
resource
.
scheme
===
Schemas
.
untitled
})))
{
return
false
;
// model must not be opened already as file
return
false
;
// model must not be opened already as file
}
}
...
...
src/vs/workbench/services/search/common/searchService.ts
浏览文件 @
0cd49204
...
@@ -19,7 +19,6 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
...
@@ -19,7 +19,6 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
deserializeSearchError
,
FileMatch
,
ICachedSearchStats
,
IFileMatch
,
IFileQuery
,
IFileSearchStats
,
IFolderQuery
,
IProgressMessage
,
ISearchComplete
,
ISearchEngineStats
,
ISearchProgressItem
,
ISearchQuery
,
ISearchResultProvider
,
ISearchService
,
ITextQuery
,
pathIncludedInQuery
,
QueryType
,
SearchError
,
SearchErrorCode
,
SearchProviderType
,
isFileMatch
,
isProgressMessage
}
from
'
vs/workbench/services/search/common/search
'
;
import
{
deserializeSearchError
,
FileMatch
,
ICachedSearchStats
,
IFileMatch
,
IFileQuery
,
IFileSearchStats
,
IFolderQuery
,
IProgressMessage
,
ISearchComplete
,
ISearchEngineStats
,
ISearchProgressItem
,
ISearchQuery
,
ISearchResultProvider
,
ISearchService
,
ITextQuery
,
pathIncludedInQuery
,
QueryType
,
SearchError
,
SearchErrorCode
,
SearchProviderType
,
isFileMatch
,
isProgressMessage
}
from
'
vs/workbench/services/search/common/search
'
;
import
{
addContextToEditorMatches
,
editorMatchesToTextSearchResults
}
from
'
vs/workbench/services/search/common/searchHelpers
'
;
import
{
addContextToEditorMatches
,
editorMatchesToTextSearchResults
}
from
'
vs/workbench/services/search/common/searchHelpers
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
export
class
SearchService
extends
Disposable
implements
ISearchService
{
export
class
SearchService
extends
Disposable
implements
ISearchService
{
...
@@ -32,7 +31,6 @@ export class SearchService extends Disposable implements ISearchService {
...
@@ -32,7 +31,6 @@ export class SearchService extends Disposable implements ISearchService {
constructor
(
constructor
(
private
readonly
modelService
:
IModelService
,
private
readonly
modelService
:
IModelService
,
private
readonly
textFileService
:
ITextFileService
,
private
readonly
editorService
:
IEditorService
,
private
readonly
editorService
:
IEditorService
,
private
readonly
telemetryService
:
ITelemetryService
,
private
readonly
telemetryService
:
ITelemetryService
,
private
readonly
logService
:
ILogService
,
private
readonly
logService
:
ILogService
,
...
@@ -391,8 +389,8 @@ export class SearchService extends Disposable implements ISearchService {
...
@@ -391,8 +389,8 @@ export class SearchService extends Disposable implements ISearchService {
return
;
return
;
}
}
// Skip
if editor is
not opened as text file
// Skip
files that are
not opened as text file
if
(
this
.
editorService
.
isOpen
(
this
.
editorService
.
createInput
({
resource
,
forceFile
:
true
})))
{
if
(
!
this
.
editorService
.
isOpen
(
this
.
editorService
.
createInput
({
resource
,
forceFile
:
resource
.
scheme
!==
Schemas
.
untitled
,
forceUntitled
:
resource
.
scheme
===
Schemas
.
untitled
})))
{
return
;
return
;
}
}
...
@@ -402,15 +400,8 @@ export class SearchService extends Disposable implements ISearchService {
...
@@ -402,15 +400,8 @@ export class SearchService extends Disposable implements ISearchService {
return
;
return
;
}
}
// Support untitled files
if
(
resource
.
scheme
===
Schemas
.
untitled
)
{
if
(
!
this
.
textFileService
.
untitled
.
exists
(
resource
))
{
return
;
}
}
// Block walkthrough, webview, etc.
// Block walkthrough, webview, etc.
else
if
(
!
this
.
fileService
.
canHandleResource
(
resource
))
{
if
(
resource
.
scheme
!==
Schemas
.
untitled
&&
!
this
.
fileService
.
canHandleResource
(
resource
))
{
return
;
return
;
}
}
...
@@ -458,14 +449,13 @@ export class SearchService extends Disposable implements ISearchService {
...
@@ -458,14 +449,13 @@ export class SearchService extends Disposable implements ISearchService {
export
class
RemoteSearchService
extends
SearchService
{
export
class
RemoteSearchService
extends
SearchService
{
constructor
(
constructor
(
@
IModelService
modelService
:
IModelService
,
@
IModelService
modelService
:
IModelService
,
@
ITextFileService
textFileService
:
ITextFileService
,
@
IEditorService
editorService
:
IEditorService
,
@
IEditorService
editorService
:
IEditorService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
ILogService
logService
:
ILogService
,
@
ILogService
logService
:
ILogService
,
@
IExtensionService
extensionService
:
IExtensionService
,
@
IExtensionService
extensionService
:
IExtensionService
,
@
IFileService
fileService
:
IFileService
@
IFileService
fileService
:
IFileService
)
{
)
{
super
(
modelService
,
textFileService
,
editorService
,
telemetryService
,
logService
,
extensionService
,
fileService
);
super
(
modelService
,
editorService
,
telemetryService
,
logService
,
extensionService
,
fileService
);
}
}
}
}
...
...
src/vs/workbench/services/search/node/searchService.ts
浏览文件 @
0cd49204
...
@@ -21,7 +21,6 @@ import { SearchChannelClient } from './searchIpc';
...
@@ -21,7 +21,6 @@ import { SearchChannelClient } from './searchIpc';
import
{
SearchService
}
from
'
vs/workbench/services/search/common/searchService
'
;
import
{
SearchService
}
from
'
vs/workbench/services/search/common/searchService
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
...
@@ -31,7 +30,6 @@ import { parseSearchPort } from 'vs/platform/environment/node/environmentService
...
@@ -31,7 +30,6 @@ import { parseSearchPort } from 'vs/platform/environment/node/environmentService
export
class
LocalSearchService
extends
SearchService
{
export
class
LocalSearchService
extends
SearchService
{
constructor
(
constructor
(
@
IModelService
modelService
:
IModelService
,
@
IModelService
modelService
:
IModelService
,
@
ITextFileService
textFileService
:
ITextFileService
,
@
IEditorService
editorService
:
IEditorService
,
@
IEditorService
editorService
:
IEditorService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
ILogService
logService
:
ILogService
,
@
ILogService
logService
:
ILogService
,
...
@@ -40,7 +38,7 @@ export class LocalSearchService extends SearchService {
...
@@ -40,7 +38,7 @@ export class LocalSearchService extends SearchService {
@
IWorkbenchEnvironmentService
readonly
environmentService
:
IWorkbenchEnvironmentService
,
@
IWorkbenchEnvironmentService
readonly
environmentService
:
IWorkbenchEnvironmentService
,
@
IInstantiationService
readonly
instantiationService
:
IInstantiationService
@
IInstantiationService
readonly
instantiationService
:
IInstantiationService
)
{
)
{
super
(
modelService
,
textFileService
,
editorService
,
telemetryService
,
logService
,
extensionService
,
fileService
);
super
(
modelService
,
editorService
,
telemetryService
,
logService
,
extensionService
,
fileService
);
this
.
diskSearch
=
instantiationService
.
createInstance
(
DiskSearch
,
!
environmentService
.
isBuilt
||
environmentService
.
verbose
,
parseSearchPort
(
environmentService
.
args
,
environmentService
.
isBuilt
));
this
.
diskSearch
=
instantiationService
.
createInstance
(
DiskSearch
,
!
environmentService
.
isBuilt
||
environmentService
.
verbose
,
parseSearchPort
(
environmentService
.
args
,
environmentService
.
isBuilt
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录