Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e556d244
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,发现更多精彩内容 >>
提交
e556d244
编写于
11月 06, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - less TPromise
上级
a519549d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
12 deletion
+10
-12
src/vs/workbench/browser/quickopen.ts
src/vs/workbench/browser/quickopen.ts
+1
-1
src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts
src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts
+3
-4
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
...vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
+6
-7
未找到文件。
src/vs/workbench/browser/quickopen.ts
浏览文件 @
e556d244
...
...
@@ -326,7 +326,7 @@ export class QuickOpenAction extends Action {
this
.
enabled
=
!!
this
.
quickOpenService
;
}
run
(
context
?:
any
):
T
Promise
<
void
>
{
run
(
context
?:
any
):
Promise
<
void
>
{
// Show with prefix
this
.
quickOpenService
.
show
(
this
.
prefix
);
...
...
src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts
浏览文件 @
e556d244
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
types
from
'
vs/base/common/types
'
;
import
{
IEntryRunContext
,
Mode
,
IAutoFocus
}
from
'
vs/base/parts/quickopen/common/quickOpen
'
;
...
...
@@ -38,7 +37,7 @@ export class GotoLineAction extends QuickOpenAction {
super
(
actionId
,
actionLabel
,
GOTO_LINE_PREFIX
,
_quickOpenService
);
}
run
():
T
Promise
<
void
>
{
run
():
Promise
<
void
>
{
let
activeTextEditorWidget
=
this
.
editorService
.
activeTextEditorWidget
;
if
(
isDiffEditor
(
activeTextEditorWidget
))
{
...
...
@@ -217,7 +216,7 @@ export class GotoLineHandler extends QuickOpenHandler {
return
nls
.
localize
(
'
gotoLineHandlerAriaLabel
'
,
"
Type a line number to navigate to.
"
);
}
getResults
(
searchValue
:
string
,
token
:
CancellationToken
):
T
Promise
<
QuickOpenModel
>
{
getResults
(
searchValue
:
string
,
token
:
CancellationToken
):
Promise
<
QuickOpenModel
>
{
searchValue
=
searchValue
.
trim
();
// Remember view state to be able to restore on cancel
...
...
@@ -226,7 +225,7 @@ export class GotoLineHandler extends QuickOpenHandler {
this
.
lastKnownEditorViewState
=
activeTextEditorWidget
.
saveViewState
();
}
return
TPromise
.
as
(
new
QuickOpenModel
([
new
GotoLineEntry
(
searchValue
,
this
.
editorService
,
this
)]));
return
Promise
.
resolve
(
new
QuickOpenModel
([
new
GotoLineEntry
(
searchValue
,
this
.
editorService
,
this
)]));
}
canRun
():
boolean
|
string
{
...
...
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
浏览文件 @
e556d244
...
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
import
'
vs/css!vs/editor/contrib/documentSymbols/media/symbol-icons
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
types
from
'
vs/base/common/types
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
...
...
@@ -369,7 +368,7 @@ export class GotoSymbolHandler extends QuickOpenHandler {
private
rangeHighlightDecorationId
:
IEditorLineDecoration
;
private
lastKnownEditorViewState
:
IEditorViewState
;
private
cachedOutlineRequest
:
T
Promise
<
OutlineModel
>
;
private
cachedOutlineRequest
:
Promise
<
OutlineModel
>
;
private
pendingOutlineRequest
:
CancellationTokenSource
;
constructor
(
...
...
@@ -391,7 +390,7 @@ export class GotoSymbolHandler extends QuickOpenHandler {
this
.
rangeHighlightDecorationId
=
void
0
;
}
getResults
(
searchValue
:
string
,
token
:
CancellationToken
):
T
Promise
<
QuickOpenModel
>
{
getResults
(
searchValue
:
string
,
token
:
CancellationToken
):
Promise
<
QuickOpenModel
>
{
searchValue
=
searchValue
.
trim
();
// Support to cancel pending outline requests
...
...
@@ -483,7 +482,7 @@ export class GotoSymbolHandler extends QuickOpenHandler {
return
results
;
}
private
getOutline
():
T
Promise
<
OutlineModel
>
{
private
getOutline
():
Promise
<
OutlineModel
>
{
if
(
!
this
.
cachedOutlineRequest
)
{
this
.
cachedOutlineRequest
=
this
.
doGetActiveOutline
();
}
...
...
@@ -491,7 +490,7 @@ export class GotoSymbolHandler extends QuickOpenHandler {
return
this
.
cachedOutlineRequest
;
}
private
doGetActiveOutline
():
T
Promise
<
OutlineModel
>
{
private
doGetActiveOutline
():
Promise
<
OutlineModel
>
{
const
activeTextEditorWidget
=
this
.
editorService
.
activeTextEditorWidget
;
if
(
activeTextEditorWidget
)
{
let
model
=
activeTextEditorWidget
.
getModel
();
...
...
@@ -500,13 +499,13 @@ export class GotoSymbolHandler extends QuickOpenHandler {
}
if
(
model
&&
types
.
isFunction
((
<
ITextModel
>
model
).
getLanguageIdentifier
))
{
return
TPromise
.
wrap
(
asThenable
(()
=>
getDocumentSymbols
(
<
ITextModel
>
model
,
true
,
this
.
pendingOutlineRequest
.
token
)).
then
(
entries
=>
{
return
Promise
.
resolve
(
asThenable
(()
=>
getDocumentSymbols
(
<
ITextModel
>
model
,
true
,
this
.
pendingOutlineRequest
.
token
)).
then
(
entries
=>
{
return
new
OutlineModel
(
this
.
toQuickOpenEntries
(
entries
));
}));
}
}
return
TPromise
.
wrap
<
OutlineModel
>
(
null
);
return
Promise
.
resolve
(
null
);
}
decorateOutline
(
fullRange
:
IRange
,
startRange
:
IRange
,
editor
:
IEditor
,
group
:
IEditorGroup
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录