Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
df4502cd
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,发现更多精彩内容 >>
提交
df4502cd
编写于
3月 03, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make forced tokenization explicit
上级
cee1934a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
8 addition
and
5 deletion
+8
-5
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+2
-1
src/vs/editor/common/model/textModelWithTokens.ts
src/vs/editor/common/model/textModelWithTokens.ts
+0
-4
src/vs/editor/contrib/comment/common/blockCommentCommand.ts
src/vs/editor/contrib/comment/common/blockCommentCommand.ts
+1
-0
src/vs/editor/contrib/comment/common/lineCommentCommand.ts
src/vs/editor/contrib/comment/common/lineCommentCommand.ts
+2
-0
src/vs/workbench/parts/emmet/node/editorAccessor.ts
src/vs/workbench/parts/emmet/node/editorAccessor.ts
+1
-0
src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts
...orkbench/parts/snippets/electron-browser/insertSnippet.ts
+1
-0
src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts
...kbench/parts/snippets/electron-browser/snippetsService.ts
+1
-0
未找到文件。
src/vs/editor/common/editorCommon.ts
浏览文件 @
df4502cd
...
...
@@ -2041,7 +2041,8 @@ export interface ITokenizedModel extends ITextModel {
setMode
(
languageIdentifier
:
LanguageIdentifier
):
void
;
/**
* Returns the true (inner-most) language mode at a given position.
* Returns the real (inner-most) language mode at a given position.
* The result might be inaccurate. Use `forceTokenization` to ensure accurate tokens.
* @internal
*/
getLanguageIdAtPosition
(
lineNumber
:
number
,
column
:
number
):
LanguageId
;
...
...
src/vs/editor/common/model/textModelWithTokens.ts
浏览文件 @
df4502cd
...
...
@@ -228,10 +228,6 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
}
let
{
lineNumber
,
column
}
=
this
.
validatePosition
({
lineNumber
:
_lineNumber
,
column
:
_column
});
this
.
_withModelTokensChangedEventBuilder
((
eventBuilder
)
=>
{
this
.
_updateTokensUntilLine
(
eventBuilder
,
lineNumber
);
});
let
lineTokens
=
this
.
_getLineTokens
(
lineNumber
);
let
token
=
lineTokens
.
findTokenAtOffset
(
column
-
1
);
return
token
.
languageId
;
...
...
src/vs/editor/contrib/comment/common/blockCommentCommand.ts
浏览文件 @
df4502cd
...
...
@@ -121,6 +121,7 @@ export class BlockCommentCommand implements editorCommon.ICommand {
var
endLineNumber
=
this
.
_selection
.
endLineNumber
;
var
endColumn
=
this
.
_selection
.
endColumn
;
model
.
forceTokenization
(
startLineNumber
);
let
languageId
=
model
.
getLanguageIdAtPosition
(
startLineNumber
,
startColumn
);
let
config
=
LanguageConfigurationRegistry
.
getComments
(
languageId
);
if
(
!
config
||
!
config
.
blockCommentStartToken
||
!
config
.
blockCommentEndToken
)
{
...
...
src/vs/editor/contrib/comment/common/lineCommentCommand.ts
浏览文件 @
df4502cd
...
...
@@ -67,6 +67,7 @@ export class LineCommentCommand implements editorCommon.ICommand {
let
lines
:
ILinePreflightData
[]
=
[];
for
(
let
i
=
0
,
lineCount
=
endLineNumber
-
startLineNumber
+
1
;
i
<
lineCount
;
i
++
)
{
let
lineNumber
=
startLineNumber
+
i
;
model
.
forceTokenization
(
lineNumber
);
let
languageId
=
model
.
getLanguageIdAtPosition
(
lineNumber
,
1
);
// Find the commentStr for this line, if none is found then bail out: we cannot do line comments
...
...
@@ -265,6 +266,7 @@ export class LineCommentCommand implements editorCommon.ICommand {
* Given an unsuccessful analysis, delegate to the block comment command
*/
private
_executeBlockComment
(
model
:
editorCommon
.
ITokenizedModel
,
builder
:
editorCommon
.
IEditOperationBuilder
,
s
:
Selection
):
void
{
model
.
forceTokenization
(
s
.
startLineNumber
);
let
languageId
=
model
.
getLanguageIdAtPosition
(
s
.
startLineNumber
,
s
.
startColumn
);
let
config
=
LanguageConfigurationRegistry
.
getComments
(
languageId
);
if
(
!
config
||
!
config
.
blockCommentStartToken
||
!
config
.
blockCommentEndToken
)
{
...
...
src/vs/workbench/parts/emmet/node/editorAccessor.ts
浏览文件 @
df4502cd
...
...
@@ -149,6 +149,7 @@ export class EditorAccessor implements emmet.Editor {
public
getSyntaxInternal
(
overrideUsingProfiles
:
boolean
):
string
{
let
position
=
this
.
_editor
.
getSelection
().
getStartPosition
();
this
.
_editor
.
getModel
().
forceTokenization
(
position
.
lineNumber
);
let
languageId
=
this
.
_editor
.
getModel
().
getLanguageIdAtPosition
(
position
.
lineNumber
,
position
.
column
);
let
language
=
this
.
_languageIdentifierResolver
.
getLanguageIdentifier
(
languageId
).
language
;
let
syntax
=
language
.
split
(
'
.
'
).
pop
();
...
...
src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts
浏览文件 @
df4502cd
...
...
@@ -91,6 +91,7 @@ class InsertSnippetAction extends EditorAction {
if
(
langId
)
{
languageId
=
modeService
.
getLanguageIdentifier
(
langId
).
id
;
}
else
{
editor
.
getModel
().
forceTokenization
(
lineNumber
);
languageId
=
editor
.
getModel
().
getLanguageIdAtPosition
(
lineNumber
,
column
);
// validate the `languageId` to ensure this is a user
...
...
src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts
浏览文件 @
df4502cd
...
...
@@ -77,6 +77,7 @@ class SnippetsService implements ISnippetsService {
// validate the `languageId` to ensure this is a user
// facing language with a name and the chance to have
// snippets, else fall back to the outer language
model
.
forceTokenization
(
position
.
lineNumber
);
let
languageId
=
model
.
getLanguageIdAtPosition
(
position
.
lineNumber
,
position
.
column
);
let
{
language
}
=
this
.
_modeService
.
getLanguageIdentifier
(
languageId
);
if
(
!
this
.
_modeService
.
getLanguageName
(
language
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录