Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
1547d80b
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,发现更多精彩内容 >>
提交
1547d80b
编写于
5月 06, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove more editor options
上级
26769ff0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
10 addition
and
68 deletion
+10
-68
src/vs/editor/common/commonCodeEditor.ts
src/vs/editor/common/commonCodeEditor.ts
+1
-2
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+0
-11
src/vs/editor/common/config/defaultConfig.ts
src/vs/editor/common/config/defaultConfig.ts
+0
-3
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+4
-34
src/vs/editor/common/model/textModel.ts
src/vs/editor/common/model/textModel.ts
+4
-3
src/vs/editor/common/model/textModelWithTokens.ts
src/vs/editor/common/model/textModelWithTokens.ts
+1
-15
未找到文件。
src/vs/editor/common/commonCodeEditor.ts
浏览文件 @
1547d80b
...
...
@@ -669,8 +669,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements IActionPr
if
(
this
.
model
)
{
this
.
domElement
.
setAttribute
(
'
data-mode-id
'
,
this
.
model
.
getMode
().
getId
());
this
.
_langIdKey
.
set
(
this
.
model
.
getMode
().
getId
());
this
.
model
.
setStopLineTokenizationAfter
(
this
.
_configuration
.
editor
.
stopLineTokenizationAfter
);
this
.
_configuration
.
setIsDominatedByLongLines
(
this
.
model
.
isDominatedByLongLines
(
this
.
_configuration
.
editor
.
longLineBoundary
));
this
.
_configuration
.
setIsDominatedByLongLines
(
this
.
model
.
isDominatedByLongLines
());
this
.
model
.
onBeforeAttached
();
...
...
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
1547d80b
...
...
@@ -78,15 +78,6 @@ class InternalEditorOptionsHelper {
let
wrappingColumn
=
toInteger
(
opts
.
wrappingColumn
,
-
1
);
let
stopLineTokenizationAfter
:
number
;
if
(
typeof
opts
.
stopLineTokenizationAfter
!==
'
undefined
'
)
{
stopLineTokenizationAfter
=
toInteger
(
opts
.
stopLineTokenizationAfter
,
-
1
);
}
else
if
(
wrappingColumn
>=
0
)
{
stopLineTokenizationAfter
=
-
1
;
}
else
{
stopLineTokenizationAfter
=
10000
;
}
let
stopRenderingLineAfter
:
number
;
if
(
typeof
opts
.
stopRenderingLineAfter
!==
'
undefined
'
)
{
stopRenderingLineAfter
=
toInteger
(
opts
.
stopRenderingLineAfter
,
-
1
);
...
...
@@ -201,8 +192,6 @@ class InternalEditorOptionsHelper {
});
return
new
editorCommon
.
InternalEditorOptions
({
stopLineTokenizationAfter
:
stopLineTokenizationAfter
,
longLineBoundary
:
toInteger
(
opts
.
longLineBoundary
),
lineHeight
:
fontInfo
.
lineHeight
,
// todo -> duplicated in styling
readOnly
:
readOnly
,
wordSeparators
:
String
(
opts
.
wordSeparators
),
...
...
src/vs/editor/common/config/defaultConfig.ts
浏览文件 @
1547d80b
...
...
@@ -69,9 +69,6 @@ class ConfigClass implements IConfiguration {
wordWrapBreakAfterCharacters
:
'
\t
})]?|&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー’”〉》」』】〕)]}」
'
,
wordWrapBreakObtrusiveCharacters
:
'
.
'
,
tabFocusMode
:
false
,
// stopLineTokenizationAfter
// stopRenderingLineAfter
longLineBoundary
:
300
,
// Features
hover
:
true
,
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
1547d80b
...
...
@@ -408,24 +408,12 @@ export interface IEditorOptions {
*/
tabFocusMode
?:
boolean
;
/**
* Performance guard: Stop tokenizing a line after x characters.
* Defaults to 10000 if wrappingColumn is -1. Defaults to -1 if wrappingColumn is >= 0.
* Use -1 to never stop tokenization.
*/
stopLineTokenizationAfter
?:
number
;
/**
* Performance guard: Stop rendering a line after x characters.
* Defaults to 10000 if wrappingColumn is -1. Defaults to -1 if wrappingColumn is >= 0.
* Use -1 to never stop rendering
*/
stopRenderingLineAfter
?:
number
;
/**
* Performance guard: Force viewport width wrapping if more than half of the
* characters in a model are on lines of length >= `longLineBoundary`.
* Defaults to 300.
*/
longLineBoundary
?:
number
;
/**
* Enable hover.
* Defaults to true.
...
...
@@ -900,8 +888,6 @@ export class EditorContribOptions {
export
class
InternalEditorOptions
{
_internalEditorOptionsBrand
:
void
;
stopLineTokenizationAfter
:
number
;
// todo: move to model opts
longLineBoundary
:
number
;
// todo: move to model opts
lineHeight
:
number
;
// todo: move to fontInfo
readOnly
:
boolean
;
...
...
@@ -918,8 +904,6 @@ export class InternalEditorOptions {
contribInfo
:
EditorContribOptions
;
constructor
(
source
:
{
stopLineTokenizationAfter
:
number
;
longLineBoundary
:
number
;
lineHeight
:
number
;
readOnly
:
boolean
;
wordSeparators
:
string
;
...
...
@@ -932,8 +916,6 @@ export class InternalEditorOptions {
wrappingInfo
:
EditorWrappingInfo
;
contribInfo
:
EditorContribOptions
;
})
{
this
.
stopLineTokenizationAfter
=
source
.
stopLineTokenizationAfter
|
0
;
this
.
longLineBoundary
=
source
.
longLineBoundary
|
0
;
this
.
lineHeight
=
source
.
lineHeight
|
0
;
this
.
readOnly
=
Boolean
(
source
.
readOnly
);
this
.
wordSeparators
=
String
(
source
.
wordSeparators
);
...
...
@@ -949,9 +931,7 @@ export class InternalEditorOptions {
public
equals
(
other
:
InternalEditorOptions
):
boolean
{
return
(
this
.
stopLineTokenizationAfter
===
other
.
stopLineTokenizationAfter
&&
this
.
longLineBoundary
===
other
.
longLineBoundary
&&
this
.
lineHeight
===
other
.
lineHeight
this
.
lineHeight
===
other
.
lineHeight
&&
this
.
readOnly
===
other
.
readOnly
&&
this
.
wordSeparators
===
other
.
wordSeparators
&&
this
.
autoClosingBrackets
===
other
.
autoClosingBrackets
...
...
@@ -967,8 +947,6 @@ export class InternalEditorOptions {
public
createChangeEvent
(
newOpts
:
InternalEditorOptions
):
IConfigurationChangedEvent
{
return
{
stopLineTokenizationAfter
:
(
this
.
stopLineTokenizationAfter
!==
newOpts
.
stopLineTokenizationAfter
),
longLineBoundary
:
(
this
.
longLineBoundary
!==
newOpts
.
longLineBoundary
),
lineHeight
:
(
this
.
lineHeight
!==
newOpts
.
lineHeight
),
readOnly
:
(
this
.
readOnly
!==
newOpts
.
readOnly
),
wordSeparators
:
(
this
.
wordSeparators
!==
newOpts
.
wordSeparators
),
...
...
@@ -992,8 +970,6 @@ export class InternalEditorOptions {
* An event describing that the configuration of the editor has changed.
*/
export
interface
IConfigurationChangedEvent
{
stopLineTokenizationAfter
:
boolean
;
longLineBoundary
:
boolean
;
lineHeight
:
boolean
;
readOnly
:
boolean
;
wordSeparators
:
boolean
;
...
...
@@ -1546,11 +1522,11 @@ export interface ITextModel {
/**
* Splits characters in two buckets. First bucket (A) is of characters that
* sit in lines with length < `
longLineBoundary
`. Second bucket (B) is of
* characters that sit in lines with length >= `
longLineBoundary
`.
* sit in lines with length < `
LONG_LINE_BOUNDARY
`. Second bucket (B) is of
* characters that sit in lines with length >= `
LONG_LINE_BOUNDARY
`.
* If count(B) > count(A) return true. Returns false otherwise.
*/
isDominatedByLongLines
(
longLineBoundary
:
number
):
boolean
;
isDominatedByLongLines
():
boolean
;
/**
* Get the number of lines in the model.
...
...
@@ -1650,12 +1626,6 @@ export interface IFoundBracket {
*/
export
interface
ITokenizedModel
extends
ITextModel
{
/**
* Set the value at which to stop tokenization.
* The default is 10000.
*/
setStopLineTokenizationAfter
(
stopLineTokenizationAfter
:
number
):
void
;
/**
* Tokenize if necessary and get the tokens for the line `lineNumber`.
* @param lineNumber The line number
...
...
src/vs/editor/common/model/textModel.ts
浏览文件 @
1547d80b
...
...
@@ -14,6 +14,7 @@ import {guessIndentation} from 'vs/editor/common/model/indentationGuesser';
import
{
DEFAULT_INDENTATION
,
DEFAULT_TRIM_AUTO_WHITESPACE
}
from
'
vs/editor/common/config/defaultConfig
'
;
var
LIMIT_FIND_COUNT
=
999
;
export
const
LONG_LINE_BOUNDARY
=
1000
;
export
class
TextModel
extends
OrderGuaranteeEventEmitter
implements
editorCommon
.
ITextModel
{
...
...
@@ -21,8 +22,8 @@ export class TextModel extends OrderGuaranteeEventEmitter implements editorCommo
tabSize
:
DEFAULT_INDENTATION
.
tabSize
,
insertSpaces
:
DEFAULT_INDENTATION
.
insertSpaces
,
detectIndentation
:
false
,
defaultEOL
:
editorCommon
.
DefaultEndOfLine
.
LF
,
trimAutoWhitespace
:
DEFAULT_TRIM_AUTO_WHITESPACE
,
defaultEOL
:
editorCommon
.
DefaultEndOfLine
.
LF
};
_lines
:
ModelLine
[];
...
...
@@ -382,7 +383,7 @@ export class TextModel extends OrderGuaranteeEventEmitter implements editorCommo
return
result
;
}
public
isDominatedByLongLines
(
longLineBoundary
:
number
):
boolean
{
public
isDominatedByLongLines
():
boolean
{
var
smallLineCharCount
=
0
,
longLineCharCount
=
0
,
i
:
number
,
...
...
@@ -392,7 +393,7 @@ export class TextModel extends OrderGuaranteeEventEmitter implements editorCommo
for
(
i
=
0
,
len
=
this
.
_lines
.
length
;
i
<
len
;
i
++
)
{
lineLength
=
lines
[
i
].
text
.
length
;
if
(
lineLength
>=
longLineBoundary
)
{
if
(
lineLength
>=
LONG_LINE_BOUNDARY
)
{
longLineCharCount
+=
lineLength
;
}
else
{
smallLineCharCount
+=
lineLength
;
...
...
src/vs/editor/common/model/textModelWithTokens.ts
浏览文件 @
1547d80b
...
...
@@ -11,7 +11,6 @@ import {IDisposable, dispose} from 'vs/base/common/lifecycle';
import
{
StopWatch
}
from
'
vs/base/common/stopwatch
'
;
import
*
as
timer
from
'
vs/base/common/timer
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
DefaultConfig
}
from
'
vs/editor/common/config/defaultConfig
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
ModelLine
}
from
'
vs/editor/common/model/modelLine
'
;
...
...
@@ -178,7 +177,6 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
private
_modeListener
:
IDisposable
;
private
_modeToModelBinder
:
ModeToModelBinder
;
private
_tokensInflatorMap
:
TokensInflatorMap
;
private
_stopLineTokenizationAfter
:
number
;
private
_invalidLineStartIndex
:
number
;
private
_lastState
:
IState
;
...
...
@@ -201,7 +199,6 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
this
.
_modeListener
=
null
;
this
.
_modeToModelBinder
=
null
;
this
.
_tokensInflatorMap
=
null
;
this
.
_stopLineTokenizationAfter
=
DefaultConfig
.
editor
.
stopLineTokenizationAfter
;
this
.
_invalidLineStartIndex
=
0
;
this
.
_lastState
=
null
;
...
...
@@ -404,10 +401,6 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
this
.
_beginBackgroundTokenization
();
}
public
setStopLineTokenizationAfter
(
stopLineTokenizationAfter
:
number
):
void
{
this
.
_stopLineTokenizationAfter
=
stopLineTokenizationAfter
;
}
public
getLineTokens
(
lineNumber
:
number
,
inaccurateTokensAcceptable
:
boolean
=
false
):
editorCommon
.
ILineTokens
{
if
(
lineNumber
<
1
||
lineNumber
>
this
.
getLineCount
())
{
throw
new
Error
(
'
Illegal value
'
+
lineNumber
+
'
for `lineNumber`
'
);
...
...
@@ -589,7 +582,6 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
tokenizedChars
=
0
,
currentCharsToTokenize
=
0
,
currentEstimatedTimeToTokenize
=
0
,
stopLineTokenizationAfter
=
this
.
_stopLineTokenizationAfter
,
sw
=
StopWatch
.
create
(
false
),
elapsedTime
:
number
;
...
...
@@ -607,9 +599,6 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
// Compute how many characters will be tokenized for this line
currentCharsToTokenize
=
this
.
_lines
[
lineNumber
-
1
].
text
.
length
;
if
(
stopLineTokenizationAfter
!==
-
1
&&
currentCharsToTokenize
>
stopLineTokenizationAfter
)
{
currentCharsToTokenize
=
stopLineTokenizationAfter
;
}
if
(
tokenizedChars
>
0
)
{
// If we have enough history, estimate how long tokenizing this line would take
...
...
@@ -659,10 +648,7 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
private
_updateTokensUntilLine
(
lineNumber
:
number
,
emitEvents
:
boolean
):
void
{
var
linesLength
=
this
.
_lines
.
length
;
var
endLineIndex
=
lineNumber
-
1
;
var
stopLineTokenizationAfter
=
this
.
_stopLineTokenizationAfter
;
if
(
stopLineTokenizationAfter
===
-
1
)
{
stopLineTokenizationAfter
=
1000000000
;
// 1 billion, if a line is so long, you have other trouble :).
}
var
stopLineTokenizationAfter
=
1000000000
;
// 1 billion, if a line is so long, you have other trouble :).
var
fromLineNumber
=
this
.
_invalidLineStartIndex
+
1
,
toLineNumber
=
lineNumber
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录