Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
2924e2b1
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2924e2b1
编写于
12月 05, 2015
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enable to search on the full path when parts of the query contain path separators
上级
0a7c9f72
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
118 addition
and
21 deletion
+118
-21
src/vs/workbench/browser/parts/quickopen/editorHistoryModel.ts
...s/workbench/browser/parts/quickopen/editorHistoryModel.ts
+46
-10
src/vs/workbench/parts/search/browser/openAnythingHandler.ts
src/vs/workbench/parts/search/browser/openAnythingHandler.ts
+17
-0
src/vs/workbench/parts/search/browser/openFileHandler.ts
src/vs/workbench/parts/search/browser/openFileHandler.ts
+29
-5
src/vs/workbench/services/search/node/fileSearch.ts
src/vs/workbench/services/search/node/fileSearch.ts
+6
-4
src/vs/workbench/services/search/test/node/search.test.ts
src/vs/workbench/services/search/test/node/search.test.ts
+18
-0
src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts
.../workbench/test/browser/parts/quickOpen/quickopen.test.ts
+2
-2
未找到文件。
src/vs/workbench/browser/parts/quickopen/editorHistoryModel.ts
浏览文件 @
2924e2b1
...
@@ -8,6 +8,7 @@ import {Registry} from 'vs/platform/platform';
...
@@ -8,6 +8,7 @@ import {Registry} from 'vs/platform/platform';
import
filters
=
require
(
'
vs/base/common/filters
'
);
import
filters
=
require
(
'
vs/base/common/filters
'
);
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
types
=
require
(
'
vs/base/common/types
'
);
import
types
=
require
(
'
vs/base/common/types
'
);
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
EventType
}
from
'
vs/base/common/events
'
;
import
{
EventType
}
from
'
vs/base/common/events
'
;
import
comparers
=
require
(
'
vs/base/common/comparers
'
);
import
comparers
=
require
(
'
vs/base/common/comparers
'
);
...
@@ -31,7 +32,8 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
...
@@ -31,7 +32,8 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
editorService
:
IWorkbenchEditorService
,
editorService
:
IWorkbenchEditorService
,
private
contextService
:
IWorkspaceContextService
,
private
contextService
:
IWorkspaceContextService
,
input
:
EditorInput
,
input
:
EditorInput
,
highlights
:
IHighlight
[],
labelHighlights
:
IHighlight
[],
descriptionHighlights
:
IHighlight
[],
model
:
EditorHistoryModel
model
:
EditorHistoryModel
)
{
)
{
super
(
editorService
);
super
(
editorService
);
...
@@ -49,11 +51,11 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
...
@@ -49,11 +51,11 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
}
}
}
}
this
.
setHighlights
(
h
ighlights
);
this
.
setHighlights
(
labelHighlights
,
descriptionH
ighlights
);
}
}
public
clone
(
highlights
:
IHighlight
[]):
EditorHistoryEntry
{
public
clone
(
labelHighlights
:
IHighlight
[],
descriptionHighlights
?
:
IHighlight
[]):
EditorHistoryEntry
{
return
new
EditorHistoryEntry
(
this
.
editorService
,
this
.
contextService
,
this
.
input
,
h
ighlights
,
this
.
model
);
return
new
EditorHistoryEntry
(
this
.
editorService
,
this
.
contextService
,
this
.
input
,
labelHighlights
,
descriptionH
ighlights
,
this
.
model
);
}
}
public
getLabel
():
string
{
public
getLabel
():
string
{
...
@@ -130,7 +132,7 @@ export class EditorHistoryModel extends QuickOpenModel {
...
@@ -130,7 +132,7 @@ export class EditorHistoryModel extends QuickOpenModel {
// Remove any existing entry and add to the beginning
// Remove any existing entry and add to the beginning
this
.
remove
(
entry
);
this
.
remove
(
entry
);
this
.
entries
.
unshift
(
new
EditorHistoryEntry
(
this
.
editorService
,
this
.
contextService
,
entry
,
null
,
this
));
this
.
entries
.
unshift
(
new
EditorHistoryEntry
(
this
.
editorService
,
this
.
contextService
,
entry
,
null
,
null
,
this
));
// Respect max entries setting
// Respect max entries setting
if
(
this
.
entries
.
length
>
MAX_ENTRIES
)
{
if
(
this
.
entries
.
length
>
MAX_ENTRIES
)
{
...
@@ -207,14 +209,35 @@ export class EditorHistoryModel extends QuickOpenModel {
...
@@ -207,14 +209,35 @@ export class EditorHistoryModel extends QuickOpenModel {
let
results
:
QuickOpenEntry
[]
=
[];
let
results
:
QuickOpenEntry
[]
=
[];
for
(
let
i
=
0
;
i
<
this
.
entries
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
entries
.
length
;
i
++
)
{
let
entry
=
this
.
entries
[
i
];
let
entry
=
<
EditorHistoryEntry
>
this
.
entries
[
i
];
if
(
!
entry
.
getResource
())
{
if
(
!
entry
.
getResource
())
{
continue
;
//For now, only support to match on inputs that provide resource information
continue
;
//For now, only support to match on inputs that provide resource information
}
}
let
highlights
=
filters
.
matchesFuzzy
(
searchValue
,
(
<
EditorHistoryEntry
>
entry
).
getInput
().
getName
());
let
label
=
entry
.
getInput
().
getName
();
if
(
highlights
)
{
let
description
=
entry
.
getInput
().
getDescription
();
results
.
push
((
<
EditorHistoryEntry
>
entry
).
clone
(
highlights
));
let
labelHighlights
:
IHighlight
[]
=
[];
let
descriptionHighlights
:
IHighlight
[]
=
[];
// Search inside filename
if
(
searchValue
.
indexOf
(
paths
.
nativeSep
)
<
0
)
{
labelHighlights
=
filters
.
matchesFuzzy
(
searchValue
,
label
);
}
// Search in full path
else
{
descriptionHighlights
=
filters
.
matchesFuzzy
(
strings
.
trim
(
searchValue
,
paths
.
nativeSep
),
description
);
// If we have no highlights, assume that the match is split among name and parent folder
if
(
!
descriptionHighlights
||
!
descriptionHighlights
.
length
)
{
labelHighlights
=
filters
.
matchesFuzzy
(
paths
.
basename
(
searchValue
),
label
);
descriptionHighlights
=
filters
.
matchesFuzzy
(
strings
.
trim
(
paths
.
dirname
(
searchValue
),
paths
.
nativeSep
),
description
);
}
}
if
((
labelHighlights
&&
labelHighlights
.
length
)
||
(
descriptionHighlights
&&
descriptionHighlights
.
length
))
{
results
.
push
(
entry
.
clone
(
labelHighlights
,
descriptionHighlights
));
}
}
}
}
...
@@ -222,7 +245,20 @@ export class EditorHistoryModel extends QuickOpenModel {
...
@@ -222,7 +245,20 @@ export class EditorHistoryModel extends QuickOpenModel {
if
(
searchValue
)
{
if
(
searchValue
)
{
let
normalizedSearchValue
=
strings
.
stripWildcards
(
searchValue
.
toLowerCase
());
let
normalizedSearchValue
=
strings
.
stripWildcards
(
searchValue
.
toLowerCase
());
return
results
.
sort
((
elementA
:
EditorHistoryEntry
,
elementB
:
EditorHistoryEntry
)
=>
{
return
results
.
sort
((
elementA
:
EditorHistoryEntry
,
elementB
:
EditorHistoryEntry
)
=>
{
// Give matches with label highlights higher priority over
// those with only description highlights
const
labelHighlightsA
=
elementA
.
getHighlights
()[
0
]
||
[];
const
labelHighlightsB
=
elementB
.
getHighlights
()[
0
]
||
[];
if
(
labelHighlightsA
.
length
&&
!
labelHighlightsB
.
length
)
{
return
-
1
;
}
else
if
(
!
labelHighlightsA
.
length
&&
labelHighlightsB
.
length
)
{
return
1
;
}
// Sort by name/path
let
nameA
=
elementA
.
getInput
().
getName
();
let
nameA
=
elementA
.
getInput
().
getName
();
let
nameB
=
elementB
.
getInput
().
getName
();
let
nameB
=
elementB
.
getInput
().
getName
();
...
...
src/vs/workbench/parts/search/browser/openAnythingHandler.ts
浏览文件 @
2924e2b1
...
@@ -10,6 +10,7 @@ import nls = require('vs/nls');
...
@@ -10,6 +10,7 @@ import nls = require('vs/nls');
import
{
ThrottledDelayer
}
from
'
vs/base/common/async
'
;
import
{
ThrottledDelayer
}
from
'
vs/base/common/async
'
;
import
types
=
require
(
'
vs/base/common/types
'
);
import
types
=
require
(
'
vs/base/common/types
'
);
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
filters
=
require
(
'
vs/base/common/filters
'
);
import
filters
=
require
(
'
vs/base/common/filters
'
);
import
{
IRange
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IRange
}
from
'
vs/editor/common/editorCommon
'
;
import
{
compareAnything
}
from
'
vs/base/common/comparers
'
;
import
{
compareAnything
}
from
'
vs/base/common/comparers
'
;
...
@@ -210,6 +211,9 @@ export class OpenAnythingHandler extends QuickOpenHandler {
...
@@ -210,6 +211,9 @@ export class OpenAnythingHandler extends QuickOpenHandler {
}
}
public
getResultsFromCache
(
searchValue
:
string
,
range
:
IRange
=
null
):
QuickOpenEntry
[]
{
public
getResultsFromCache
(
searchValue
:
string
,
range
:
IRange
=
null
):
QuickOpenEntry
[]
{
if
(
searchValue
.
indexOf
(
paths
.
nativeSep
)
>=
0
)
{
return
null
;
// TODO@Ben implement caching for path search
}
// Find cache entries by prefix of search value
// Find cache entries by prefix of search value
let
cachedEntries
:
QuickOpenEntry
[];
let
cachedEntries
:
QuickOpenEntry
[];
...
@@ -257,6 +261,19 @@ export class OpenAnythingHandler extends QuickOpenHandler {
...
@@ -257,6 +261,19 @@ export class OpenAnythingHandler extends QuickOpenHandler {
}
}
private
compareResults
(
elementA
:
QuickOpenEntry
,
elementB
:
QuickOpenEntry
,
searchValue
:
string
):
number
{
private
compareResults
(
elementA
:
QuickOpenEntry
,
elementB
:
QuickOpenEntry
,
searchValue
:
string
):
number
{
// Give matches with label highlights higher priority over
// those with only description highlights
const
labelHighlightsA
=
elementA
.
getHighlights
()[
0
]
||
[];
const
labelHighlightsB
=
elementB
.
getHighlights
()[
0
]
||
[];
if
(
labelHighlightsA
.
length
&&
!
labelHighlightsB
.
length
)
{
return
-
1
;
}
else
if
(
!
labelHighlightsA
.
length
&&
labelHighlightsB
.
length
)
{
return
1
;
}
// Sort by name/path
let
nameA
=
elementA
.
getLabel
();
let
nameA
=
elementA
.
getLabel
();
let
nameB
=
elementB
.
getLabel
();
let
nameB
=
elementB
.
getLabel
();
...
...
src/vs/workbench/parts/search/browser/openFileHandler.ts
浏览文件 @
2924e2b1
...
@@ -34,7 +34,12 @@ export class FileEntry extends EditorQuickOpenEntry {
...
@@ -34,7 +34,12 @@ export class FileEntry extends EditorQuickOpenEntry {
private
resource
:
URI
;
private
resource
:
URI
;
private
range
:
IRange
;
private
range
:
IRange
;
constructor
(
name
:
string
,
resource
:
URI
,
highlights
:
IHighlight
[],
constructor
(
name
:
string
,
description
:
string
,
resource
:
URI
,
labelHighlights
:
IHighlight
[],
descriptionHighlights
:
IHighlight
[],
@
IWorkbenchEditorService
editorService
:
IWorkbenchEditorService
,
@
IWorkbenchEditorService
editorService
:
IWorkbenchEditorService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
...
@@ -43,8 +48,8 @@ export class FileEntry extends EditorQuickOpenEntry {
...
@@ -43,8 +48,8 @@ export class FileEntry extends EditorQuickOpenEntry {
this
.
resource
=
resource
;
this
.
resource
=
resource
;
this
.
name
=
name
;
this
.
name
=
name
;
this
.
description
=
labels
.
getPathLabel
(
paths
.
dirname
(
this
.
resource
.
fsPath
),
contextService
)
;
this
.
description
=
description
;
this
.
setHighlights
(
h
ighlights
);
this
.
setHighlights
(
labelHighlights
,
descriptionH
ighlights
);
}
}
public
getLabel
():
string
{
public
getLabel
():
string
{
...
@@ -149,9 +154,28 @@ export class OpenFileHandler extends QuickOpenHandler {
...
@@ -149,9 +154,28 @@ export class OpenFileHandler extends QuickOpenHandler {
let
results
:
QuickOpenEntry
[]
=
[];
let
results
:
QuickOpenEntry
[]
=
[];
for
(
let
i
=
0
;
i
<
matches
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
matches
.
length
;
i
++
)
{
let
fileMatch
=
matches
[
i
];
let
fileMatch
=
matches
[
i
];
let
highlights
=
filters
.
matchesFuzzy
(
searchValue
,
fileMatch
.
name
());
let
description
=
labels
.
getPathLabel
(
paths
.
dirname
(
fileMatch
.
resource
().
fsPath
),
this
.
contextService
);
let
labelHighlights
:
IHighlight
[]
=
[];
let
descriptionHighlights
:
IHighlight
[]
=
[];
// Search inside filename
if
(
searchValue
.
indexOf
(
paths
.
nativeSep
)
<
0
)
{
labelHighlights
=
filters
.
matchesFuzzy
(
searchValue
,
fileMatch
.
name
());
}
// Search in full path
else
{
descriptionHighlights
=
filters
.
matchesFuzzy
(
strings
.
trim
(
searchValue
,
paths
.
nativeSep
),
description
);
// If we have no highlights, assume that the match is split among name and parent folder
if
(
!
descriptionHighlights
||
!
descriptionHighlights
.
length
)
{
labelHighlights
=
filters
.
matchesFuzzy
(
paths
.
basename
(
searchValue
),
fileMatch
.
name
());
descriptionHighlights
=
filters
.
matchesFuzzy
(
strings
.
trim
(
paths
.
dirname
(
searchValue
),
paths
.
nativeSep
),
description
);
}
}
results
.
push
(
this
.
instantiationService
.
createInstance
(
FileEntry
,
fileMatch
.
name
(),
fileMatch
.
resource
(),
h
ighlights
));
results
.
push
(
this
.
instantiationService
.
createInstance
(
FileEntry
,
fileMatch
.
name
(),
description
,
fileMatch
.
resource
(),
labelHighlights
,
descriptionH
ighlights
));
}
}
return
results
;
return
results
;
...
...
src/vs/workbench/services/search/node/fileSearch.ts
浏览文件 @
2924e2b1
...
@@ -31,6 +31,7 @@ export class FileWalker {
...
@@ -31,6 +31,7 @@ export class FileWalker {
private
isLimitHit
:
boolean
;
private
isLimitHit
:
boolean
;
private
resultCount
:
number
;
private
resultCount
:
number
;
private
isCanceled
:
boolean
;
private
isCanceled
:
boolean
;
private
searchInPath
:
boolean
;
private
walkedPaths
:
{
[
path
:
string
]:
boolean
;
};
private
walkedPaths
:
{
[
path
:
string
]:
boolean
;
};
...
@@ -41,6 +42,7 @@ export class FileWalker {
...
@@ -41,6 +42,7 @@ export class FileWalker {
this
.
includePattern
=
config
.
includePattern
;
this
.
includePattern
=
config
.
includePattern
;
this
.
maxResults
=
config
.
maxResults
||
null
;
this
.
maxResults
=
config
.
maxResults
||
null
;
this
.
walkedPaths
=
Object
.
create
(
null
);
this
.
walkedPaths
=
Object
.
create
(
null
);
this
.
searchInPath
=
this
.
filePattern
&&
this
.
filePattern
.
indexOf
(
paths
.
sep
)
>=
0
;
}
}
private
resetState
():
void
{
private
resetState
():
void
{
...
@@ -81,7 +83,7 @@ export class FileWalker {
...
@@ -81,7 +83,7 @@ export class FileWalker {
}
}
// Check for match on file pattern and include pattern
// Check for match on file pattern and include pattern
if
(
this
.
isFilePatternMatch
(
paths
.
basename
(
absolutePath
))
&&
(
!
this
.
includePattern
||
glob
.
match
(
this
.
includePattern
,
absolutePath
)))
{
if
(
this
.
isFilePatternMatch
(
paths
.
basename
(
absolutePath
)
,
absolutePath
)
&&
(
!
this
.
includePattern
||
glob
.
match
(
this
.
includePattern
,
absolutePath
)))
{
this
.
resultCount
++
;
this
.
resultCount
++
;
if
(
this
.
maxResults
&&
this
.
resultCount
>
this
.
maxResults
)
{
if
(
this
.
maxResults
&&
this
.
resultCount
>
this
.
maxResults
)
{
...
@@ -156,7 +158,7 @@ export class FileWalker {
...
@@ -156,7 +158,7 @@ export class FileWalker {
if
((
<
any
>
error
).
code
===
FileWalker
.
ENOTDIR
&&
!
this
.
isCanceled
&&
!
this
.
isLimitHit
)
{
if
((
<
any
>
error
).
code
===
FileWalker
.
ENOTDIR
&&
!
this
.
isCanceled
&&
!
this
.
isLimitHit
)
{
// Check for match on file pattern and include pattern
// Check for match on file pattern and include pattern
if
(
this
.
isFilePatternMatch
(
file
)
&&
(
!
this
.
includePattern
||
glob
.
match
(
this
.
includePattern
,
relativeFilePath
,
children
)))
{
if
(
this
.
isFilePatternMatch
(
file
,
relativeFilePath
)
&&
(
!
this
.
includePattern
||
glob
.
match
(
this
.
includePattern
,
relativeFilePath
,
children
)))
{
this
.
resultCount
++
;
this
.
resultCount
++
;
if
(
this
.
maxResults
&&
this
.
resultCount
>
this
.
maxResults
)
{
if
(
this
.
maxResults
&&
this
.
resultCount
>
this
.
maxResults
)
{
...
@@ -183,11 +185,11 @@ export class FileWalker {
...
@@ -183,11 +185,11 @@ export class FileWalker {
});
});
}
}
private
isFilePatternMatch
(
path
:
string
):
boolean
{
private
isFilePatternMatch
(
name
:
string
,
path
:
string
):
boolean
{
// Check for search pattern
// Check for search pattern
if
(
this
.
filePattern
)
{
if
(
this
.
filePattern
)
{
const
res
=
filters
.
matchesFuzzy
(
this
.
filePattern
,
path
);
const
res
=
filters
.
matchesFuzzy
(
this
.
filePattern
,
this
.
searchInPath
?
path
:
name
);
return
!!
res
&&
res
.
length
>
0
;
return
!!
res
&&
res
.
length
>
0
;
}
}
...
...
src/vs/workbench/services/search/test/node/search.test.ts
浏览文件 @
2924e2b1
...
@@ -47,6 +47,24 @@ suite('Search', () => {
...
@@ -47,6 +47,24 @@ suite('Search', () => {
});
});
});
});
test
(
'
Files: examples/com*
'
,
function
(
done
:
()
=>
void
)
{
let
engine
=
new
FileSearchEngine
({
rootPaths
:
[
require
.
toUrl
(
'
./fixtures
'
)],
filePattern
:
'
examples
'
+
path
.
sep
+
'
com*
'
});
let
count
=
0
;
engine
.
search
((
result
)
=>
{
if
(
result
)
{
count
++
;
}
},
()
=>
{
},
(
error
)
=>
{
assert
.
ok
(
!
error
);
assert
.
equal
(
count
,
1
);
done
();
});
});
test
(
'
Files: *.js (Files as roots)
'
,
function
(
done
:
()
=>
void
)
{
test
(
'
Files: *.js (Files as roots)
'
,
function
(
done
:
()
=>
void
)
{
let
engine
=
new
FileSearchEngine
({
let
engine
=
new
FileSearchEngine
({
rootPaths
:
[
require
.
toUrl
(
'
./fixtures/examples/company.js
'
),
require
.
toUrl
(
'
./fixtures/examples/small.js
'
)],
rootPaths
:
[
require
.
toUrl
(
'
./fixtures/examples/company.js
'
),
require
.
toUrl
(
'
./fixtures/examples/small.js
'
)],
...
...
src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts
浏览文件 @
2924e2b1
...
@@ -43,7 +43,7 @@ suite('Workbench QuickOpen', () => {
...
@@ -43,7 +43,7 @@ suite('Workbench QuickOpen', () => {
let
model
=
new
EditorHistoryModel
(
editorService
,
null
,
contextService
);
let
model
=
new
EditorHistoryModel
(
editorService
,
null
,
contextService
);
let
input1
=
inst
.
createInstance
(
StringEditorInput
,
"
name1
"
,
'
description
'
,
"
value1
"
,
"
text/plain
"
,
false
);
let
input1
=
inst
.
createInstance
(
StringEditorInput
,
"
name1
"
,
'
description
'
,
"
value1
"
,
"
text/plain
"
,
false
);
let
entry1
=
new
EditorHistoryEntry
(
editorService
,
contextService
,
input1
,
null
,
model
);
let
entry1
=
new
EditorHistoryEntry
(
editorService
,
contextService
,
input1
,
null
,
null
,
model
);
assert
.
equal
(
input1
.
getName
(),
entry1
.
getLabel
());
assert
.
equal
(
input1
.
getName
(),
entry1
.
getLabel
());
assert
.
equal
(
input1
.
getDescription
(),
entry1
.
getDescription
());
assert
.
equal
(
input1
.
getDescription
(),
entry1
.
getDescription
());
...
@@ -63,7 +63,7 @@ suite('Workbench QuickOpen', () => {
...
@@ -63,7 +63,7 @@ suite('Workbench QuickOpen', () => {
let
input2
=
inst
.
createInstance
(
StringEditorInput
,
"
name2
"
,
'
description
'
,
"
value2
"
,
"
text/plain
"
,
false
);
let
input2
=
inst
.
createInstance
(
StringEditorInput
,
"
name2
"
,
'
description
'
,
"
value2
"
,
"
text/plain
"
,
false
);
(
<
any
>
input2
).
getResource
=
()
=>
"
path
"
;
(
<
any
>
input2
).
getResource
=
()
=>
"
path
"
;
let
entry2
=
new
EditorHistoryEntry
(
editorService
,
contextService
,
input2
,
null
,
model
);
let
entry2
=
new
EditorHistoryEntry
(
editorService
,
contextService
,
input2
,
null
,
null
,
model
);
assert
.
equal
(
entry2
.
getResource
(),
"
path
"
);
assert
.
equal
(
entry2
.
getResource
(),
"
path
"
);
assert
(
!
entry1
.
matches
(
entry2
.
getInput
()));
assert
(
!
entry1
.
matches
(
entry2
.
getInput
()));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录