Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a3d44c1f
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,发现更多精彩内容 >>
提交
a3d44c1f
编写于
2月 24, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
re-request code action after applying them, fixes #21060
上级
b307369d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
8 deletion
+17
-8
src/vs/editor/contrib/quickFix/browser/quickFix.ts
src/vs/editor/contrib/quickFix/browser/quickFix.ts
+2
-1
src/vs/editor/contrib/quickFix/browser/quickFixWidget.ts
src/vs/editor/contrib/quickFix/browser/quickFixWidget.ts
+10
-2
src/vs/editor/contrib/quickFix/common/quickFixModel.ts
src/vs/editor/contrib/quickFix/common/quickFixModel.ts
+5
-5
未找到文件。
src/vs/editor/contrib/quickFix/browser/quickFix.ts
浏览文件 @
a3d44c1f
...
...
@@ -50,6 +50,7 @@ export class QuickFixController implements IEditorContribution {
this
.
_updateLightBulbTitle
();
this
.
_disposables
.
push
(
this
.
_quickFixContextMenu
.
onDidExecuteCodeAction
(
_
=>
this
.
_model
.
trigger
(
'
auto
'
)),
this
.
_lightBulbWidget
.
onClick
(
this
.
_handleLightBulbSelect
,
this
),
this
.
_model
.
onDidChangeFixes
(
e
=>
this
.
_onQuickFixEvent
(
e
)),
this
.
_keybindingService
.
onDidUpdateKeybindings
(
this
.
_updateLightBulbTitle
,
this
)
...
...
@@ -88,7 +89,7 @@ export class QuickFixController implements IEditorContribution {
}
public
triggerFromEditorSelection
():
void
{
this
.
_model
.
trigger
Manual
(
);
this
.
_model
.
trigger
(
'
manual
'
);
}
private
_updateLightBulbTitle
():
void
{
...
...
src/vs/editor/contrib/quickFix/browser/quickFixWidget.ts
浏览文件 @
a3d44c1f
...
...
@@ -6,6 +6,7 @@
'
use strict
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
always
}
from
'
vs/base/common/async
'
;
import
{
getDomNodePagePosition
}
from
'
vs/base/browser/dom
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
IPosition
}
from
'
vs/editor/common/editorCommon
'
;
...
...
@@ -14,6 +15,7 @@ import { CodeAction } from 'vs/editor/common/modes';
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
export
class
QuickFixContextMenu
{
...
...
@@ -21,6 +23,9 @@ export class QuickFixContextMenu {
private
_contextMenuService
:
IContextMenuService
;
private
_commandService
:
ICommandService
;
private
_visible
:
boolean
;
private
_onDidExecuteCodeAction
=
new
Emitter
<
void
>
();
readonly
onDidExecuteCodeAction
:
Event
<
void
>
=
this
.
_onDidExecuteCodeAction
.
event
;
constructor
(
editor
:
ICodeEditor
,
contextMenuService
:
IContextMenuService
,
commandService
:
ICommandService
)
{
this
.
_editor
=
editor
;
...
...
@@ -31,9 +36,12 @@ export class QuickFixContextMenu {
show
(
fixes
:
TPromise
<
CodeAction
[]
>
,
at
:
{
x
:
number
;
y
:
number
}
|
IPosition
)
{
const
actions
=
fixes
.
then
(
value
=>
{
return
value
.
map
(({
command
})
=>
{
return
value
.
map
(({
command
})
=>
{
return
new
Action
(
command
.
id
,
command
.
title
,
undefined
,
true
,
()
=>
{
return
this
.
_commandService
.
executeCommand
(
command
.
id
,
...
command
.
arguments
);
return
always
(
this
.
_commandService
.
executeCommand
(
command
.
id
,
...
command
.
arguments
),
()
=>
this
.
_onDidExecuteCodeAction
.
fire
(
undefined
)
);
});
});
});
...
...
src/vs/editor/contrib/quickFix/common/quickFixModel.ts
浏览文件 @
a3d44c1f
...
...
@@ -32,7 +32,7 @@ export class QuickFixOracle {
this
.
_disposables
=
dispose
(
this
.
_disposables
);
}
trigger
(
type
:
'
manual
'
|
'
auto
'
=
'
manual
'
):
void
{
trigger
(
type
:
'
manual
'
|
'
auto
'
):
void
{
let
range
=
this
.
_rangeAtPosition
();
if
(
!
range
)
{
range
=
this
.
_editor
.
getSelection
();
...
...
@@ -47,7 +47,7 @@ export class QuickFixOracle {
}
private
_onMarkerChanges
(
resources
:
URI
[]):
void
{
const
{
uri
}
=
this
.
_editor
.
getModel
();
const
{
uri
}
=
this
.
_editor
.
getModel
();
for
(
const
resource
of
resources
)
{
if
(
resource
.
toString
()
===
uri
.
toString
())
{
this
.
_onCursorChange
();
...
...
@@ -90,7 +90,7 @@ export class QuickFixOracle {
private
_markerAtPosition
():
IMarker
{
const
position
=
this
.
_editor
.
getPosition
();
const
{
uri
}
=
this
.
_editor
.
getModel
();
const
{
uri
}
=
this
.
_editor
.
getModel
();
const
markers
=
this
.
_markerService
.
read
({
resource
:
uri
}).
sort
(
Range
.
compareRangesUsingStarts
);
let
idx
=
arrays
.
findFirst
(
markers
,
marker
=>
marker
.
endLineNumber
>=
position
.
lineNumber
);
...
...
@@ -172,9 +172,9 @@ export class QuickFixModel {
}
}
trigger
Manual
(
):
void
{
trigger
(
type
:
'
auto
'
|
'
manual
'
):
void
{
if
(
this
.
_quickFixOracle
)
{
this
.
_quickFixOracle
.
trigger
();
this
.
_quickFixOracle
.
trigger
(
type
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录