Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7a8905a2
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,发现更多精彩内容 >>
提交
7a8905a2
编写于
10月 18, 2016
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - use fromEventEmitter util
上级
98b8af7e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
73 deletion
+28
-73
src/vs/editor/browser/widget/codeEditorWidget.ts
src/vs/editor/browser/widget/codeEditorWidget.ts
+11
-29
src/vs/editor/common/commonCodeEditor.ts
src/vs/editor/common/commonCodeEditor.ts
+15
-42
src/vs/editor/contrib/quickFix/browser/lightBulbWidget.ts
src/vs/editor/contrib/quickFix/browser/lightBulbWidget.ts
+2
-2
未找到文件。
src/vs/editor/browser/widget/codeEditorWidget.ts
浏览文件 @
7a8905a2
...
...
@@ -24,40 +24,22 @@ import { Configuration } from 'vs/editor/browser/config/configuration';
import
*
as
editorBrowser
from
'
vs/editor/browser/editorBrowser
'
;
import
{
Colorizer
}
from
'
vs/editor/browser/standalone/colorizer
'
;
import
{
View
}
from
'
vs/editor/browser/view/viewImpl
'
;
import
{
Disposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
Event
,
{
Emitter
,
fromEventEmitter
}
from
'
vs/base/common/event
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
InternalEditorAction
}
from
'
vs/editor/common/editorAction
'
;
export
abstract
class
CodeEditorWidget
extends
CommonCodeEditor
implements
editorBrowser
.
ICodeEditor
{
public
onMouseUp
(
listener
:
(
e
:
editorBrowser
.
IEditorMouseEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
MouseUp
,
listener
);
}
public
onMouseDown
(
listener
:
(
e
:
editorBrowser
.
IEditorMouseEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
MouseDown
,
listener
);
}
public
onContextMenu
(
listener
:
(
e
:
editorBrowser
.
IEditorMouseEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
ContextMenu
,
listener
);
}
public
onMouseMove
(
listener
:
(
e
:
editorBrowser
.
IEditorMouseEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
MouseMove
,
listener
);
}
public
onMouseLeave
(
listener
:
(
e
:
editorBrowser
.
IEditorMouseEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
MouseLeave
,
listener
);
}
public
onKeyUp
(
listener
:
(
e
:
IKeyboardEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
KeyUp
,
listener
);
}
public
onKeyDown
(
listener
:
(
e
:
IKeyboardEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
KeyDown
,
listener
);
}
public
onDidLayoutChange
(
listener
:
(
e
:
editorCommon
.
EditorLayoutInfo
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
EditorLayout
,
listener
);
}
public
onDidScrollChange
(
listener
:
(
e
:
editorCommon
.
IScrollEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
'
scroll
'
,
listener
);
}
public
readonly
onMouseUp
:
Event
<
editorBrowser
.
IEditorMouseEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
MouseUp
);
public
readonly
onMouseDown
:
Event
<
editorBrowser
.
IEditorMouseEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
MouseDown
);
public
readonly
onContextMenu
:
Event
<
editorBrowser
.
IEditorMouseEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ContextMenu
);
public
readonly
onMouseMove
:
Event
<
editorBrowser
.
IEditorMouseEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
MouseMove
);
public
readonly
onMouseLeave
:
Event
<
editorBrowser
.
IEditorMouseEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
MouseLeave
);
public
readonly
onKeyUp
:
Event
<
IKeyboardEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
KeyUp
);
public
readonly
onKeyDown
:
Event
<
IKeyboardEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
KeyDown
);
public
readonly
onDidLayoutChange
:
Event
<
editorCommon
.
EditorLayoutInfo
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
EditorLayout
);
public
readonly
onDidScrollChange
:
Event
<
editorCommon
.
IScrollEvent
>
=
fromEventEmitter
(
this
,
'
scroll
'
);
private
_codeEditorService
:
ICodeEditorService
;
private
_commandService
:
ICommandService
;
...
...
src/vs/editor/common/commonCodeEditor.ts
浏览文件 @
7a8905a2
...
...
@@ -5,6 +5,7 @@
'
use strict
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
Event
,
{
fromEventEmitter
}
from
'
vs/base/common/event
'
;
import
{
EventEmitter
,
IEventEmitter
}
from
'
vs/base/common/eventEmitter
'
;
import
{
Disposable
,
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
...
...
@@ -36,48 +37,20 @@ var EDITOR_ID = 0;
export
abstract
class
CommonCodeEditor
extends
EventEmitter
implements
editorCommon
.
ICommonCodeEditor
{
public
onDidChangeModelRawContent
(
listener
:
(
e
:
editorCommon
.
IModelContentChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
ModelRawContentChanged
,
listener
);
}
public
onDidChangeModelContent
(
listener
:
(
e
:
editorCommon
.
IModelContentChangedEvent2
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
ModelContentChanged2
,
listener
);
}
public
onDidChangeModelMode
(
listener
:
(
e
:
editorCommon
.
IModelModeChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
ModelModeChanged
,
listener
);
}
public
onDidChangeModelOptions
(
listener
:
(
e
:
editorCommon
.
IModelOptionsChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
ModelOptionsChanged
,
listener
);
}
public
onDidChangeModelDecorations
(
listener
:
(
e
:
editorCommon
.
IModelDecorationsChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
ModelDecorationsChanged
,
listener
);
}
public
onDidChangeConfiguration
(
listener
:
(
e
:
editorCommon
.
IConfigurationChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
ConfigurationChanged
,
listener
);
}
public
onDidChangeModel
(
listener
:
(
e
:
editorCommon
.
IModelChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
ModelChanged
,
listener
);
}
public
onDidChangeCursorPosition
(
listener
:
(
e
:
editorCommon
.
ICursorPositionChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
CursorPositionChanged
,
listener
);
}
public
onDidChangeCursorSelection
(
listener
:
(
e
:
editorCommon
.
ICursorSelectionChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
CursorSelectionChanged
,
listener
);
}
public
onDidFocusEditorText
(
listener
:
()
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
EditorTextFocus
,
listener
);
}
public
onDidBlurEditorText
(
listener
:
()
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
EditorTextBlur
,
listener
);
}
public
onDidFocusEditor
(
listener
:
()
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
EditorFocus
,
listener
);
}
public
onDidBlurEditor
(
listener
:
()
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
EditorBlur
,
listener
);
}
public
onDidDispose
(
listener
:
()
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
Disposed
,
listener
);
}
public
readonly
onDidChangeModelRawContent
:
Event
<
editorCommon
.
IModelContentChangedEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ModelRawContentChanged
);
public
readonly
onDidChangeModelContent
:
Event
<
editorCommon
.
IModelContentChangedEvent2
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ModelContentChanged2
);
public
readonly
onDidChangeModelMode
:
Event
<
editorCommon
.
IModelModeChangedEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ModelModeChanged
);
public
readonly
onDidChangeModelOptions
:
Event
<
editorCommon
.
IModelOptionsChangedEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ModelOptionsChanged
);
public
readonly
onDidChangeModelDecorations
:
Event
<
editorCommon
.
IModelDecorationsChangedEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ModelDecorationsChanged
);
public
readonly
onDidChangeConfiguration
:
Event
<
editorCommon
.
IConfigurationChangedEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ConfigurationChanged
);
public
readonly
onDidChangeModel
:
Event
<
editorCommon
.
IModelChangedEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ModelChanged
);
public
readonly
onDidChangeCursorPosition
:
Event
<
editorCommon
.
ICursorPositionChangedEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
CursorPositionChanged
);
public
readonly
onDidChangeCursorSelection
:
Event
<
editorCommon
.
ICursorSelectionChangedEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
CursorSelectionChanged
);
public
readonly
onDidFocusEditorText
:
Event
<
void
>
=
fromEventEmitter
<
void
>
(
this
,
editorCommon
.
EventType
.
EditorTextFocus
);
public
readonly
onDidBlurEditorText
:
Event
<
void
>
=
fromEventEmitter
<
void
>
(
this
,
editorCommon
.
EventType
.
EditorTextBlur
);
public
readonly
onDidFocusEditor
:
Event
<
void
>
=
fromEventEmitter
<
void
>
(
this
,
editorCommon
.
EventType
.
EditorFocus
);
public
readonly
onDidBlurEditor
:
Event
<
void
>
=
fromEventEmitter
<
void
>
(
this
,
editorCommon
.
EventType
.
EditorBlur
);
public
readonly
onDidDispose
:
Event
<
void
>
=
fromEventEmitter
<
void
>
(
this
,
editorCommon
.
EventType
.
Disposed
);
protected
domElement
:
IContextKeyServiceTarget
;
...
...
src/vs/editor/contrib/quickFix/browser/lightBulbWidget.ts
浏览文件 @
7a8905a2
...
...
@@ -33,8 +33,8 @@ export class LightBulbWidget implements IOverlayWidget, IDisposable {
}
}));
this
.
_toDispose
.
push
(
any
<
any
>
(
this
.
_editor
.
onDidChangeConfiguration
.
bind
(
this
.
_editor
)
,
this
.
_editor
.
onDidChangeModelDecorations
.
bind
(
this
.
_editor
)
this
.
_editor
.
onDidChangeConfiguration
,
this
.
_editor
.
onDidChangeModelDecorations
)(()
=>
{
// hide when something has been added to glyph margin
if
(
this
.
_visible
&&
!
this
.
_hasSpaceInGlyphMargin
(
this
.
_position
.
lineNumber
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录