Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
1ec1b9fe
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,发现更多精彩内容 >>
提交
1ec1b9fe
编写于
8月 07, 2019
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More fixes for #78168
上级
c250eb75
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
50 addition
and
53 deletion
+50
-53
src/vs/base/browser/dom.ts
src/vs/base/browser/dom.ts
+2
-2
src/vs/base/test/common/utils.ts
src/vs/base/test/common/utils.ts
+2
-2
src/vs/editor/browser/widget/diffEditorWidget.ts
src/vs/editor/browser/widget/diffEditorWidget.ts
+39
-24
src/vs/editor/contrib/find/findWidget.ts
src/vs/editor/contrib/find/findWidget.ts
+1
-19
src/vs/editor/contrib/folding/folding.ts
src/vs/editor/contrib/folding/folding.ts
+1
-2
src/vs/editor/contrib/hover/hover.ts
src/vs/editor/contrib/hover/hover.ts
+4
-4
src/vs/editor/contrib/hover/hoverWidgets.ts
src/vs/editor/contrib/hover/hoverWidgets.ts
+1
-0
未找到文件。
src/vs/base/browser/dom.ts
浏览文件 @
1ec1b9fe
...
...
@@ -50,8 +50,8 @@ interface IDomClassList {
const
_manualClassList
=
new
class
implements
IDomClassList
{
private
_lastStart
:
number
;
private
_lastEnd
:
number
;
private
_lastStart
:
number
=
-
1
;
private
_lastEnd
:
number
=
-
1
;
private
_findClassName
(
node
:
HTMLElement
,
className
:
string
):
void
{
...
...
src/vs/base/test/common/utils.ts
浏览文件 @
1ec1b9fe
...
...
@@ -12,8 +12,8 @@ export type ValueCallback<T = any> = (value: T | Promise<T>) => void;
export
class
DeferredPromise
<
T
>
{
private
completeCallback
:
ValueCallback
<
T
>
;
private
errorCallback
:
(
err
:
any
)
=>
void
;
private
completeCallback
!
:
ValueCallback
<
T
>
;
private
errorCallback
!
:
(
err
:
any
)
=>
void
;
public
p
:
Promise
<
any
>
;
...
...
src/vs/editor/browser/widget/diffEditorWidget.ts
浏览文件 @
1ec1b9fe
...
...
@@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
FastDomNode
,
createFastDomNode
}
from
'
vs/base/browser/fastDomNode
'
;
import
{
ISashEvent
,
IVerticalSashLayoutProvider
,
Sash
,
SashState
}
from
'
vs/base/browser/ui/sash/sash
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
RunOnceScheduler
,
IntervalTimer
}
from
'
vs/base/common/async
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -156,17 +156,17 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
private
_width
:
number
;
private
_height
:
number
;
private
_reviewHeight
:
number
;
private
readonly
_measureDomElementToken
:
number
;
private
readonly
_measureDomElementToken
:
IntervalTimer
|
null
;
private
originalEditor
:
CodeEditorWidget
;
private
readonly
originalEditor
:
CodeEditorWidget
;
private
readonly
_originalDomNode
:
HTMLElement
;
private
readonly
_originalEditorState
:
VisualEditorState
;
private
_originalOverviewRuler
:
editorBrowser
.
IOverviewRuler
;
private
_originalOverviewRuler
:
editorBrowser
.
IOverviewRuler
|
null
;
private
modifiedEditor
:
CodeEditorWidget
;
private
readonly
modifiedEditor
:
CodeEditorWidget
;
private
readonly
_modifiedDomNode
:
HTMLElement
;
private
readonly
_modifiedEditorState
:
VisualEditorState
;
private
_modifiedOverviewRuler
:
editorBrowser
.
IOverviewRuler
;
private
_modifiedOverviewRuler
:
editorBrowser
.
IOverviewRuler
|
null
;
private
_currentlyChangingViewZones
:
boolean
;
private
_beginUpdateDecorationsTimeout
:
number
;
...
...
@@ -182,7 +182,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
private
_renderSideBySide
:
boolean
;
private
_renderIndicators
:
boolean
;
private
_enableSplitViewResizing
:
boolean
;
private
_strategy
:
IDiffEditorWidgetStyle
;
private
_strategy
!
:
IDiffEditorWidgetStyle
;
private
readonly
_updateDecorationsRunner
:
RunOnceScheduler
;
...
...
@@ -308,8 +308,11 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
rightServices
.
set
(
IContextKeyService
,
rightContextKeyService
);
const
rightScopedInstantiationService
=
instantiationService
.
createChild
(
rightServices
);
this
.
_createLeftHandSideEditor
(
options
,
leftScopedInstantiationService
);
this
.
_createRightHandSideEditor
(
options
,
rightScopedInstantiationService
);
this
.
originalEditor
=
this
.
_createLeftHandSideEditor
(
options
,
leftScopedInstantiationService
);
this
.
modifiedEditor
=
this
.
_createRightHandSideEditor
(
options
,
rightScopedInstantiationService
);
this
.
_originalOverviewRuler
=
null
;
this
.
_modifiedOverviewRuler
=
null
;
this
.
_reviewPane
=
new
DiffReview
(
this
);
this
.
_containerDomElement
.
appendChild
(
this
.
_reviewPane
.
domNode
.
domNode
);
...
...
@@ -317,7 +320,10 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this
.
_containerDomElement
.
appendChild
(
this
.
_reviewPane
.
actionBarContainer
.
domNode
);
if
(
options
.
automaticLayout
)
{
this
.
_measureDomElementToken
=
window
.
setInterval
(()
=>
this
.
_measureDomElement
(
false
),
100
);
this
.
_measureDomElementToken
=
new
IntervalTimer
();
this
.
_measureDomElementToken
.
cancelAndSet
(()
=>
this
.
_measureDomElement
(
false
),
100
);
}
else
{
this
.
_measureDomElementToken
=
null
;
}
// enableSplitViewResizing
...
...
@@ -397,10 +403,10 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this
.
_layoutOverviewRulers
();
}
private
_createLeftHandSideEditor
(
options
:
editorOptions
.
IDiffEditorOptions
,
instantiationService
:
IInstantiationService
):
void
{
this
.
originalE
ditor
=
this
.
_createInnerEditor
(
instantiationService
,
this
.
_originalDomNode
,
this
.
_adjustOptionsForLeftHandSide
(
options
,
this
.
_originalIsEditable
));
private
_createLeftHandSideEditor
(
options
:
editorOptions
.
IDiffEditorOptions
,
instantiationService
:
IInstantiationService
):
CodeEditorWidget
{
const
e
ditor
=
this
.
_createInnerEditor
(
instantiationService
,
this
.
_originalDomNode
,
this
.
_adjustOptionsForLeftHandSide
(
options
,
this
.
_originalIsEditable
));
this
.
_register
(
this
.
originalE
ditor
.
onDidScrollChange
((
e
)
=>
{
this
.
_register
(
e
ditor
.
onDidScrollChange
((
e
)
=>
{
if
(
this
.
_isHandlingScrollEvent
)
{
return
;
}
...
...
@@ -417,21 +423,23 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this
.
_layoutOverviewViewport
();
}));
this
.
_register
(
this
.
originalE
ditor
.
onDidChangeViewZones
(()
=>
{
this
.
_register
(
e
ditor
.
onDidChangeViewZones
(()
=>
{
this
.
_onViewZonesChanged
();
}));
this
.
_register
(
this
.
originalE
ditor
.
onDidChangeModelContent
(()
=>
{
this
.
_register
(
e
ditor
.
onDidChangeModelContent
(()
=>
{
if
(
this
.
_isVisible
)
{
this
.
_beginUpdateDecorationsSoon
();
}
}));
return
editor
;
}
private
_createRightHandSideEditor
(
options
:
editorOptions
.
IDiffEditorOptions
,
instantiationService
:
IInstantiationService
):
void
{
this
.
modifiedE
ditor
=
this
.
_createInnerEditor
(
instantiationService
,
this
.
_modifiedDomNode
,
this
.
_adjustOptionsForRightHandSide
(
options
));
private
_createRightHandSideEditor
(
options
:
editorOptions
.
IDiffEditorOptions
,
instantiationService
:
IInstantiationService
):
CodeEditorWidget
{
const
e
ditor
=
this
.
_createInnerEditor
(
instantiationService
,
this
.
_modifiedDomNode
,
this
.
_adjustOptionsForRightHandSide
(
options
));
this
.
_register
(
this
.
modifiedE
ditor
.
onDidScrollChange
((
e
)
=>
{
this
.
_register
(
e
ditor
.
onDidScrollChange
((
e
)
=>
{
if
(
this
.
_isHandlingScrollEvent
)
{
return
;
}
...
...
@@ -448,21 +456,23 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this
.
_layoutOverviewViewport
();
}));
this
.
_register
(
this
.
modifiedE
ditor
.
onDidChangeViewZones
(()
=>
{
this
.
_register
(
e
ditor
.
onDidChangeViewZones
(()
=>
{
this
.
_onViewZonesChanged
();
}));
this
.
_register
(
this
.
modifiedE
ditor
.
onDidChangeConfiguration
((
e
)
=>
{
if
(
e
.
fontInfo
&&
this
.
modifiedE
ditor
.
getModel
())
{
this
.
_register
(
e
ditor
.
onDidChangeConfiguration
((
e
)
=>
{
if
(
e
.
fontInfo
&&
e
ditor
.
getModel
())
{
this
.
_onViewZonesChanged
();
}
}));
this
.
_register
(
this
.
modifiedE
ditor
.
onDidChangeModelContent
(()
=>
{
this
.
_register
(
e
ditor
.
onDidChangeModelContent
(()
=>
{
if
(
this
.
_isVisible
)
{
this
.
_beginUpdateDecorationsSoon
();
}
}));
return
editor
;
}
protected
_createInnerEditor
(
instantiationService
:
IInstantiationService
,
container
:
HTMLElement
,
options
:
editorOptions
.
IEditorOptions
):
CodeEditorWidget
{
...
...
@@ -477,7 +487,9 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this
.
_beginUpdateDecorationsTimeout
=
-
1
;
}
window
.
clearInterval
(
this
.
_measureDomElementToken
);
if
(
this
.
_measureDomElementToken
)
{
this
.
_measureDomElementToken
.
dispose
();
}
this
.
_cleanViewZonesAndDecorations
();
...
...
@@ -813,6 +825,9 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
}
private
_layoutOverviewRulers
():
void
{
if
(
!
this
.
_originalOverviewRuler
||
!
this
.
_modifiedOverviewRuler
)
{
return
;
}
let
freeSpace
=
DiffEditorWidget
.
ENTIRE_DIFF_OVERVIEW_WIDTH
-
2
*
DiffEditorWidget
.
ONE_OVERVIEW_WIDTH
;
let
layoutInfo
=
this
.
modifiedEditor
.
getLayoutInfo
();
if
(
layoutInfo
)
{
...
...
@@ -914,7 +929,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
}
private
_updateDecorations
():
void
{
if
(
!
this
.
originalEditor
.
getModel
()
||
!
this
.
modifiedEditor
.
getModel
())
{
if
(
!
this
.
originalEditor
.
getModel
()
||
!
this
.
modifiedEditor
.
getModel
()
||
!
this
.
_originalOverviewRuler
||
!
this
.
_modifiedOverviewRuler
)
{
return
;
}
const
lineChanges
=
(
this
.
_diffComputationResult
?
this
.
_diffComputationResult
.
changes
:
[]);
...
...
src/vs/editor/contrib/find/findWidget.ts
浏览文件 @
1ec1b9fe
...
...
@@ -784,7 +784,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
return
` (
${
kb
.
getLabel
()}
)`
;
}
private
_build
FindPart
():
HTMLElement
{
private
_build
DomNode
():
void
{
// Find input
this
.
_findInput
=
this
.
_register
(
new
ContextScopedFindInput
(
null
,
this
.
_contextViewProvider
,
{
width
:
FIND_INPUT_AREA_WIDTH
,
...
...
@@ -908,10 +908,6 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
findPart
.
appendChild
(
this
.
_closeBtn
.
domNode
);
return
findPart
;
}
private
_buildReplacePart
():
HTMLElement
{
// Replace input
let
replaceInput
=
document
.
createElement
(
'
div
'
);
replaceInput
.
className
=
'
replace-input
'
;
...
...
@@ -977,16 +973,6 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
replacePart
.
appendChild
(
this
.
_replaceBtn
.
domNode
);
replacePart
.
appendChild
(
this
.
_replaceAllBtn
.
domNode
);
return
replacePart
;
}
private
_buildDomNode
():
void
{
// Find part
let
findPart
=
this
.
_buildFindPart
();
// Replace part
let
replacePart
=
this
.
_buildReplacePart
();
// Toggle replace button
this
.
_toggleReplaceBtn
=
this
.
_register
(
new
SimpleButton
({
label
:
NLS_TOGGLE_REPLACE_MODE_BTN_LABEL
,
...
...
@@ -1014,10 +1000,6 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
this
.
_domNode
.
appendChild
(
findPart
);
this
.
_domNode
.
appendChild
(
replacePart
);
this
.
_buildSash
();
}
private
_buildSash
()
{
this
.
_resizeSash
=
new
Sash
(
this
.
_domNode
,
this
,
{
orientation
:
Orientation
.
VERTICAL
});
this
.
_resized
=
false
;
let
originalWidth
=
FIND_WIDGET_INITIAL_WIDTH
;
...
...
src/vs/editor/contrib/folding/folding.ts
浏览文件 @
1ec1b9fe
...
...
@@ -79,6 +79,7 @@ export class FoldingController extends Disposable implements IEditorContribution
private
cursorChangedScheduler
:
RunOnceScheduler
|
null
;
private
readonly
localToDispose
=
this
.
_register
(
new
DisposableStore
());
private
mouseDownInfo
:
{
lineNumber
:
number
,
iconClicked
:
boolean
}
|
null
;
constructor
(
editor
:
ICodeEditor
,
...
...
@@ -340,8 +341,6 @@ export class FoldingController extends Disposable implements IEditorContribution
}
private
mouseDownInfo
:
{
lineNumber
:
number
,
iconClicked
:
boolean
}
|
null
;
private
onEditorMouseDown
(
e
:
IEditorMouseEvent
):
void
{
this
.
mouseDownInfo
=
null
;
...
...
src/vs/editor/contrib/hover/hover.ts
浏览文件 @
1ec1b9fe
...
...
@@ -39,14 +39,14 @@ export class ModesHoverController implements IEditorContribution {
get
contentWidget
():
ModesContentHoverWidget
{
if
(
!
this
.
_contentWidget
)
{
this
.
_createHoverWidget
();
this
.
_createHoverWidget
s
();
}
return
this
.
_contentWidget
!
;
}
get
glyphWidget
():
ModesGlyphHoverWidget
{
if
(
!
this
.
_glyphWidget
)
{
this
.
_createHoverWidget
();
this
.
_createHoverWidget
s
();
}
return
this
.
_glyphWidget
!
;
}
...
...
@@ -198,7 +198,7 @@ export class ModesHoverController implements IEditorContribution {
}
private
_hideWidgets
():
void
{
if
(
!
this
.
_contentWidget
||
(
this
.
_isMouseDown
&&
this
.
_hoverClicked
&&
this
.
_contentWidget
.
isColorPickerVisible
()))
{
if
(
!
this
.
_
glyphWidget
||
!
this
.
_
contentWidget
||
(
this
.
_isMouseDown
&&
this
.
_hoverClicked
&&
this
.
_contentWidget
.
isColorPickerVisible
()))
{
return
;
}
...
...
@@ -206,7 +206,7 @@ export class ModesHoverController implements IEditorContribution {
this
.
_contentWidget
.
hide
();
}
private
_createHoverWidget
()
{
private
_createHoverWidget
s
()
{
this
.
_contentWidget
=
new
ModesContentHoverWidget
(
this
.
_editor
,
this
.
_markerDecorationsService
,
this
.
_themeService
,
this
.
_keybindingService
,
this
.
_modeService
,
this
.
_openerService
);
this
.
_glyphWidget
=
new
ModesGlyphHoverWidget
(
this
.
_editor
,
this
.
_modeService
,
this
.
_openerService
);
}
...
...
src/vs/editor/contrib/hover/hoverWidgets.ts
浏览文件 @
1ec1b9fe
...
...
@@ -73,6 +73,7 @@ export class ContentHoverWidget extends Widget implements editorBrowser.IContent
this
.
_editor
.
addContentWidget
(
this
);
this
.
_showAtPosition
=
null
;
this
.
_showAtRange
=
null
;
this
.
_stoleFocus
=
false
;
}
public
getId
():
string
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录