Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a7c53f5e
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,发现更多精彩内容 >>
提交
a7c53f5e
编写于
1月 06, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Phase out IMode
上级
4c3e4eef
变更
19
显示空白变更内容
内联
并排
Showing
19 changed file
with
50 addition
and
78 deletion
+50
-78
src/vs/editor/browser/widget/diffEditorWidget.ts
src/vs/editor/browser/widget/diffEditorWidget.ts
+3
-3
src/vs/editor/common/commonCodeEditor.ts
src/vs/editor/common/commonCodeEditor.ts
+3
-3
src/vs/editor/common/controller/cursor.ts
src/vs/editor/common/controller/cursor.ts
+4
-4
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+9
-11
src/vs/editor/common/model/model.ts
src/vs/editor/common/model/model.ts
+3
-3
src/vs/editor/common/model/textModelWithTokens.ts
src/vs/editor/common/model/textModelWithTokens.ts
+7
-24
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+1
-0
src/vs/editor/common/modes/editorModeContext.ts
src/vs/editor/common/modes/editorModeContext.ts
+1
-1
src/vs/editor/common/services/modelServiceImpl.ts
src/vs/editor/common/services/modelServiceImpl.ts
+2
-2
src/vs/editor/common/viewModel/viewModelImpl.ts
src/vs/editor/common/viewModel/viewModelImpl.ts
+1
-1
src/vs/editor/contrib/codelens/browser/codelens.ts
src/vs/editor/contrib/codelens/browser/codelens.ts
+1
-1
src/vs/editor/contrib/format/common/formatActions.ts
src/vs/editor/contrib/format/common/formatActions.ts
+1
-1
src/vs/editor/contrib/links/browser/links.ts
src/vs/editor/contrib/links/browser/links.ts
+1
-1
src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts
...or/contrib/parameterHints/browser/parameterHintsWidget.ts
+1
-1
src/vs/editor/contrib/quickFix/common/quickFixModel.ts
src/vs/editor/contrib/quickFix/common/quickFixModel.ts
+1
-1
src/vs/editor/contrib/referenceSearch/browser/referencesController.ts
...r/contrib/referenceSearch/browser/referencesController.ts
+1
-1
src/vs/editor/contrib/suggest/common/suggestModel.ts
src/vs/editor/contrib/suggest/common/suggestModel.ts
+1
-1
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+7
-17
src/vs/workbench/browser/parts/editor/editorStatus.ts
src/vs/workbench/browser/parts/editor/editorStatus.ts
+2
-2
未找到文件。
src/vs/editor/browser/widget/diffEditorWidget.ts
浏览文件 @
a7c53f5e
...
...
@@ -132,8 +132,8 @@ export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDif
public
onDidChangeModelContent
(
listener
:
(
e
:
editorCommon
.
IModelContentChangedEvent2
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
ModelContentChanged2
,
listener
);
}
public
onDidChangeModel
Mode
(
listener
:
(
e
:
editorCommon
.
IModelMod
eChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
Model
Mod
eChanged
,
listener
);
public
onDidChangeModel
Language
(
listener
:
(
e
:
editorCommon
.
IModelLanguag
eChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
Model
Languag
eChanged
,
listener
);
}
public
onDidChangeModelOptions
(
listener
:
(
e
:
editorCommon
.
IModelOptionsChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
editorCommon
.
EventType
.
ModelOptionsChanged
,
listener
);
...
...
@@ -734,7 +734,7 @@ export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDif
let
changed
=
false
;
for
(
let
i
=
0
;
!
changed
&&
i
<
events
.
length
;
i
++
)
{
let
type
=
events
[
i
].
getType
();
changed
=
changed
||
type
===
editorCommon
.
EventType
.
ModelRawContentChanged
||
type
===
editorCommon
.
EventType
.
ModelModeChanged
;
changed
=
changed
||
type
===
editorCommon
.
EventType
.
ModelRawContentChanged
;
}
if
(
changed
&&
this
.
_isVisible
)
{
// Clear previous timeout if necessary
...
...
src/vs/editor/common/commonCodeEditor.ts
浏览文件 @
a7c53f5e
...
...
@@ -39,7 +39,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom
public
readonly
onDidChangeModelRawContent
:
Event
<
editorCommon
.
IModelContentChangedEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ModelRawContentChanged
);
public
readonly
onDidChangeModelContent
:
Event
<
editorCommon
.
IModelContentChangedEvent2
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ModelContentChanged2
);
public
readonly
onDidChangeModel
Mode
:
Event
<
editorCommon
.
IModelModeChangedEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ModelMod
eChanged
);
public
readonly
onDidChangeModel
Language
:
Event
<
editorCommon
.
IModelLanguageChangedEvent
>
=
fromEventEmitter
(
this
,
editorCommon
.
EventType
.
ModelLanguag
eChanged
);
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
);
...
...
@@ -877,9 +877,9 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom
this
.
emit
(
editorCommon
.
EventType
.
ModelDecorationsChanged
,
e
);
break
;
case
editorCommon
.
EventType
.
Model
Mod
eChanged
:
case
editorCommon
.
EventType
.
Model
Languag
eChanged
:
this
.
domElement
.
setAttribute
(
'
data-mode-id
'
,
this
.
model
.
getLanguageIdentifier
().
language
);
this
.
emit
(
editorCommon
.
EventType
.
Model
Mod
eChanged
,
e
);
this
.
emit
(
editorCommon
.
EventType
.
Model
Languag
eChanged
,
e
);
break
;
case
editorCommon
.
EventType
.
ModelRawContentChanged
:
...
...
src/vs/editor/common/controller/cursor.ts
浏览文件 @
a7c53f5e
...
...
@@ -116,12 +116,12 @@ export class Cursor extends EventEmitter {
this
.
modelUnbinds
.
push
(
this
.
model
.
onDidChangeRawContent
((
e
)
=>
{
this
.
_onModelContentChanged
(
e
);
}));
this
.
modelUnbinds
.
push
(
this
.
model
.
onDidChange
Mod
e
((
e
)
=>
{
this
.
_onModel
Mod
eChanged
();
this
.
modelUnbinds
.
push
(
this
.
model
.
onDidChange
Languag
e
((
e
)
=>
{
this
.
_onModel
Languag
eChanged
();
}));
this
.
modelUnbinds
.
push
(
LanguageConfigurationRegistry
.
onDidChange
(()
=>
{
// TODO@Alex: react only if certain supports changed? (and if my model's mode changed)
this
.
_onModel
Mod
eChanged
();
this
.
_onModel
Languag
eChanged
();
}));
this
.
_handlers
=
{};
...
...
@@ -224,7 +224,7 @@ export class Cursor extends EventEmitter {
}
}
private
_onModel
Mod
eChanged
():
void
{
private
_onModel
Languag
eChanged
():
void
{
// the mode of this model has changed
this
.
cursors
.
updateMode
();
}
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
a7c53f5e
...
...
@@ -10,7 +10,7 @@ import * as types from 'vs/base/common/types';
import
URI
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ServicesAccessor
,
IConstructorSignature1
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IMode
,
LanguageId
,
LanguageIdentifier
,
StandardTokenType
}
from
'
vs/editor/common/modes
'
;
import
{
LanguageId
,
LanguageIdentifier
,
StandardTokenType
}
from
'
vs/editor/common/modes
'
;
import
{
LineTokens
}
from
'
vs/editor/common/core/lineTokens
'
;
import
{
ScrollbarVisibility
}
from
'
vs/base/common/scrollable
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -2168,7 +2168,7 @@ export interface IModel extends IReadOnlyModel, IEditableTextModel, ITextModelWi
* An event emitted when the language associated with the model has changed.
* @event
*/
onDidChange
Mode
(
listener
:
(
e
:
IModelMod
eChangedEvent
)
=>
void
):
IDisposable
;
onDidChange
Language
(
listener
:
(
e
:
IModelLanguag
eChangedEvent
)
=>
void
):
IDisposable
;
/**
* An event emitted right before disposing the model.
* @event
...
...
@@ -2218,17 +2218,15 @@ export interface IModel extends IReadOnlyModel, IEditableTextModel, ITextModelWi
/**
* An event describing that the current mode associated with a model has changed.
*/
export
interface
IModel
Mod
eChangedEvent
{
export
interface
IModel
Languag
eChangedEvent
{
/**
* Previous mode
* TODO@tokenization
* Previous language
*/
readonly
old
Mode
:
IMode
;
readonly
old
LanguageIdentifier
:
LanguageIdentifier
;
/**
* New mode
* TODO@tokenization
* New language
*/
readonly
new
Mode
:
IMode
;
readonly
new
LanguageIdentifier
:
LanguageIdentifier
;
}
/**
...
...
@@ -3423,7 +3421,7 @@ export interface IEditor {
* An event emitted when the language of the current model has changed.
* @event
*/
onDidChangeModel
Mode
(
listener
:
(
e
:
IModelMod
eChangedEvent
)
=>
void
):
IDisposable
;
onDidChangeModel
Language
(
listener
:
(
e
:
IModelLanguag
eChangedEvent
)
=>
void
):
IDisposable
;
/**
* An event emitted when the options of the current model has changed.
* @event
...
...
@@ -4102,7 +4100,7 @@ export var EventType = {
ModelChanged
:
'
modelChanged
'
,
ModelTokensChanged
:
'
modelTokensChanged
'
,
Model
ModeChanged
:
'
modelsMod
eChanged
'
,
Model
LanguageChanged
:
'
modelLanguag
eChanged
'
,
ModelOptionsChanged
:
'
modelOptionsChanged
'
,
ModelRawContentChanged
:
'
contentChanged
'
,
ModelContentChanged2
:
'
contentChanged2
'
,
...
...
src/vs/editor/common/model/model.ts
浏览文件 @
a7c53f5e
...
...
@@ -7,7 +7,7 @@
import
URI
from
'
vs/base/common/uri
'
;
import
{
EventType
,
IModel
,
ITextModelCreationOptions
,
IModelDecorationsChangedEvent
,
IModelOptionsChangedEvent
,
IModel
Mod
eChangedEvent
,
IRawText
IModelOptionsChangedEvent
,
IModel
Languag
eChangedEvent
,
IRawText
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditableTextModel
}
from
'
vs/editor/common/model/editableTextModel
'
;
import
{
TextModel
}
from
'
vs/editor/common/model/textModel
'
;
...
...
@@ -44,8 +44,8 @@ export class Model extends EditableTextModel implements IModel {
public
onWillDispose
(
listener
:
()
=>
void
):
IDisposable
{
return
this
.
addListener2
(
EventType
.
ModelDispose
,
listener
);
}
public
onDidChange
Mode
(
listener
:
(
e
:
IModelMod
eChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
EventType
.
Model
Mod
eChanged
,
listener
);
public
onDidChange
Language
(
listener
:
(
e
:
IModelLanguag
eChangedEvent
)
=>
void
):
IDisposable
{
return
this
.
addListener2
(
EventType
.
Model
Languag
eChanged
,
listener
);
}
public
addBulkListener
(
listener
:
BulkListenerCallback
):
IDisposable
{
...
...
src/vs/editor/common/model/textModelWithTokens.ts
浏览文件 @
a7c53f5e
...
...
@@ -13,7 +13,7 @@ import { Range } from 'vs/editor/common/core/range';
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
TextModel
}
from
'
vs/editor/common/model/textModel
'
;
import
{
TokenIterator
}
from
'
vs/editor/common/model/tokenIterator
'
;
import
{
ITokenizationSupport
,
I
Mode
,
I
State
,
TokenizationRegistry
,
LanguageId
,
LanguageIdentifier
}
from
'
vs/editor/common/modes
'
;
import
{
ITokenizationSupport
,
IState
,
TokenizationRegistry
,
LanguageId
,
LanguageIdentifier
}
from
'
vs/editor/common/modes
'
;
import
{
NULL_LANGUAGE_IDENTIFIER
,
nullTokenize3
}
from
'
vs/editor/common/modes/nullMode
'
;
import
{
ignoreBracketsInToken
}
from
'
vs/editor/common/modes/supports
'
;
import
{
BracketsUtils
,
RichEditBrackets
,
RichEditBracket
}
from
'
vs/editor/common/modes/supports/richEditBrackets
'
;
...
...
@@ -23,23 +23,6 @@ import { LineTokens, LineToken } from 'vs/editor/common/core/lineTokens';
import
{
getWordAtText
}
from
'
vs/editor/common/model/wordHelper
'
;
import
{
TokenizationResult2
}
from
'
vs/editor/common/core/token
'
;
class
Mode
implements
IMode
{
private
_languageIdentifier
:
LanguageIdentifier
;
constructor
(
languageId
:
LanguageIdentifier
)
{
this
.
_languageIdentifier
=
languageId
;
}
getId
():
string
{
return
this
.
_languageIdentifier
.
language
;
}
getLanguageIdentifier
():
LanguageIdentifier
{
return
this
.
_languageIdentifier
;
}
}
class
ModelTokensChangedEventBuilder
{
private
_ranges
:
{
fromLineNumber
:
number
;
toLineNumber
:
number
;
}[];
...
...
@@ -91,7 +74,7 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
constructor
(
allowedEventTypes
:
string
[],
rawText
:
editorCommon
.
IRawText
,
languageIdentifier
:
LanguageIdentifier
)
{
allowedEventTypes
.
push
(
editorCommon
.
EventType
.
ModelTokensChanged
);
allowedEventTypes
.
push
(
editorCommon
.
EventType
.
Model
Mod
eChanged
);
allowedEventTypes
.
push
(
editorCommon
.
EventType
.
Model
Languag
eChanged
);
super
(
allowedEventTypes
,
rawText
);
this
.
_languageIdentifier
=
languageIdentifier
||
NULL_LANGUAGE_IDENTIFIER
;
...
...
@@ -214,9 +197,9 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
return
;
}
let
e
:
editorCommon
.
IModel
Mod
eChangedEvent
=
{
old
Mode
:
new
Mode
(
this
.
_languageIdentifier
)
,
new
Mode
:
new
Mode
(
languageIdentifier
)
let
e
:
editorCommon
.
IModel
Languag
eChangedEvent
=
{
old
LanguageIdentifier
:
this
.
_languageIdentifier
,
new
LanguageIdentifier
:
languageIdentifier
};
this
.
_languageIdentifier
=
languageIdentifier
;
...
...
@@ -412,9 +395,9 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
}
}
private
_emitModelModeChangedEvent
(
e
:
editorCommon
.
IModel
Mod
eChangedEvent
):
void
{
private
_emitModelModeChangedEvent
(
e
:
editorCommon
.
IModel
Languag
eChangedEvent
):
void
{
if
(
!
this
.
_isDisposing
)
{
this
.
emit
(
editorCommon
.
EventType
.
Model
Mod
eChanged
,
e
);
this
.
emit
(
editorCommon
.
EventType
.
Model
Languag
eChanged
,
e
);
}
}
...
...
src/vs/editor/common/modes.ts
浏览文件 @
a7c53f5e
...
...
@@ -40,6 +40,7 @@ export class LanguageIdentifier {
/**
* A mode. Will soon be obsolete.
* @internal
*/
export
interface
IMode
{
...
...
src/vs/editor/common/modes/editorModeContext.ts
浏览文件 @
a7c53f5e
...
...
@@ -50,7 +50,7 @@ export class EditorModeContext {
// update when model/mode changes
this
.
_disposables
.
push
(
editor
.
onDidChangeModel
(()
=>
this
.
_update
()));
this
.
_disposables
.
push
(
editor
.
onDidChangeModel
Mod
e
(()
=>
this
.
_update
()));
this
.
_disposables
.
push
(
editor
.
onDidChangeModel
Languag
e
(()
=>
this
.
_update
()));
// update when registries change
modes
.
SuggestRegistry
.
onDidChange
(
this
.
_update
,
this
,
this
.
_disposables
);
...
...
src/vs/editor/common/services/modelServiceImpl.ts
浏览文件 @
a7c53f5e
...
...
@@ -476,10 +476,10 @@ export class ModelServiceImpl implements IModelService {
// Second, look for mode change
for
(
let
i
=
0
,
len
=
events
.
length
;
i
<
len
;
i
++
)
{
let
e
=
events
[
i
];
if
(
e
.
getType
()
===
editorCommon
.
EventType
.
Model
Mod
eChanged
)
{
if
(
e
.
getType
()
===
editorCommon
.
EventType
.
Model
Languag
eChanged
)
{
this
.
_onModelModeChanged
.
fire
({
model
:
modelData
.
model
,
oldModeId
:
(
<
editorCommon
.
IModel
ModeChangedEvent
>
e
.
getData
()).
oldMode
.
getId
()
oldModeId
:
(
<
editorCommon
.
IModel
LanguageChangedEvent
>
e
.
getData
()).
oldLanguageIdentifier
.
language
});
}
}
...
...
src/vs/editor/common/viewModel/viewModelImpl.ts
浏览文件 @
a7c53f5e
...
...
@@ -235,7 +235,7 @@ export class ViewModel extends EventEmitter implements IViewModel {
this
.
onModelTokensChanged
(
<
editorCommon
.
IModelTokensChangedEvent
>
data
);
break
;
case
editorCommon
.
EventType
.
Model
Mod
eChanged
:
case
editorCommon
.
EventType
.
Model
Languag
eChanged
:
// That's ok, a model tokens changed event will follow shortly
break
;
...
...
src/vs/editor/contrib/codelens/browser/codelens.ts
浏览文件 @
a7c53f5e
...
...
@@ -330,7 +330,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
this
.
_modelChangeCounter
=
0
;
this
.
_globalToDispose
.
push
(
this
.
_editor
.
onDidChangeModel
(()
=>
this
.
onModelChange
()));
this
.
_globalToDispose
.
push
(
this
.
_editor
.
onDidChangeModel
Mod
e
(()
=>
this
.
onModelChange
()));
this
.
_globalToDispose
.
push
(
this
.
_editor
.
onDidChangeModel
Languag
e
(()
=>
this
.
onModelChange
()));
this
.
_globalToDispose
.
push
(
this
.
_editor
.
onDidChangeConfiguration
((
e
:
editorCommon
.
IConfigurationChangedEvent
)
=>
{
let
prevIsEnabled
=
this
.
_isEnabled
;
this
.
_isEnabled
=
this
.
_editor
.
getConfiguration
().
contribInfo
.
codeLens
;
...
...
src/vs/editor/contrib/format/common/formatActions.ts
浏览文件 @
a7c53f5e
...
...
@@ -40,7 +40,7 @@ class FormatOnType implements editorCommon.IEditorContribution {
this
.
callOnDispose
.
push
(
editor
.
onDidChangeConfiguration
(()
=>
this
.
update
()));
this
.
callOnDispose
.
push
(
editor
.
onDidChangeModel
(()
=>
this
.
update
()));
this
.
callOnDispose
.
push
(
editor
.
onDidChangeModel
Mod
e
(()
=>
this
.
update
()));
this
.
callOnDispose
.
push
(
editor
.
onDidChangeModel
Languag
e
(()
=>
this
.
update
()));
this
.
callOnDispose
.
push
(
OnTypeFormattingEditProviderRegistry
.
onDidChange
(
this
.
update
,
this
));
}
...
...
src/vs/editor/contrib/links/browser/links.ts
浏览文件 @
a7c53f5e
...
...
@@ -111,7 +111,7 @@ class LinkDetector implements editorCommon.IEditorContribution {
this
.
listenersToRemove
=
[];
this
.
listenersToRemove
.
push
(
editor
.
onDidChangeModelContent
((
e
)
=>
this
.
onChange
()));
this
.
listenersToRemove
.
push
(
editor
.
onDidChangeModel
((
e
)
=>
this
.
onModelChanged
()));
this
.
listenersToRemove
.
push
(
editor
.
onDidChangeModel
Mod
e
((
e
)
=>
this
.
onModelModeChanged
()));
this
.
listenersToRemove
.
push
(
editor
.
onDidChangeModel
Languag
e
((
e
)
=>
this
.
onModelModeChanged
()));
this
.
listenersToRemove
.
push
(
LinkProviderRegistry
.
onDidChange
((
e
)
=>
this
.
onModelModeChanged
()));
this
.
listenersToRemove
.
push
(
this
.
editor
.
onMouseUp
((
e
:
IEditorMouseEvent
)
=>
this
.
onEditorMouseUp
(
e
)));
this
.
listenersToRemove
.
push
(
this
.
editor
.
onMouseMove
((
e
:
IEditorMouseEvent
)
=>
this
.
onEditorMouseMove
(
e
)));
...
...
src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts
浏览文件 @
a7c53f5e
...
...
@@ -57,7 +57,7 @@ export class ParameterHintsModel extends Disposable {
this
.
_register
(
this
.
editor
.
onDidChangeConfiguration
(()
=>
this
.
onEditorConfigurationChange
()));
this
.
_register
(
this
.
editor
.
onDidChangeModel
(
e
=>
this
.
onModelChanged
()));
this
.
_register
(
this
.
editor
.
onDidChangeModel
Mod
e
(
_
=>
this
.
onModelChanged
()));
this
.
_register
(
this
.
editor
.
onDidChangeModel
Languag
e
(
_
=>
this
.
onModelChanged
()));
this
.
_register
(
this
.
editor
.
onDidChangeCursorSelection
(
e
=>
this
.
onCursorChange
(
e
)));
this
.
_register
(
SignatureHelpProviderRegistry
.
onDidChange
(
this
.
onModelChanged
,
this
));
...
...
src/vs/editor/contrib/quickFix/common/quickFixModel.ts
浏览文件 @
a7c53f5e
...
...
@@ -139,7 +139,7 @@ export class QuickFixModel {
this
.
_markerService
=
markerService
;
this
.
_disposables
.
push
(
this
.
_editor
.
onDidChangeModel
(()
=>
this
.
_update
()));
this
.
_disposables
.
push
(
this
.
_editor
.
onDidChangeModel
Mod
e
(()
=>
this
.
_update
()));
this
.
_disposables
.
push
(
this
.
_editor
.
onDidChangeModel
Languag
e
(()
=>
this
.
_update
()));
this
.
_disposables
.
push
(
CodeActionProviderRegistry
.
onDidChange
(
this
.
_update
,
this
));
this
.
_update
();
...
...
src/vs/editor/contrib/referenceSearch/browser/referencesController.ts
浏览文件 @
a7c53f5e
...
...
@@ -96,7 +96,7 @@ export class ReferencesController implements editorCommon.IEditorContribution {
this
.
_referenceSearchVisible
.
set
(
true
);
// close the widget on model/mode changes
this
.
_disposables
.
push
(
this
.
_editor
.
onDidChangeModel
Mod
e
(()
=>
{
this
.
closeWidget
();
}));
this
.
_disposables
.
push
(
this
.
_editor
.
onDidChangeModel
Languag
e
(()
=>
{
this
.
closeWidget
();
}));
this
.
_disposables
.
push
(
this
.
_editor
.
onDidChangeModel
(()
=>
{
if
(
!
this
.
_ignoreModelChangeEvent
)
{
this
.
closeWidget
();
...
...
src/vs/editor/contrib/suggest/common/suggestModel.ts
浏览文件 @
a7c53f5e
...
...
@@ -118,7 +118,7 @@ export class SuggestModel implements IDisposable {
this
.
updateTriggerCharacters
();
this
.
cancel
();
}));
this
.
toDispose
.
push
(
editor
.
onDidChangeModel
Mod
e
(()
=>
{
this
.
toDispose
.
push
(
editor
.
onDidChangeModel
Languag
e
(()
=>
{
this
.
updateTriggerCharacters
();
this
.
cancel
();
}));
...
...
src/vs/monaco.d.ts
浏览文件 @
a7c53f5e
...
...
@@ -2262,7 +2262,7 @@ declare module monaco.editor {
* An event emitted when the language associated with the model has changed.
* @event
*/
onDidChange
Mode
(
listener
:
(
e
:
IModelMod
eChangedEvent
)
=>
void
):
IDisposable
;
onDidChange
Language
(
listener
:
(
e
:
IModelLanguag
eChangedEvent
)
=>
void
):
IDisposable
;
/**
* An event emitted right before disposing the model.
* @event
...
...
@@ -2282,17 +2282,15 @@ declare module monaco.editor {
/**
* An event describing that the current mode associated with a model has changed.
*/
export
interface
IModel
Mod
eChangedEvent
{
export
interface
IModel
Languag
eChangedEvent
{
/**
* Previous mode
* TODO@tokenization
* Previous language
*/
readonly
old
Mode
:
languages
.
IMode
;
readonly
old
LanguageIdentifier
:
languages
.
LanguageIdentifier
;
/**
* New mode
* TODO@tokenization
* New language
*/
readonly
new
Mode
:
languages
.
IMode
;
readonly
new
LanguageIdentifier
:
languages
.
LanguageIdentifier
;
}
/**
...
...
@@ -2854,7 +2852,7 @@ declare module monaco.editor {
* An event emitted when the language of the current model has changed.
* @event
*/
onDidChangeModel
Mode
(
listener
:
(
e
:
IModelMod
eChangedEvent
)
=>
void
):
IDisposable
;
onDidChangeModel
Language
(
listener
:
(
e
:
IModelLanguag
eChangedEvent
)
=>
void
):
IDisposable
;
/**
* An event emitted when the options of the current model has changed.
* @event
...
...
@@ -4290,14 +4288,6 @@ declare module monaco.languages {
constructor
(
language
:
string
,
id
:
number
);
}
/**
* A mode. Will soon be obsolete.
*/
export
interface
IMode
{
getId
():
string
;
getLanguageIdentifier
():
LanguageIdentifier
;
}
/**
* The state of the tokenizer between two lines.
* It is useful to store flags such as in multiline comment, etc.
...
...
src/vs/workbench/browser/parts/editor/editorStatus.ts
浏览文件 @
a7c53f5e
...
...
@@ -24,7 +24,7 @@ import { IDisposable, combinedDisposable, dispose } from 'vs/base/common/lifecyc
import
{
IMessageService
,
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/common/untitledEditorService
'
;
import
{
IConfigurationEditingService
,
ConfigurationTarget
}
from
'
vs/workbench/services/configuration/common/configurationEditing
'
;
import
{
IEditorAction
,
ICommonCodeEditor
,
IModelContentChangedEvent
,
IModelOptionsChangedEvent
,
IModel
Mod
eChangedEvent
,
ICursorPositionChangedEvent
,
EndOfLineSequence
,
EditorType
,
IModel
,
IDiffEditorModel
,
IEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IEditorAction
,
ICommonCodeEditor
,
IModelContentChangedEvent
,
IModelOptionsChangedEvent
,
IModel
Languag
eChangedEvent
,
ICursorPositionChangedEvent
,
EndOfLineSequence
,
EditorType
,
IModel
,
IDiffEditorModel
,
IEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICodeEditor
,
IDiffEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
TrimTrailingWhitespaceAction
}
from
'
vs/editor/contrib/linesOperations/common/linesOperations
'
;
import
{
IndentUsingSpaces
,
IndentUsingTabs
,
DetectIndentation
,
IndentationToSpacesAction
,
IndentationToTabsAction
}
from
'
vs/workbench/parts/indentation/common/indentation
'
;
...
...
@@ -495,7 +495,7 @@ export class EditorStatus implements IStatusbarItem {
}));
// Hook Listener for mode changes
this
.
activeEditorListeners
.
push
(
control
.
onDidChangeModel
Mode
((
event
:
IModelMod
eChangedEvent
)
=>
{
this
.
activeEditorListeners
.
push
(
control
.
onDidChangeModel
Language
((
event
:
IModelLanguag
eChangedEvent
)
=>
{
this
.
onModeChange
(
control
);
}));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录