Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
81e71a4a
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,发现更多精彩内容 >>
未验证
提交
81e71a4a
编写于
5月 25, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename ViewOutgoingEvents to ViewUserInputEvents
上级
a8fe75f0
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
37 addition
and
43 deletion
+37
-43
src/vs/editor/browser/view/viewController.ts
src/vs/editor/browser/view/viewController.ts
+14
-14
src/vs/editor/browser/view/viewImpl.ts
src/vs/editor/browser/view/viewImpl.ts
+4
-8
src/vs/editor/browser/view/viewUserInputEvents.ts
src/vs/editor/browser/view/viewUserInputEvents.ts
+6
-8
src/vs/editor/browser/widget/codeEditorWidget.ts
src/vs/editor/browser/widget/codeEditorWidget.ts
+13
-13
未找到文件。
src/vs/editor/browser/view/viewController.ts
浏览文件 @
81e71a4a
...
...
@@ -6,7 +6,7 @@
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
CoreEditorCommand
,
CoreNavigationCommands
}
from
'
vs/editor/browser/controller/coreCommands
'
;
import
{
IEditorMouseEvent
,
IPartialEditorMouseEvent
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
View
OutgoingEvents
}
from
'
vs/editor/browser/view/viewOutgoing
Events
'
;
import
{
View
UserInputEvents
}
from
'
vs/editor/browser/view/viewUserInput
Events
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
IConfiguration
}
from
'
vs/editor/common/editorCommon
'
;
...
...
@@ -49,18 +49,18 @@ export class ViewController {
private
readonly
configuration
:
IConfiguration
;
private
readonly
viewModel
:
IViewModel
;
private
readonly
outgoingEvents
:
ViewOutgoing
Events
;
private
readonly
userInputEvents
:
ViewUserInput
Events
;
private
readonly
commandDelegate
:
ICommandDelegate
;
constructor
(
configuration
:
IConfiguration
,
viewModel
:
IViewModel
,
outgoingEvents
:
ViewOutgoing
Events
,
userInputEvents
:
ViewUserInput
Events
,
commandDelegate
:
ICommandDelegate
)
{
this
.
configuration
=
configuration
;
this
.
viewModel
=
viewModel
;
this
.
outgoingEvents
=
outgoing
Events
;
this
.
userInputEvents
=
userInput
Events
;
this
.
commandDelegate
=
commandDelegate
;
}
...
...
@@ -289,42 +289,42 @@ export class ViewController {
}
public
emitKeyDown
(
e
:
IKeyboardEvent
):
void
{
this
.
outgoing
Events
.
emitKeyDown
(
e
);
this
.
userInput
Events
.
emitKeyDown
(
e
);
}
public
emitKeyUp
(
e
:
IKeyboardEvent
):
void
{
this
.
outgoing
Events
.
emitKeyUp
(
e
);
this
.
userInput
Events
.
emitKeyUp
(
e
);
}
public
emitContextMenu
(
e
:
IEditorMouseEvent
):
void
{
this
.
outgoing
Events
.
emitContextMenu
(
e
);
this
.
userInput
Events
.
emitContextMenu
(
e
);
}
public
emitMouseMove
(
e
:
IEditorMouseEvent
):
void
{
this
.
outgoing
Events
.
emitMouseMove
(
e
);
this
.
userInput
Events
.
emitMouseMove
(
e
);
}
public
emitMouseLeave
(
e
:
IPartialEditorMouseEvent
):
void
{
this
.
outgoing
Events
.
emitMouseLeave
(
e
);
this
.
userInput
Events
.
emitMouseLeave
(
e
);
}
public
emitMouseUp
(
e
:
IEditorMouseEvent
):
void
{
this
.
outgoing
Events
.
emitMouseUp
(
e
);
this
.
userInput
Events
.
emitMouseUp
(
e
);
}
public
emitMouseDown
(
e
:
IEditorMouseEvent
):
void
{
this
.
outgoing
Events
.
emitMouseDown
(
e
);
this
.
userInput
Events
.
emitMouseDown
(
e
);
}
public
emitMouseDrag
(
e
:
IEditorMouseEvent
):
void
{
this
.
outgoing
Events
.
emitMouseDrag
(
e
);
this
.
userInput
Events
.
emitMouseDrag
(
e
);
}
public
emitMouseDrop
(
e
:
IPartialEditorMouseEvent
):
void
{
this
.
outgoing
Events
.
emitMouseDrop
(
e
);
this
.
userInput
Events
.
emitMouseDrop
(
e
);
}
public
emitMouseWheel
(
e
:
IMouseWheelEvent
):
void
{
this
.
outgoing
Events
.
emitMouseWheel
(
e
);
this
.
userInput
Events
.
emitMouseWheel
(
e
);
}
}
src/vs/editor/browser/view/viewImpl.ts
浏览文件 @
81e71a4a
...
...
@@ -14,7 +14,7 @@ import { PointerHandler } from 'vs/editor/browser/controller/pointerHandler';
import
{
ITextAreaHandlerHelper
,
TextAreaHandler
}
from
'
vs/editor/browser/controller/textAreaHandler
'
;
import
{
IContentWidget
,
IContentWidgetPosition
,
IOverlayWidget
,
IOverlayWidgetPosition
,
IMouseTarget
,
IViewZoneChangeAccessor
,
IEditorAriaOptions
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
ICommandDelegate
,
ViewController
}
from
'
vs/editor/browser/view/viewController
'
;
import
{
View
OutgoingEvents
}
from
'
vs/editor/browser/view/viewOutgoing
Events
'
;
import
{
View
UserInputEvents
}
from
'
vs/editor/browser/view/viewUserInput
Events
'
;
import
{
ContentViewOverlays
,
MarginViewOverlays
}
from
'
vs/editor/browser/view/viewOverlays
'
;
import
{
PartFingerprint
,
PartFingerprints
,
ViewPart
}
from
'
vs/editor/browser/view/viewPart
'
;
import
{
ViewContentWidgets
}
from
'
vs/editor/browser/viewParts/contentWidgets/contentWidgets
'
;
...
...
@@ -80,8 +80,6 @@ export class View extends ViewEventHandler {
private
readonly
_textAreaHandler
:
TextAreaHandler
;
private
readonly
pointerHandler
:
PointerHandler
;
private
readonly
outgoingEvents
:
ViewOutgoingEvents
;
// Dom nodes
private
linesContent
:
FastDomNode
<
HTMLElement
>
;
public
domNode
:
FastDomNode
<
HTMLElement
>
;
...
...
@@ -95,14 +93,13 @@ export class View extends ViewEventHandler {
configuration
:
IConfiguration
,
themeService
:
IThemeService
,
model
:
IViewModel
,
outgoingEvents
:
ViewOutgoing
Events
userInputEvents
:
ViewUserInput
Events
)
{
super
();
this
.
_selections
=
[
new
Selection
(
1
,
1
,
1
,
1
)];
this
.
_renderAnimationFrame
=
null
;
this
.
outgoingEvents
=
outgoingEvents
;
const
viewController
=
new
ViewController
(
configuration
,
model
,
this
.
outgoing
Events
,
commandDelegate
);
const
viewController
=
new
ViewController
(
configuration
,
model
,
userInput
Events
,
commandDelegate
);
// The view context is passed on to most classes (basically to reduce param. counts in ctors)
this
.
_context
=
new
ViewContext
(
configuration
,
themeService
.
getColorTheme
(),
model
);
...
...
@@ -321,7 +318,6 @@ export class View extends ViewEventHandler {
}
this
.
_context
.
removeEventHandler
(
this
);
this
.
outgoingEvents
.
dispose
();
this
.
viewLines
.
dispose
();
...
...
@@ -443,7 +439,7 @@ export class View extends ViewEventHandler {
if
(
!
mouseTarget
)
{
return
null
;
}
return
View
Outgoing
Events
.
convertViewToModelMouseTarget
(
mouseTarget
,
this
.
_context
.
model
.
coordinatesConverter
);
return
View
UserInput
Events
.
convertViewToModelMouseTarget
(
mouseTarget
,
this
.
_context
.
model
.
coordinatesConverter
);
}
public
createOverviewRuler
(
cssClassName
:
string
):
OverviewRuler
{
...
...
src/vs/editor/browser/view/view
Outgoing
Events.ts
→
src/vs/editor/browser/view/view
UserInput
Events.ts
浏览文件 @
81e71a4a
...
...
@@ -4,19 +4,18 @@
*--------------------------------------------------------------------------------------------*/
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
MouseTarget
}
from
'
vs/editor/browser/controller/mouseTarget
'
;
import
{
IEditorMouseEvent
,
IMouseTarget
,
IPartialEditorMouseEvent
,
MouseTargetType
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
I
ViewModel
,
I
CoordinatesConverter
}
from
'
vs/editor/common/viewModel/viewModel
'
;
import
{
ICoordinatesConverter
}
from
'
vs/editor/common/viewModel/viewModel
'
;
import
{
IMouseWheelEvent
}
from
'
vs/base/browser/mouseEvent
'
;
export
interface
EventCallback
<
T
>
{
(
event
:
T
):
void
;
}
export
class
View
OutgoingEvents
extends
Disposable
{
export
class
View
UserInputEvents
{
public
onKeyDown
:
EventCallback
<
IKeyboardEvent
>
|
null
=
null
;
public
onKeyUp
:
EventCallback
<
IKeyboardEvent
>
|
null
=
null
;
...
...
@@ -29,11 +28,10 @@ export class ViewOutgoingEvents extends Disposable {
public
onMouseDrop
:
EventCallback
<
IPartialEditorMouseEvent
>
|
null
=
null
;
public
onMouseWheel
:
EventCallback
<
IMouseWheelEvent
>
|
null
=
null
;
private
readonly
_
viewModel
:
IViewModel
;
private
readonly
_
coordinatesConverter
:
ICoordinatesConverter
;
constructor
(
viewModel
:
IViewModel
)
{
super
();
this
.
_viewModel
=
viewModel
;
constructor
(
coordinatesConverter
:
ICoordinatesConverter
)
{
this
.
_coordinatesConverter
=
coordinatesConverter
;
}
public
emitKeyDown
(
e
:
IKeyboardEvent
):
void
{
...
...
@@ -109,7 +107,7 @@ export class ViewOutgoingEvents extends Disposable {
}
private
_convertViewToModelMouseTarget
(
target
:
IMouseTarget
):
IMouseTarget
{
return
View
OutgoingEvents
.
convertViewToModelMouseTarget
(
target
,
this
.
_viewModel
.
coordinatesConverter
);
return
View
UserInputEvents
.
convertViewToModelMouseTarget
(
target
,
this
.
_
coordinatesConverter
);
}
public
static
convertViewToModelMouseTarget
(
target
:
IMouseTarget
,
coordinatesConverter
:
ICoordinatesConverter
):
IMouseTarget
{
...
...
src/vs/editor/browser/widget/codeEditorWidget.ts
浏览文件 @
81e71a4a
...
...
@@ -21,7 +21,7 @@ import { EditorExtensionsRegistry, IEditorContributionDescription } from 'vs/edi
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
ICommandDelegate
}
from
'
vs/editor/browser/view/viewController
'
;
import
{
IContentWidgetData
,
IOverlayWidgetData
,
View
}
from
'
vs/editor/browser/view/viewImpl
'
;
import
{
View
OutgoingEvents
}
from
'
vs/editor/browser/view/viewOutgoing
Events
'
;
import
{
View
UserInputEvents
}
from
'
vs/editor/browser/view/viewUserInput
Events
'
;
import
{
ConfigurationChangedEvent
,
EditorLayoutInfo
,
IEditorOptions
,
EditorOption
,
IComputedEditorOptions
,
FindComputedEditorOptionValueById
,
IEditorConstructionOptions
,
filterValidationDecorations
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
Cursor
}
from
'
vs/editor/common/controller/cursor
'
;
import
{
CursorColumns
}
from
'
vs/editor/common/controller/cursorCommon
'
;
...
...
@@ -1604,24 +1604,24 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
};
}
const
view
OutgoingEvents
=
new
ViewOutgoingEvents
(
viewModel
);
view
Outgoing
Events
.
onKeyDown
=
(
e
)
=>
this
.
_onKeyDown
.
fire
(
e
);
view
Outgoing
Events
.
onKeyUp
=
(
e
)
=>
this
.
_onKeyUp
.
fire
(
e
);
view
Outgoing
Events
.
onContextMenu
=
(
e
)
=>
this
.
_onContextMenu
.
fire
(
e
);
view
Outgoing
Events
.
onMouseMove
=
(
e
)
=>
this
.
_onMouseMove
.
fire
(
e
);
view
Outgoing
Events
.
onMouseLeave
=
(
e
)
=>
this
.
_onMouseLeave
.
fire
(
e
);
view
Outgoing
Events
.
onMouseDown
=
(
e
)
=>
this
.
_onMouseDown
.
fire
(
e
);
view
Outgoing
Events
.
onMouseUp
=
(
e
)
=>
this
.
_onMouseUp
.
fire
(
e
);
view
Outgoing
Events
.
onMouseDrag
=
(
e
)
=>
this
.
_onMouseDrag
.
fire
(
e
);
view
Outgoing
Events
.
onMouseDrop
=
(
e
)
=>
this
.
_onMouseDrop
.
fire
(
e
);
view
Outgoing
Events
.
onMouseWheel
=
(
e
)
=>
this
.
_onMouseWheel
.
fire
(
e
);
const
view
UserInputEvents
=
new
ViewUserInputEvents
(
viewModel
.
coordinatesConverter
);
view
UserInput
Events
.
onKeyDown
=
(
e
)
=>
this
.
_onKeyDown
.
fire
(
e
);
view
UserInput
Events
.
onKeyUp
=
(
e
)
=>
this
.
_onKeyUp
.
fire
(
e
);
view
UserInput
Events
.
onContextMenu
=
(
e
)
=>
this
.
_onContextMenu
.
fire
(
e
);
view
UserInput
Events
.
onMouseMove
=
(
e
)
=>
this
.
_onMouseMove
.
fire
(
e
);
view
UserInput
Events
.
onMouseLeave
=
(
e
)
=>
this
.
_onMouseLeave
.
fire
(
e
);
view
UserInput
Events
.
onMouseDown
=
(
e
)
=>
this
.
_onMouseDown
.
fire
(
e
);
view
UserInput
Events
.
onMouseUp
=
(
e
)
=>
this
.
_onMouseUp
.
fire
(
e
);
view
UserInput
Events
.
onMouseDrag
=
(
e
)
=>
this
.
_onMouseDrag
.
fire
(
e
);
view
UserInput
Events
.
onMouseDrop
=
(
e
)
=>
this
.
_onMouseDrop
.
fire
(
e
);
view
UserInput
Events
.
onMouseWheel
=
(
e
)
=>
this
.
_onMouseWheel
.
fire
(
e
);
const
view
=
new
View
(
commandDelegate
,
this
.
_configuration
,
this
.
_themeService
,
viewModel
,
view
Outgoing
Events
view
UserInput
Events
);
return
[
view
,
true
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录