Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
80257234
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,发现更多精彩内容 >>
未验证
提交
80257234
编写于
7月 09, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #101956
上级
a6eccc39
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
95 addition
and
30 deletion
+95
-30
src/vs/workbench/api/browser/mainThreadDocuments.ts
src/vs/workbench/api/browser/mainThreadDocuments.ts
+57
-21
src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts
...vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts
+4
-3
src/vs/workbench/api/browser/mainThreadEditor.ts
src/vs/workbench/api/browser/mainThreadEditor.ts
+34
-6
未找到文件。
src/vs/workbench/api/browser/mainThreadDocuments.ts
浏览文件 @
80257234
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
import
{
toErrorMessage
}
from
'
vs/base/common/errorMessage
'
;
import
{
toErrorMessage
}
from
'
vs/base/common/errorMessage
'
;
import
{
I
Disposable
,
IReference
,
dispose
,
DisposableStor
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
I
Reference
,
dispose
,
Disposabl
e
}
from
'
vs/base/common/lifecycle
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
ITextModel
}
from
'
vs/editor/common/model
'
;
import
{
ITextModel
}
from
'
vs/editor/common/model
'
;
...
@@ -19,6 +19,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
...
@@ -19,6 +19,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
import
{
toLocalResource
,
extUri
,
IExtUri
}
from
'
vs/base/common/resources
'
;
import
{
toLocalResource
,
extUri
,
IExtUri
}
from
'
vs/base/common/resources
'
;
import
{
IWorkingCopyFileService
}
from
'
vs/workbench/services/workingCopy/common/workingCopyFileService
'
;
import
{
IWorkingCopyFileService
}
from
'
vs/workbench/services/workingCopy/common/workingCopyFileService
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
export
class
BoundModelReferenceCollection
{
export
class
BoundModelReferenceCollection
{
...
@@ -73,7 +74,36 @@ export class BoundModelReferenceCollection {
...
@@ -73,7 +74,36 @@ export class BoundModelReferenceCollection {
}
}
}
}
export
class
MainThreadDocuments
implements
MainThreadDocumentsShape
{
class
ModelTracker
extends
Disposable
{
private
_knownVersionId
:
number
;
constructor
(
private
readonly
_model
:
ITextModel
,
private
readonly
_onIsCaughtUpWithContentChanges
:
Emitter
<
URI
>
,
private
readonly
_proxy
:
ExtHostDocumentsShape
,
private
readonly
_textFileService
:
ITextFileService
,
)
{
super
();
this
.
_knownVersionId
=
this
.
_model
.
getVersionId
();
this
.
_register
(
this
.
_model
.
onDidChangeContent
((
e
)
=>
{
this
.
_knownVersionId
=
e
.
versionId
;
this
.
_proxy
.
$acceptModelChanged
(
this
.
_model
.
uri
,
e
,
this
.
_textFileService
.
isDirty
(
this
.
_model
.
uri
));
if
(
this
.
isCaughtUpWithContentChanges
())
{
this
.
_onIsCaughtUpWithContentChanges
.
fire
(
this
.
_model
.
uri
);
}
}));
}
public
isCaughtUpWithContentChanges
():
boolean
{
return
(
this
.
_model
.
getVersionId
()
===
this
.
_knownVersionId
);
}
}
export
class
MainThreadDocuments
extends
Disposable
implements
MainThreadDocumentsShape
{
private
_onIsCaughtUpWithContentChanges
=
this
.
_register
(
new
Emitter
<
URI
>
());
public
readonly
onIsCaughtUpWithContentChanges
=
this
.
_onIsCaughtUpWithContentChanges
.
event
;
private
readonly
_modelService
:
IModelService
;
private
readonly
_modelService
:
IModelService
;
private
readonly
_textModelResolverService
:
ITextModelService
;
private
readonly
_textModelResolverService
:
ITextModelService
;
...
@@ -82,8 +112,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
...
@@ -82,8 +112,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
private
readonly
_environmentService
:
IWorkbenchEnvironmentService
;
private
readonly
_environmentService
:
IWorkbenchEnvironmentService
;
private
readonly
_uriIdentityService
:
IUriIdentityService
;
private
readonly
_uriIdentityService
:
IUriIdentityService
;
private
readonly
_toDispose
=
new
DisposableStore
();
private
_modelTrackers
:
{
[
modelUrl
:
string
]:
ModelTracker
;
};
private
_modelToDisposeMap
:
{
[
modelUrl
:
string
]:
IDisposable
;
};
private
readonly
_proxy
:
ExtHostDocumentsShape
;
private
readonly
_proxy
:
ExtHostDocumentsShape
;
private
readonly
_modelIsSynced
=
new
Set
<
string
>
();
private
readonly
_modelIsSynced
=
new
Set
<
string
>
();
private
readonly
_modelReferenceCollection
:
BoundModelReferenceCollection
;
private
readonly
_modelReferenceCollection
:
BoundModelReferenceCollection
;
...
@@ -99,6 +128,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
...
@@ -99,6 +128,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
@
IUriIdentityService
uriIdentityService
:
IUriIdentityService
,
@
IUriIdentityService
uriIdentityService
:
IUriIdentityService
,
@
IWorkingCopyFileService
workingCopyFileService
:
IWorkingCopyFileService
@
IWorkingCopyFileService
workingCopyFileService
:
IWorkingCopyFileService
)
{
)
{
super
();
this
.
_modelService
=
modelService
;
this
.
_modelService
=
modelService
;
this
.
_textModelResolverService
=
textModelResolverService
;
this
.
_textModelResolverService
=
textModelResolverService
;
this
.
_textFileService
=
textFileService
;
this
.
_textFileService
=
textFileService
;
...
@@ -106,26 +136,26 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
...
@@ -106,26 +136,26 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
this
.
_environmentService
=
environmentService
;
this
.
_environmentService
=
environmentService
;
this
.
_uriIdentityService
=
uriIdentityService
;
this
.
_uriIdentityService
=
uriIdentityService
;
this
.
_modelReferenceCollection
=
this
.
_
toDispose
.
add
(
new
BoundModelReferenceCollection
(
uriIdentityService
.
extUri
));
this
.
_modelReferenceCollection
=
this
.
_
register
(
new
BoundModelReferenceCollection
(
uriIdentityService
.
extUri
));
this
.
_proxy
=
extHostContext
.
getProxy
(
ExtHostContext
.
ExtHostDocuments
);
this
.
_proxy
=
extHostContext
.
getProxy
(
ExtHostContext
.
ExtHostDocuments
);
this
.
_
toDispose
.
add
(
documentsAndEditors
.
onDocumentAdd
(
models
=>
models
.
forEach
(
this
.
_onModelAdded
,
this
)));
this
.
_
register
(
documentsAndEditors
.
onDocumentAdd
(
models
=>
models
.
forEach
(
this
.
_onModelAdded
,
this
)));
this
.
_
toDispose
.
add
(
documentsAndEditors
.
onDocumentRemove
(
urls
=>
urls
.
forEach
(
this
.
_onModelRemoved
,
this
)));
this
.
_
register
(
documentsAndEditors
.
onDocumentRemove
(
urls
=>
urls
.
forEach
(
this
.
_onModelRemoved
,
this
)));
this
.
_
toDispose
.
add
(
modelService
.
onModelModeChanged
(
this
.
_onModelModeChanged
,
this
));
this
.
_
register
(
modelService
.
onModelModeChanged
(
this
.
_onModelModeChanged
,
this
));
this
.
_
toDispose
.
add
(
textFileService
.
files
.
onDidSave
(
e
=>
{
this
.
_
register
(
textFileService
.
files
.
onDidSave
(
e
=>
{
if
(
this
.
_shouldHandleFileEvent
(
e
.
model
.
resource
))
{
if
(
this
.
_shouldHandleFileEvent
(
e
.
model
.
resource
))
{
this
.
_proxy
.
$acceptModelSaved
(
e
.
model
.
resource
);
this
.
_proxy
.
$acceptModelSaved
(
e
.
model
.
resource
);
}
}
}));
}));
this
.
_
toDispose
.
add
(
textFileService
.
files
.
onDidChangeDirty
(
m
=>
{
this
.
_
register
(
textFileService
.
files
.
onDidChangeDirty
(
m
=>
{
if
(
this
.
_shouldHandleFileEvent
(
m
.
resource
))
{
if
(
this
.
_shouldHandleFileEvent
(
m
.
resource
))
{
this
.
_proxy
.
$acceptDirtyStateChanged
(
m
.
resource
,
m
.
isDirty
());
this
.
_proxy
.
$acceptDirtyStateChanged
(
m
.
resource
,
m
.
isDirty
());
}
}
}));
}));
this
.
_
toDispose
.
add
(
workingCopyFileService
.
onDidRunWorkingCopyFileOperation
(
e
=>
{
this
.
_
register
(
workingCopyFileService
.
onDidRunWorkingCopyFileOperation
(
e
=>
{
if
(
e
.
operation
===
FileOperation
.
MOVE
||
e
.
operation
===
FileOperation
.
DELETE
)
{
if
(
e
.
operation
===
FileOperation
.
MOVE
||
e
.
operation
===
FileOperation
.
DELETE
)
{
for
(
const
{
source
}
of
e
.
files
)
{
for
(
const
{
source
}
of
e
.
files
)
{
if
(
source
)
{
if
(
source
)
{
...
@@ -135,15 +165,23 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
...
@@ -135,15 +165,23 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
}
}
}));
}));
this
.
_modelT
oDisposeMap
=
Object
.
create
(
null
);
this
.
_modelT
rackers
=
Object
.
create
(
null
);
}
}
public
dispose
():
void
{
public
dispose
():
void
{
Object
.
keys
(
this
.
_modelT
oDisposeMap
).
forEach
((
modelUrl
)
=>
{
Object
.
keys
(
this
.
_modelT
rackers
).
forEach
((
modelUrl
)
=>
{
this
.
_modelT
oDisposeMap
[
modelUrl
].
dispose
();
this
.
_modelT
rackers
[
modelUrl
].
dispose
();
});
});
this
.
_modelToDisposeMap
=
Object
.
create
(
null
);
this
.
_modelTrackers
=
Object
.
create
(
null
);
this
.
_toDispose
.
dispose
();
super
.
dispose
();
}
public
isCaughtUpWithContentChanges
(
resource
:
URI
):
boolean
{
const
modelUrl
=
resource
.
toString
();
if
(
this
.
_modelTrackers
[
modelUrl
])
{
return
this
.
_modelTrackers
[
modelUrl
].
isCaughtUpWithContentChanges
();
}
return
true
;
}
}
private
_shouldHandleFileEvent
(
resource
:
URI
):
boolean
{
private
_shouldHandleFileEvent
(
resource
:
URI
):
boolean
{
...
@@ -159,9 +197,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
...
@@ -159,9 +197,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
}
}
const
modelUrl
=
model
.
uri
;
const
modelUrl
=
model
.
uri
;
this
.
_modelIsSynced
.
add
(
modelUrl
.
toString
());
this
.
_modelIsSynced
.
add
(
modelUrl
.
toString
());
this
.
_modelToDisposeMap
[
modelUrl
.
toString
()]
=
model
.
onDidChangeContent
((
e
)
=>
{
this
.
_modelTrackers
[
modelUrl
.
toString
()]
=
new
ModelTracker
(
model
,
this
.
_onIsCaughtUpWithContentChanges
,
this
.
_proxy
,
this
.
_textFileService
);
this
.
_proxy
.
$acceptModelChanged
(
modelUrl
,
e
,
this
.
_textFileService
.
isDirty
(
modelUrl
));
});
}
}
private
_onModelModeChanged
(
event
:
{
model
:
ITextModel
;
oldModeId
:
string
;
}):
void
{
private
_onModelModeChanged
(
event
:
{
model
:
ITextModel
;
oldModeId
:
string
;
}):
void
{
...
@@ -179,8 +215,8 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
...
@@ -179,8 +215,8 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
return
;
return
;
}
}
this
.
_modelIsSynced
.
delete
(
strModelUrl
);
this
.
_modelIsSynced
.
delete
(
strModelUrl
);
this
.
_modelT
oDisposeMap
[
strModelUrl
].
dispose
();
this
.
_modelT
rackers
[
strModelUrl
].
dispose
();
delete
this
.
_modelT
oDisposeMap
[
strModelUrl
];
delete
this
.
_modelT
rackers
[
strModelUrl
];
}
}
// --- from extension host process
// --- from extension host process
...
...
src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts
浏览文件 @
80257234
...
@@ -306,6 +306,7 @@ export class MainThreadDocumentsAndEditors {
...
@@ -306,6 +306,7 @@ export class MainThreadDocumentsAndEditors {
private
readonly
_toDispose
=
new
DisposableStore
();
private
readonly
_toDispose
=
new
DisposableStore
();
private
readonly
_proxy
:
ExtHostDocumentsAndEditorsShape
;
private
readonly
_proxy
:
ExtHostDocumentsAndEditorsShape
;
private
readonly
_mainThreadDocuments
:
MainThreadDocuments
;
private
readonly
_textEditors
=
new
Map
<
string
,
MainThreadTextEditor
>
();
private
readonly
_textEditors
=
new
Map
<
string
,
MainThreadTextEditor
>
();
private
readonly
_onTextEditorAdd
=
new
Emitter
<
MainThreadTextEditor
[]
>
();
private
readonly
_onTextEditorAdd
=
new
Emitter
<
MainThreadTextEditor
[]
>
();
...
@@ -336,8 +337,8 @@ export class MainThreadDocumentsAndEditors {
...
@@ -336,8 +337,8 @@ export class MainThreadDocumentsAndEditors {
)
{
)
{
this
.
_proxy
=
extHostContext
.
getProxy
(
ExtHostContext
.
ExtHostDocumentsAndEditors
);
this
.
_proxy
=
extHostContext
.
getProxy
(
ExtHostContext
.
ExtHostDocumentsAndEditors
);
const
mainThreadDocuments
=
this
.
_toDispose
.
add
(
new
MainThreadDocuments
(
this
,
extHostContext
,
this
.
_modelService
,
this
.
_textFileService
,
fileService
,
textModelResolverService
,
environmentService
,
uriIdentityService
,
workingCopyFileService
));
this
.
_
mainThreadDocuments
=
this
.
_toDispose
.
add
(
new
MainThreadDocuments
(
this
,
extHostContext
,
this
.
_modelService
,
this
.
_textFileService
,
fileService
,
textModelResolverService
,
environmentService
,
uriIdentityService
,
workingCopyFileService
));
extHostContext
.
set
(
MainContext
.
MainThreadDocuments
,
mainThreadDocuments
);
extHostContext
.
set
(
MainContext
.
MainThreadDocuments
,
this
.
_
mainThreadDocuments
);
const
mainThreadTextEditors
=
this
.
_toDispose
.
add
(
new
MainThreadTextEditors
(
this
,
extHostContext
,
codeEditorService
,
bulkEditService
,
this
.
_editorService
,
this
.
_editorGroupService
));
const
mainThreadTextEditors
=
this
.
_toDispose
.
add
(
new
MainThreadTextEditors
(
this
,
extHostContext
,
codeEditorService
,
bulkEditService
,
this
.
_editorService
,
this
.
_editorGroupService
));
extHostContext
.
set
(
MainContext
.
MainThreadTextEditors
,
mainThreadTextEditors
);
extHostContext
.
set
(
MainContext
.
MainThreadTextEditors
,
mainThreadTextEditors
);
...
@@ -367,7 +368,7 @@ export class MainThreadDocumentsAndEditors {
...
@@ -367,7 +368,7 @@ export class MainThreadDocumentsAndEditors {
// added editors
// added editors
for
(
const
apiEditor
of
delta
.
addedEditors
)
{
for
(
const
apiEditor
of
delta
.
addedEditors
)
{
const
mainThreadEditor
=
new
MainThreadTextEditor
(
apiEditor
.
id
,
apiEditor
.
editor
.
getModel
(),
const
mainThreadEditor
=
new
MainThreadTextEditor
(
apiEditor
.
id
,
apiEditor
.
editor
.
getModel
(),
apiEditor
.
editor
,
{
onGainedFocus
()
{
},
onLostFocus
()
{
}
},
this
.
_modelService
,
this
.
_clipboardService
);
apiEditor
.
editor
,
{
onGainedFocus
()
{
},
onLostFocus
()
{
}
},
this
.
_m
ainThreadDocuments
,
this
.
_m
odelService
,
this
.
_clipboardService
);
this
.
_textEditors
.
set
(
apiEditor
.
id
,
mainThreadEditor
);
this
.
_textEditors
.
set
(
apiEditor
.
id
,
mainThreadEditor
);
addedEditors
.
push
(
mainThreadEditor
);
addedEditors
.
push
(
mainThreadEditor
);
...
...
src/vs/workbench/api/browser/mainThreadEditor.ts
浏览文件 @
80257234
...
@@ -20,6 +20,7 @@ import { equals } from 'vs/base/common/arrays';
...
@@ -20,6 +20,7 @@ import { equals } from 'vs/base/common/arrays';
import
{
CodeEditorStateFlag
,
EditorState
}
from
'
vs/editor/browser/core/editorState
'
;
import
{
CodeEditorStateFlag
,
EditorState
}
from
'
vs/editor/browser/core/editorState
'
;
import
{
IClipboardService
}
from
'
vs/platform/clipboard/common/clipboardService
'
;
import
{
IClipboardService
}
from
'
vs/platform/clipboard/common/clipboardService
'
;
import
{
SnippetParser
}
from
'
vs/editor/contrib/snippet/snippetParser
'
;
import
{
SnippetParser
}
from
'
vs/editor/contrib/snippet/snippetParser
'
;
import
{
MainThreadDocuments
}
from
'
vs/workbench/api/browser/mainThreadDocuments
'
;
export
interface
IFocusTracker
{
export
interface
IFocusTracker
{
onGainedFocus
():
void
;
onGainedFocus
():
void
;
...
@@ -160,7 +161,8 @@ export class MainThreadTextEditorProperties {
...
@@ -160,7 +161,8 @@ export class MainThreadTextEditorProperties {
export
class
MainThreadTextEditor
{
export
class
MainThreadTextEditor
{
private
readonly
_id
:
string
;
private
readonly
_id
:
string
;
private
_model
:
ITextModel
;
private
readonly
_model
:
ITextModel
;
private
readonly
_mainThreadDocuments
:
MainThreadDocuments
;
private
readonly
_modelService
:
IModelService
;
private
readonly
_modelService
:
IModelService
;
private
readonly
_clipboardService
:
IClipboardService
;
private
readonly
_clipboardService
:
IClipboardService
;
private
readonly
_modelListeners
=
new
DisposableStore
();
private
readonly
_modelListeners
=
new
DisposableStore
();
...
@@ -176,6 +178,7 @@ export class MainThreadTextEditor {
...
@@ -176,6 +178,7 @@ export class MainThreadTextEditor {
model
:
ITextModel
,
model
:
ITextModel
,
codeEditor
:
ICodeEditor
,
codeEditor
:
ICodeEditor
,
focusTracker
:
IFocusTracker
,
focusTracker
:
IFocusTracker
,
mainThreadDocuments
:
MainThreadDocuments
,
modelService
:
IModelService
,
modelService
:
IModelService
,
clipboardService
:
IClipboardService
,
clipboardService
:
IClipboardService
,
)
{
)
{
...
@@ -184,6 +187,7 @@ export class MainThreadTextEditor {
...
@@ -184,6 +187,7 @@ export class MainThreadTextEditor {
this
.
_codeEditor
=
null
;
this
.
_codeEditor
=
null
;
this
.
_properties
=
null
;
this
.
_properties
=
null
;
this
.
_focusTracker
=
focusTracker
;
this
.
_focusTracker
=
focusTracker
;
this
.
_mainThreadDocuments
=
mainThreadDocuments
;
this
.
_modelService
=
modelService
;
this
.
_modelService
=
modelService
;
this
.
_clipboardService
=
clipboardService
;
this
.
_clipboardService
=
clipboardService
;
...
@@ -198,7 +202,6 @@ export class MainThreadTextEditor {
...
@@ -198,7 +202,6 @@ export class MainThreadTextEditor {
}
}
public
dispose
():
void
{
public
dispose
():
void
{
this
.
_model
=
null
!
;
this
.
_modelListeners
.
dispose
();
this
.
_modelListeners
.
dispose
();
this
.
_codeEditor
=
null
;
this
.
_codeEditor
=
null
;
this
.
_codeEditorListeners
.
dispose
();
this
.
_codeEditorListeners
.
dispose
();
...
@@ -257,21 +260,46 @@ export class MainThreadTextEditor {
...
@@ -257,21 +260,46 @@ export class MainThreadTextEditor {
this
.
_focusTracker
.
onLostFocus
();
this
.
_focusTracker
.
onLostFocus
();
}));
}));
let
nextSelectionChangeSource
:
string
|
null
=
null
;
this
.
_codeEditorListeners
.
add
(
this
.
_mainThreadDocuments
.
onIsCaughtUpWithContentChanges
((
uri
)
=>
{
if
(
uri
.
toString
()
===
this
.
_model
.
uri
.
toString
())
{
const
selectionChangeSource
=
nextSelectionChangeSource
;
nextSelectionChangeSource
=
null
;
this
.
_updatePropertiesNow
(
selectionChangeSource
);
}
}));
const
updateProperties
=
(
selectionChangeSource
:
string
|
null
)
=>
{
// Some editor events get delivered faster than model content changes. This is
// problematic, as this leads to editor properties reaching the extension host
// too soon, before the model content change that was the root cause.
//
// If this case is identified, then let's update editor properties on the next model
// content change instead.
if
(
this
.
_mainThreadDocuments
.
isCaughtUpWithContentChanges
(
this
.
_model
.
uri
))
{
nextSelectionChangeSource
=
null
;
this
.
_updatePropertiesNow
(
selectionChangeSource
);
}
else
{
// update editor properties on the next model content change
nextSelectionChangeSource
=
selectionChangeSource
;
}
};
this
.
_codeEditorListeners
.
add
(
this
.
_codeEditor
.
onDidChangeCursorSelection
((
e
)
=>
{
this
.
_codeEditorListeners
.
add
(
this
.
_codeEditor
.
onDidChangeCursorSelection
((
e
)
=>
{
// selection
// selection
this
.
_updatePropertiesNow
(
e
.
source
);
updateProperties
(
e
.
source
);
}));
}));
this
.
_codeEditorListeners
.
add
(
this
.
_codeEditor
.
onDidChangeConfiguration
(()
=>
{
this
.
_codeEditorListeners
.
add
(
this
.
_codeEditor
.
onDidChangeConfiguration
(()
=>
{
// options
// options
this
.
_updatePropertiesNow
(
null
);
updateProperties
(
null
);
}));
}));
this
.
_codeEditorListeners
.
add
(
this
.
_codeEditor
.
onDidLayoutChange
(()
=>
{
this
.
_codeEditorListeners
.
add
(
this
.
_codeEditor
.
onDidLayoutChange
(()
=>
{
// visibleRanges
// visibleRanges
this
.
_updatePropertiesNow
(
null
);
updateProperties
(
null
);
}));
}));
this
.
_codeEditorListeners
.
add
(
this
.
_codeEditor
.
onDidScrollChange
(()
=>
{
this
.
_codeEditorListeners
.
add
(
this
.
_codeEditor
.
onDidScrollChange
(()
=>
{
// visibleRanges
// visibleRanges
this
.
_updatePropertiesNow
(
null
);
updateProperties
(
null
);
}));
}));
this
.
_updatePropertiesNow
(
null
);
this
.
_updatePropertiesNow
(
null
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录