Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
7753381e
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,发现更多精彩内容 >>
提交
7753381e
编写于
6月 18, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
renames: range/selectionRange #34968
上级
1967f696
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
40 addition
and
40 deletion
+40
-40
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+2
-2
src/vs/editor/contrib/documentSymbols/outlineModel.ts
src/vs/editor/contrib/documentSymbols/outlineModel.ts
+5
-5
src/vs/editor/contrib/documentSymbols/outlineTree.ts
src/vs/editor/contrib/documentSymbols/outlineTree.ts
+1
-1
src/vs/editor/contrib/documentSymbols/test/outlineModel.test.ts
.../editor/contrib/documentSymbols/test/outlineModel.test.ts
+2
-2
src/vs/editor/contrib/quickOpen/quickOpen.ts
src/vs/editor/contrib/quickOpen/quickOpen.ts
+3
-3
src/vs/editor/standalone/browser/quickOpen/quickOutline.ts
src/vs/editor/standalone/browser/quickOpen/quickOutline.ts
+1
-1
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+2
-2
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+7
-7
src/vs/workbench/api/node/extHostLanguageFeatures.ts
src/vs/workbench/api/node/extHostLanguageFeatures.ts
+3
-3
src/vs/workbench/api/node/extHostTypeConverters.ts
src/vs/workbench/api/node/extHostTypeConverters.ts
+4
-4
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+7
-7
src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts
.../workbench/parts/outline/electron-browser/outlinePanel.ts
+1
-1
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
...vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
+1
-1
src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts
...test/electron-browser/api/extHostLanguageFeatures.test.ts
+1
-1
未找到文件。
src/vs/editor/common/modes.ts
浏览文件 @
7753381e
...
...
@@ -648,8 +648,8 @@ export interface DocumentSymbol {
detail
:
string
;
kind
:
SymbolKind
;
containerName
?:
string
;
fullR
ange
:
IRange
;
identifier
Range
:
IRange
;
r
ange
:
IRange
;
selection
Range
:
IRange
;
children
?:
DocumentSymbol
[];
}
...
...
src/vs/editor/contrib/documentSymbols/outlineModel.ts
浏览文件 @
7753381e
...
...
@@ -32,7 +32,7 @@ export abstract class TreeElement {
}
else
{
candidateId
=
`
${
container
.
id
}
/
${
candidate
.
name
}
`
;
if
(
container
.
children
[
candidateId
]
!==
void
0
)
{
candidateId
=
`
${
container
.
id
}
/
${
candidate
.
name
}
_
${
candidate
.
fullRange
.
startLineNumber
}
_
${
candidate
.
fullR
ange
.
startColumn
}
`
;
candidateId
=
`
${
container
.
id
}
/
${
candidate
.
name
}
_
${
candidate
.
range
.
startLineNumber
}
_
${
candidate
.
r
ange
.
startColumn
}
`
;
}
}
...
...
@@ -131,7 +131,7 @@ export class OutlineGroup extends TreeElement {
private
_getItemEnclosingPosition
(
position
:
IPosition
,
children
:
{
[
id
:
string
]:
OutlineElement
}):
OutlineElement
{
for
(
let
key
in
children
)
{
let
item
=
children
[
key
];
if
(
!
Range
.
containsPosition
(
item
.
symbol
.
fullR
ange
,
position
))
{
if
(
!
Range
.
containsPosition
(
item
.
symbol
.
r
ange
,
position
))
{
continue
;
}
return
this
.
_getItemEnclosingPosition
(
position
,
item
.
children
)
||
item
;
...
...
@@ -150,11 +150,11 @@ export class OutlineGroup extends TreeElement {
item
.
marker
=
undefined
;
// find the proper start index to check for item/marker overlap.
let
idx
=
binarySearch
<
IRange
>
(
markers
,
item
.
symbol
.
fullR
ange
,
Range
.
compareRangesUsingStarts
);
let
idx
=
binarySearch
<
IRange
>
(
markers
,
item
.
symbol
.
r
ange
,
Range
.
compareRangesUsingStarts
);
let
start
:
number
;
if
(
idx
<
0
)
{
start
=
~
idx
;
if
(
start
>
0
&&
Range
.
areIntersecting
(
markers
[
start
-
1
],
item
.
symbol
.
fullR
ange
))
{
if
(
start
>
0
&&
Range
.
areIntersecting
(
markers
[
start
-
1
],
item
.
symbol
.
r
ange
))
{
start
-=
1
;
}
}
else
{
...
...
@@ -164,7 +164,7 @@ export class OutlineGroup extends TreeElement {
let
myMarkers
:
IMarker
[]
=
[];
let
myTopSev
:
MarkerSeverity
;
while
(
start
<
markers
.
length
&&
Range
.
areIntersecting
(
markers
[
start
],
item
.
symbol
.
fullR
ange
))
{
while
(
start
<
markers
.
length
&&
Range
.
areIntersecting
(
markers
[
start
],
item
.
symbol
.
r
ange
))
{
// remove markers intersecting with this outline element
// and store them in a 'private' array.
let
marker
=
markers
.
splice
(
start
,
1
)[
0
];
...
...
src/vs/editor/contrib/documentSymbols/outlineTree.ts
浏览文件 @
7753381e
...
...
@@ -49,7 +49,7 @@ export class OutlineItemComparator implements ISorter {
return
a
.
symbol
.
name
.
localeCompare
(
b
.
symbol
.
name
);
case
OutlineItemCompareType
.
ByPosition
:
default
:
return
Range
.
compareRangesUsingStarts
(
a
.
symbol
.
fullRange
,
b
.
symbol
.
fullR
ange
);
return
Range
.
compareRangesUsingStarts
(
a
.
symbol
.
range
,
b
.
symbol
.
r
ange
);
}
}
...
...
src/vs/editor/contrib/documentSymbols/test/outlineModel.test.ts
浏览文件 @
7753381e
...
...
@@ -75,8 +75,8 @@ suite('OutlineModel', function () {
name
,
detail
:
'
fake
'
,
kind
:
SymbolKind
.
Boolean
,
identifier
Range
:
range
,
fullR
ange
:
range
selection
Range
:
range
,
r
ange
:
range
};
}
...
...
src/vs/editor/contrib/quickOpen/quickOpen.ts
浏览文件 @
7753381e
...
...
@@ -39,7 +39,7 @@ export function getDocumentSymbols(model: ITextModel): TPromise<DocumentSymbol[]
}
function
compareEntriesUsingStart
(
a
:
DocumentSymbol
,
b
:
DocumentSymbol
):
number
{
return
Range
.
compareRangesUsingStarts
(
a
.
fullRange
,
b
.
fullR
ange
);
return
Range
.
compareRangesUsingStarts
(
a
.
range
,
b
.
r
ange
);
}
function
flatten
(
bucket
:
DocumentSymbol
[],
entries
:
DocumentSymbol
[],
overrideContainerLabel
:
string
):
void
{
...
...
@@ -49,8 +49,8 @@ function flatten(bucket: DocumentSymbol[], entries: DocumentSymbol[], overrideCo
name
:
entry
.
name
,
detail
:
entry
.
detail
,
containerName
:
entry
.
containerName
||
overrideContainerLabel
,
fullRange
:
entry
.
fullR
ange
,
identifierRange
:
entry
.
identifier
Range
,
range
:
entry
.
r
ange
,
selectionRange
:
entry
.
selection
Range
,
children
:
undefined
,
// we flatten it...
});
if
(
entry
.
children
)
{
...
...
src/vs/editor/standalone/browser/quickOpen/quickOutline.ts
浏览文件 @
7753381e
...
...
@@ -197,7 +197,7 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction {
}
// Add
results
.
push
(
this
.
symbolEntry
(
label
,
symbolKindToCssClass
(
element
.
kind
),
description
,
element
.
fullR
ange
,
highlights
,
editor
,
controller
));
results
.
push
(
this
.
symbolEntry
(
label
,
symbolKindToCssClass
(
element
.
kind
),
description
,
element
.
r
ange
,
highlights
,
editor
,
controller
));
}
}
...
...
src/vs/monaco.d.ts
浏览文件 @
7753381e
...
...
@@ -4876,8 +4876,8 @@ declare namespace monaco.languages {
detail
:
string
;
kind
:
SymbolKind
;
containerName
?:
string
;
fullR
ange
:
IRange
;
identifier
Range
:
IRange
;
r
ange
:
IRange
;
selection
Range
:
IRange
;
children
?:
DocumentSymbol
[];
}
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
7753381e
...
...
@@ -397,15 +397,15 @@ declare module 'vscode' {
kind
:
SymbolKind
;
/**
* The
full range of this symbol not including leading/trailing whitespace but everything els
e.
* The
range enclosing this symbol not including leading/trailing whitespace but everything else, e.g comments and cod
e.
*/
fullR
ange
:
Range
;
r
ange
:
Range
;
/**
* The range that should be
revealed when this symbol is being select
ed, e.g the name of a function.
* The range that should be
selected and reveal when this symbol is being pcik
ed, e.g the name of a function.
* Must be contained by the [`fullRange`](#DocumentSymbol.fullRange).
*/
goto
Range
:
Range
;
selection
Range
:
Range
;
/**
* Children of this symbol, e.g. properties of a class.
...
...
@@ -418,10 +418,10 @@ declare module 'vscode' {
* @param name The name of the symbol.
* @param detail Details for the symbol.
* @param kind The kind of the symbol.
* @param
fullR
ange The full range of the symbol.
* @param
goto
Range The range that should be reveal.
* @param
r
ange The full range of the symbol.
* @param
selection
Range The range that should be reveal.
*/
constructor
(
name
:
string
,
detail
:
string
,
kind
:
SymbolKind
,
fullRange
:
Range
,
goto
Range
:
Range
);
constructor
(
name
:
string
,
detail
:
string
,
kind
:
SymbolKind
,
range
:
Range
,
selection
Range
:
Range
);
}
export
interface
DocumentSymbolProvider
{
...
...
src/vs/workbench/api/node/extHostLanguageFeatures.ts
浏览文件 @
7753381e
...
...
@@ -69,8 +69,8 @@ class OutlineAdapter {
name
:
info
[
i
].
name
,
kind
:
typeConvert
.
SymbolKind
.
from
(
info
[
i
].
kind
),
containerName
:
info
[
i
].
containerName
,
fullR
ange
:
typeConvert
.
Range
.
from
(
info
[
i
].
location
.
range
),
identifier
Range
:
typeConvert
.
Range
.
from
(
info
[
i
].
location
.
range
),
r
ange
:
typeConvert
.
Range
.
from
(
info
[
i
].
location
.
range
),
selection
Range
:
typeConvert
.
Range
.
from
(
info
[
i
].
location
.
range
),
children
:
[]
};
...
...
@@ -81,7 +81,7 @@ class OutlineAdapter {
break
;
}
let
parent
=
parentStack
[
parentStack
.
length
-
1
];
if
(
EditorRange
.
containsRange
(
parent
.
fullRange
,
element
.
fullRange
)
&&
!
EditorRange
.
equalsRange
(
parent
.
fullRange
,
element
.
fullR
ange
))
{
if
(
EditorRange
.
containsRange
(
parent
.
range
,
element
.
range
)
&&
!
EditorRange
.
equalsRange
(
parent
.
range
,
element
.
r
ange
))
{
parent
.
children
.
push
(
element
);
parentStack
.
push
(
element
);
break
;
...
...
src/vs/workbench/api/node/extHostTypeConverters.ts
浏览文件 @
7753381e
...
...
@@ -374,8 +374,8 @@ export namespace DocumentSymbol {
let
result
:
modes
.
DocumentSymbol
=
{
name
:
info
.
name
,
detail
:
info
.
detail
,
fullRange
:
Range
.
from
(
info
.
fullR
ange
),
identifierRange
:
Range
.
from
(
info
.
goto
Range
),
range
:
Range
.
from
(
info
.
r
ange
),
selectionRange
:
Range
.
from
(
info
.
selection
Range
),
kind
:
SymbolKind
.
from
(
info
.
kind
)
};
if
(
info
.
children
)
{
...
...
@@ -388,8 +388,8 @@ export namespace DocumentSymbol {
info
.
name
,
info
.
detail
,
SymbolKind
.
to
(
info
.
kind
),
Range
.
to
(
info
.
fullR
ange
),
Range
.
to
(
info
.
identifier
Range
),
Range
.
to
(
info
.
r
ange
),
Range
.
to
(
info
.
selection
Range
),
);
if
(
info
.
children
)
{
result
.
children
=
info
.
children
.
map
(
to
)
as
any
;
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
7753381e
...
...
@@ -885,20 +885,20 @@ export class DocumentSymbol {
name
:
string
;
detail
:
string
;
kind
:
SymbolKind
;
fullR
ange
:
Range
;
goto
Range
:
Range
;
r
ange
:
Range
;
selection
Range
:
Range
;
children
:
DocumentSymbol
[];
constructor
(
name
:
string
,
detail
:
string
,
kind
:
SymbolKind
,
fullRange
:
Range
,
goto
Range
:
Range
)
{
constructor
(
name
:
string
,
detail
:
string
,
kind
:
SymbolKind
,
range
:
Range
,
selection
Range
:
Range
)
{
this
.
name
=
name
;
this
.
detail
=
detail
;
this
.
kind
=
kind
;
this
.
fullRange
=
fullR
ange
;
this
.
gotoRange
=
goto
Range
;
this
.
range
=
r
ange
;
this
.
selectionRange
=
selection
Range
;
this
.
children
=
[];
if
(
!
this
.
fullRange
.
contains
(
this
.
goto
Range
))
{
throw
new
Error
(
'
goto
Range must be contained in fullRange
'
);
if
(
!
this
.
range
.
contains
(
this
.
selection
Range
))
{
throw
new
Error
(
'
selection
Range must be contained in fullRange
'
);
}
}
}
...
...
src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts
浏览文件 @
7753381e
...
...
@@ -631,7 +631,7 @@ export class OutlinePanel extends ViewletPanel {
private
async
_revealTreeSelection
(
model
:
OutlineModel
,
element
:
OutlineElement
,
focus
:
boolean
,
aside
:
boolean
):
TPromise
<
void
>
{
let
input
=
this
.
_editorService
.
createInput
({
resource
:
model
.
textModel
.
uri
});
await
this
.
_editorService
.
openEditor
(
input
,
{
preserveFocus
:
!
focus
,
selection
:
Range
.
collapseToStart
(
element
.
symbol
.
identifier
Range
),
revealInCenterIfOutsideViewport
:
true
,
forceOpen
:
true
},
aside
?
SIDE_GROUP
:
ACTIVE_GROUP
);
await
this
.
_editorService
.
openEditor
(
input
,
{
preserveFocus
:
!
focus
,
selection
:
Range
.
collapseToStart
(
element
.
symbol
.
selection
Range
),
revealInCenterIfOutsideViewport
:
true
,
forceOpen
:
true
},
aside
?
SIDE_GROUP
:
ACTIVE_GROUP
);
}
private
async
_revealEditorSelection
(
model
:
OutlineModel
,
selection
:
Selection
):
TPromise
<
void
>
{
...
...
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
浏览文件 @
7753381e
...
...
@@ -450,7 +450,7 @@ export class GotoSymbolHandler extends QuickOpenHandler {
// Add
results
.
push
(
new
SymbolEntry
(
i
,
label
,
icon
,
description
,
icon
,
element
.
fullR
ange
,
null
,
this
.
editorService
,
this
element
.
r
ange
,
null
,
this
.
editorService
,
this
));
}
...
...
src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts
浏览文件 @
7753381e
...
...
@@ -182,7 +182,7 @@ suite('ExtHostLanguageFeatures', function () {
let
entry
=
value
[
0
];
assert
.
equal
(
entry
.
name
,
'
test
'
);
assert
.
deepEqual
(
entry
.
fullR
ange
,
{
startLineNumber
:
1
,
startColumn
:
1
,
endLineNumber
:
1
,
endColumn
:
1
});
assert
.
deepEqual
(
entry
.
r
ange
,
{
startLineNumber
:
1
,
startColumn
:
1
,
endLineNumber
:
1
,
endColumn
:
1
});
});
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录