Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
badd8d18
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,体验更适合开发者的 AI 搜索 >>
提交
badd8d18
编写于
1月 05, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove model.getModeId()
上级
bb49af33
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
21 addition
and
51 deletion
+21
-51
src/vs/editor/common/commonCodeEditor.ts
src/vs/editor/common/commonCodeEditor.ts
+2
-2
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+0
-14
src/vs/editor/common/model/textModelWithTokens.ts
src/vs/editor/common/model/textModelWithTokens.ts
+0
-4
src/vs/editor/common/modes/editorModeContext.ts
src/vs/editor/common/modes/editorModeContext.ts
+1
-1
src/vs/editor/common/modes/languageFeatureRegistry.ts
src/vs/editor/common/modes/languageFeatureRegistry.ts
+2
-2
src/vs/editor/contrib/codelens/browser/codelens.ts
src/vs/editor/contrib/codelens/browser/codelens.ts
+1
-1
src/vs/editor/contrib/hover/browser/modesContentHover.ts
src/vs/editor/contrib/hover/browser/modesContentHover.ts
+1
-1
src/vs/editor/contrib/referenceSearch/browser/referencesController.ts
...r/contrib/referenceSearch/browser/referencesController.ts
+1
-1
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+0
-12
src/vs/workbench/api/node/mainThreadDocuments.ts
src/vs/workbench/api/node/mainThreadDocuments.ts
+2
-2
src/vs/workbench/browser/labels.ts
src/vs/workbench/browser/labels.ts
+1
-1
src/vs/workbench/browser/parts/editor/editorStatus.ts
src/vs/workbench/browser/parts/editor/editorStatus.ts
+2
-2
src/vs/workbench/common/editor/untitledEditorModel.ts
src/vs/workbench/common/editor/untitledEditorModel.ts
+1
-1
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
.../workbench/parts/debug/browser/debugEditorModelManager.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
...parts/debug/electron-browser/debugConfigurationManager.ts
+1
-1
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
...vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
+2
-2
src/vs/workbench/parts/search/browser/replaceService.ts
src/vs/workbench/parts/search/browser/replaceService.ts
+1
-1
src/vs/workbench/test/node/api/extHostApiCommands.test.ts
src/vs/workbench/test/node/api/extHostApiCommands.test.ts
+1
-1
src/vs/workbench/test/node/api/extHostLanguageFeatures.test.ts
...s/workbench/test/node/api/extHostLanguageFeatures.test.ts
+1
-1
未找到文件。
src/vs/editor/common/commonCodeEditor.ts
浏览文件 @
badd8d18
...
...
@@ -741,7 +741,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom
this
.
cursor
=
null
;
if
(
this
.
model
)
{
this
.
domElement
.
setAttribute
(
'
data-mode-id
'
,
this
.
model
.
get
ModeId
()
);
this
.
domElement
.
setAttribute
(
'
data-mode-id
'
,
this
.
model
.
get
LanguageIdentifier
().
language
);
this
.
_configuration
.
setIsDominatedByLongLines
(
this
.
model
.
isDominatedByLongLines
());
this
.
model
.
onBeforeAttached
();
...
...
@@ -878,7 +878,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom
break
;
case
editorCommon
.
EventType
.
ModelModeChanged
:
this
.
domElement
.
setAttribute
(
'
data-mode-id
'
,
this
.
model
.
get
ModeId
()
);
this
.
domElement
.
setAttribute
(
'
data-mode-id
'
,
this
.
model
.
get
LanguageIdentifier
().
language
);
this
.
emit
(
editorCommon
.
EventType
.
ModelModeChanged
,
e
);
break
;
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
badd8d18
...
...
@@ -1816,13 +1816,6 @@ export interface IReadOnlyModel extends ITextModel {
*/
readonly
uri
:
URI
;
/**
* Get the language associated with this model.
* TODO@tokenization
* @deprecated
*/
getModeId
():
string
;
/**
* Get the language associated with this model.
*/
...
...
@@ -1868,13 +1861,6 @@ export interface ITokenizedModel extends ITextModel {
*/
getLineTokens
(
lineNumber
:
number
,
inaccurateTokensAcceptable
?:
boolean
):
LineTokens
;
/**
* Get the language associated with this model.
* TODO@tokenization
* @deprecated
*/
getModeId
():
string
;
/**
* Get the language associated with this model.
*/
...
...
src/vs/editor/common/model/textModelWithTokens.ts
浏览文件 @
badd8d18
...
...
@@ -203,10 +203,6 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
return
this
.
_lines
[
lineNumber
-
1
].
getTokens
(
this
.
_languageIdentifier
.
id
,
this
.
_colorMap
);
}
public
getModeId
():
string
{
return
this
.
_languageIdentifier
.
language
;
}
public
getLanguageIdentifier
():
LanguageIdentifier
{
return
this
.
_languageIdentifier
;
}
...
...
src/vs/editor/common/modes/editorModeContext.ts
浏览文件 @
badd8d18
...
...
@@ -95,7 +95,7 @@ export class EditorModeContext {
this
.
reset
();
return
;
}
this
.
_langId
.
set
(
model
.
get
ModeId
()
);
this
.
_langId
.
set
(
model
.
get
LanguageIdentifier
().
language
);
this
.
_hasCompletionItemProvider
.
set
(
modes
.
SuggestRegistry
.
has
(
model
));
this
.
_hasCodeActionsProvider
.
set
(
modes
.
CodeActionProviderRegistry
.
has
(
model
));
this
.
_hasCodeLensProvider
.
set
(
modes
.
CodeLensProviderRegistry
.
has
(
model
));
...
...
src/vs/editor/common/modes/languageFeatureRegistry.ts
浏览文件 @
badd8d18
...
...
@@ -126,7 +126,7 @@ export default class LanguageFeatureRegistry<T> {
let
candidate
=
{
uri
:
model
.
uri
.
toString
(),
language
:
model
.
get
ModeId
()
language
:
model
.
get
LanguageIdentifier
().
language
};
if
(
this
.
_lastCandidate
...
...
@@ -140,7 +140,7 @@ export default class LanguageFeatureRegistry<T> {
this
.
_lastCandidate
=
candidate
;
for
(
let
entry
of
this
.
_entries
)
{
entry
.
_score
=
score
(
entry
.
selector
,
model
.
uri
,
model
.
get
ModeId
()
);
entry
.
_score
=
score
(
entry
.
selector
,
model
.
uri
,
model
.
get
LanguageIdentifier
().
language
);
}
// needs sorting
...
...
src/vs/editor/contrib/codelens/browser/codelens.ts
浏览文件 @
badd8d18
...
...
@@ -401,7 +401,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
};
const
detectVisible
=
new
RunOnceScheduler
(()
=>
{
this
.
_onViewportChanged
(
model
.
get
ModeId
()
);
this
.
_onViewportChanged
(
model
.
get
LanguageIdentifier
().
language
);
},
500
);
const
scheduler
=
new
RunOnceScheduler
(()
=>
{
...
...
src/vs/editor/contrib/hover/browser/modesContentHover.ts
浏览文件 @
badd8d18
...
...
@@ -255,7 +255,7 @@ export class ModesContentHoverWidget extends ContentHoverWidget {
// it is possible no alias is given in which case we fall back to the current editor lang
const
modeId
=
languageAlias
?
this
.
_modeService
.
getModeIdForLanguageName
(
languageAlias
)
:
this
.
_editor
.
getModel
().
get
ModeId
()
;
:
this
.
_editor
.
getModel
().
get
LanguageIdentifier
().
language
;
return
this
.
_modeService
.
getOrCreateMode
(
modeId
).
then
(
_
=>
{
return
`<div class="code">
${
tokenizeToString
(
value
,
modeId
)}
</div>`
;
...
...
src/vs/editor/contrib/referenceSearch/browser/referencesController.ts
浏览文件 @
badd8d18
...
...
@@ -188,7 +188,7 @@ export class ReferencesController implements editorCommon.IEditorContribution {
onDone
(
duration
=>
this
.
_telemetryService
.
publicLog
(
'
findReferences
'
,
{
duration
,
mode
:
this
.
_editor
.
getModel
().
get
ModeId
()
mode
:
this
.
_editor
.
getModel
().
get
LanguageIdentifier
().
language
}));
}
...
...
src/vs/monaco.d.ts
浏览文件 @
badd8d18
...
...
@@ -2073,12 +2073,6 @@ declare module monaco.editor {
* Gets the resource associated with this editor model.
*/
readonly
uri
:
Uri
;
/**
* Get the language associated with this model.
* TODO@tokenization
* @deprecated
*/
getModeId
():
string
;
/**
* Get the language associated with this model.
*/
...
...
@@ -2103,12 +2097,6 @@ declare module monaco.editor {
* A model that is tokenized.
*/
export
interface
ITokenizedModel
extends
ITextModel
{
/**
* Get the language associated with this model.
* TODO@tokenization
* @deprecated
*/
getModeId
():
string
;
/**
* Get the language associated with this model.
*/
...
...
src/vs/workbench/api/node/mainThreadDocuments.ts
浏览文件 @
badd8d18
...
...
@@ -106,7 +106,7 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
url
:
model
.
uri
,
versionId
:
model
.
getVersionId
(),
value
:
model
.
toRawText
(),
modeId
:
model
.
get
ModeId
()
,
modeId
:
model
.
get
LanguageIdentifier
().
language
,
isDirty
:
this
.
_textFileService
.
isDirty
(
modelUrl
)
});
}
...
...
@@ -117,7 +117,7 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
if
(
!
this
.
_modelIsSynced
[
modelUrl
.
toString
()])
{
return
;
}
this
.
_proxy
.
$acceptModelModeChanged
(
model
.
uri
.
toString
(),
oldModeId
,
model
.
get
ModeId
()
);
this
.
_proxy
.
$acceptModelModeChanged
(
model
.
uri
.
toString
(),
oldModeId
,
model
.
get
LanguageIdentifier
().
language
);
}
private
_onModelRemoved
(
model
:
editorCommon
.
IModel
):
void
{
...
...
src/vs/workbench/browser/labels.ts
浏览文件 @
badd8d18
...
...
@@ -215,7 +215,7 @@ function getConfiguredLangId(modelService: IModelService, resource: uri): string
if
(
resource
)
{
const
model
=
modelService
.
getModel
(
resource
);
if
(
model
)
{
const
modeId
=
model
.
get
ModeId
()
;
const
modeId
=
model
.
get
LanguageIdentifier
().
language
;
if
(
modeId
&&
modeId
!==
PLAINTEXT_MODE_ID
)
{
configuredLangId
=
modeId
;
// only take if the mode is specific (aka no just plain text)
}
...
...
src/vs/workbench/browser/parts/editor/editorStatus.ts
浏览文件 @
badd8d18
...
...
@@ -526,7 +526,7 @@ export class EditorStatus implements IStatusbarItem {
const
textModel
=
getTextModel
(
editorWidget
);
if
(
textModel
)
{
// Compute mode
const
modeId
=
textModel
.
get
ModeId
()
;
const
modeId
=
textModel
.
get
LanguageIdentifier
().
language
;
info
=
{
mode
:
this
.
modeService
.
getLanguageName
(
modeId
)
};
}
}
...
...
@@ -736,7 +736,7 @@ export class ChangeModeAction extends Action {
// Compute mode
let
currentModeId
:
string
;
if
(
textModel
)
{
const
modeId
=
textModel
.
get
ModeId
()
;
const
modeId
=
textModel
.
get
LanguageIdentifier
().
language
;
currentModeId
=
this
.
modeService
.
getLanguageName
(
modeId
);
}
...
...
src/vs/workbench/common/editor/untitledEditorModel.ts
浏览文件 @
badd8d18
...
...
@@ -111,7 +111,7 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin
public
getModeId
():
string
{
if
(
this
.
textEditorModel
)
{
return
this
.
textEditorModel
.
get
ModeId
()
;
return
this
.
textEditorModel
.
get
LanguageIdentifier
().
language
;
}
return
null
;
...
...
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
浏览文件 @
badd8d18
...
...
@@ -275,7 +275,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
return
DebugEditorModelManager
.
BREAKPOINT_UNSUPPORTED_DECORATION
;
}
const
modeId
=
modelData
?
modelData
.
model
.
get
ModeId
()
:
''
;
const
modeId
=
modelData
?
modelData
.
model
.
get
LanguageIdentifier
().
language
:
''
;
let
condition
:
string
;
if
(
breakpoint
.
condition
&&
breakpoint
.
hitCondition
)
{
condition
=
`Expression:
${
breakpoint
.
condition
}
\nHitCount:
${
breakpoint
.
hitCondition
}
`
;
...
...
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
浏览文件 @
badd8d18
...
...
@@ -383,7 +383,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
return
true
;
}
const
modeId
=
model
?
model
.
get
ModeId
()
:
null
;
const
modeId
=
model
?
model
.
get
LanguageIdentifier
().
language
:
null
;
return
!!
this
.
allModeIdsForBreakpoints
[
modeId
];
}
...
...
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
浏览文件 @
badd8d18
...
...
@@ -420,7 +420,7 @@ export class GotoSymbolHandler extends QuickOpenHandler {
model
=
(
<
IDiffEditorModel
>
model
).
modified
;
// Support for diff editor models
}
if
(
model
&&
types
.
isFunction
((
<
ITokenizedModel
>
model
).
get
ModeId
))
{
if
(
model
&&
types
.
isFunction
((
<
ITokenizedModel
>
model
).
get
LanguageIdentifier
))
{
canRun
=
DocumentSymbolProviderRegistry
.
has
(
<
IModel
>
model
);
}
}
...
...
@@ -476,7 +476,7 @@ export class GotoSymbolHandler extends QuickOpenHandler {
model
=
(
<
IDiffEditorModel
>
model
).
modified
;
// Support for diff editor models
}
if
(
model
&&
types
.
isFunction
((
<
ITokenizedModel
>
model
).
get
ModeId
))
{
if
(
model
&&
types
.
isFunction
((
<
ITokenizedModel
>
model
).
get
LanguageIdentifier
))
{
// Ask cache first
const
modelId
=
(
<
IModel
>
model
).
id
;
...
...
src/vs/workbench/parts/search/browser/replaceService.ts
浏览文件 @
badd8d18
...
...
@@ -63,7 +63,7 @@ class ReplacePreviewModel extends Disposable {
return
this
.
textModelResolverService
.
createModelReference
(
fileResource
).
then
(
ref
=>
{
ref
=
this
.
_register
(
ref
);
const
sourceModel
=
ref
.
object
.
textEditorModel
;
const
sourceModelModeId
=
sourceModel
.
get
ModeId
()
;
const
sourceModelModeId
=
sourceModel
.
get
LanguageIdentifier
().
language
;
const
replacePreviewModel
=
this
.
modelService
.
createModel
(
sourceModel
.
getValue
(),
this
.
modeService
.
getOrCreateMode
(
sourceModelModeId
),
replacePreviewUri
);
this
.
_register
(
fileMatch
.
onChange
(
modelChange
=>
this
.
update
(
sourceModel
,
replacePreviewModel
,
fileMatch
,
modelChange
)));
this
.
_register
(
this
.
searchWorkbenchService
.
searchModel
.
onReplaceTermChanged
(()
=>
this
.
update
(
sourceModel
,
replacePreviewModel
,
fileMatch
)));
...
...
src/vs/workbench/test/node/api/extHostApiCommands.test.ts
浏览文件 @
badd8d18
...
...
@@ -92,7 +92,7 @@ suite('ExtHostLanguageFeatureCommands', function () {
extHostDocuments
.
$acceptModelAdd
({
isDirty
:
false
,
versionId
:
model
.
getVersionId
(),
modeId
:
model
.
get
ModeId
()
,
modeId
:
model
.
get
LanguageIdentifier
().
language
,
url
:
model
.
uri
,
value
:
{
EOL
:
model
.
getEOL
(),
...
...
src/vs/workbench/test/node/api/extHostLanguageFeatures.test.ts
浏览文件 @
badd8d18
...
...
@@ -85,7 +85,7 @@ suite('ExtHostLanguageFeatures', function () {
extHostDocuments
.
$acceptModelAdd
({
isDirty
:
false
,
versionId
:
model
.
getVersionId
(),
modeId
:
model
.
get
ModeId
()
,
modeId
:
model
.
get
LanguageIdentifier
().
language
,
url
:
model
.
uri
,
value
:
{
EOL
:
model
.
getEOL
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录