Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5c19a6a0
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,发现更多精彩内容 >>
提交
5c19a6a0
编写于
9月 07, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use protected
上级
23bf65a7
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
34 addition
and
40 deletion
+34
-40
src/vs/editor/common/commands/shiftCommand.ts
src/vs/editor/common/commands/shiftCommand.ts
+3
-3
src/vs/editor/common/commonCodeEditor.ts
src/vs/editor/common/commonCodeEditor.ts
+4
-4
src/vs/editor/common/controller/oneCursor.ts
src/vs/editor/common/controller/oneCursor.ts
+10
-16
src/vs/editor/common/model/compatMirrorModel.ts
src/vs/editor/common/model/compatMirrorModel.ts
+1
-1
src/vs/editor/common/model/editableTextModel.ts
src/vs/editor/common/model/editableTextModel.ts
+1
-1
src/vs/editor/common/model/textModelWithDecorations.ts
src/vs/editor/common/model/textModelWithDecorations.ts
+2
-2
src/vs/editor/common/model/textModelWithMarkers.ts
src/vs/editor/common/model/textModelWithMarkers.ts
+2
-2
src/vs/editor/common/model/textModelWithTokens.ts
src/vs/editor/common/model/textModelWithTokens.ts
+8
-8
src/vs/editor/common/model/textModelWithTrackedRanges.ts
src/vs/editor/common/model/textModelWithTrackedRanges.ts
+3
-3
未找到文件。
src/vs/editor/common/commands/shiftCommand.ts
浏览文件 @
5c19a6a0
...
...
@@ -51,9 +51,9 @@ export class ShiftCommand implements ICommand {
}
public
getEditOperations
(
model
:
ITokenizedModel
,
builder
:
IEditOperationBuilder
):
void
{
let
startLine
=
this
.
_selection
.
startLineNumber
,
endLine
=
this
.
_selection
.
endLineNumber
,
_SPACE
=
'
'
.
charCodeAt
(
0
);
let
startLine
=
this
.
_selection
.
startLineNumber
;
let
endLine
=
this
.
_selection
.
endLineNumber
;
let
_SPACE
=
'
'
.
charCodeAt
(
0
);
if
(
this
.
_selection
.
endColumn
===
1
&&
startLine
!==
endLine
)
{
endLine
=
endLine
-
1
;
...
...
src/vs/editor/common/commonCodeEditor.ts
浏览文件 @
5c19a6a0
...
...
@@ -84,8 +84,8 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom
protected
id
:
number
;
_lifetimeDispose
:
IDisposable
[];
_configuration
:
CommonEditorConfiguration
;
protected
_lifetimeDispose
:
IDisposable
[];
protected
_configuration
:
CommonEditorConfiguration
;
protected
_contributions
:{
[
key
:
string
]:
editorCommon
.
IEditorContribution
;
};
protected
_actions
:{
[
key
:
string
]:
editorCommon
.
IEditorAction
;
};
...
...
@@ -705,7 +705,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom
return
this
.
_configuration
.
editor
.
layoutInfo
;
}
_attachModel
(
model
:
editorCommon
.
IModel
):
void
{
protected
_attachModel
(
model
:
editorCommon
.
IModel
):
void
{
this
.
model
=
model
?
model
:
null
;
this
.
listenersToRemove
=
[];
this
.
viewModel
=
null
;
...
...
@@ -913,7 +913,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom
protected
abstract
_getViewInternalEventBus
():
IEventEmitter
;
_postDetachModelCleanup
(
detachedModel
:
editorCommon
.
IModel
):
void
{
protected
_postDetachModelCleanup
(
detachedModel
:
editorCommon
.
IModel
):
void
{
if
(
detachedModel
)
{
this
.
_decorationTypeKeysToIds
=
{};
if
(
this
.
_decorationTypeSubtypes
)
{
...
...
src/vs/editor/common/controller/oneCursor.ts
浏览文件 @
5c19a6a0
...
...
@@ -1527,22 +1527,16 @@ export class OneCursorOp {
return
false
;
}
let
selectionContainsOnlyWhitespace
=
true
,
lineNumber
:
number
,
startIndex
:
number
,
endIndex
:
number
,
charIndex
:
number
,
charCode
:
number
,
lineText
:
string
,
_tab
=
'
\t
'
.
charCodeAt
(
0
),
_space
=
'
'
.
charCodeAt
(
0
);
for
(
lineNumber
=
selection
.
startLineNumber
;
lineNumber
<=
selection
.
endLineNumber
;
lineNumber
++
)
{
lineText
=
cursor
.
model
.
getLineContent
(
lineNumber
);
startIndex
=
(
lineNumber
===
selection
.
startLineNumber
?
selection
.
startColumn
-
1
:
0
);
endIndex
=
(
lineNumber
===
selection
.
endLineNumber
?
selection
.
endColumn
-
1
:
lineText
.
length
);
for
(
charIndex
=
startIndex
;
charIndex
<
endIndex
;
charIndex
++
)
{
charCode
=
lineText
.
charCodeAt
(
charIndex
);
let
selectionContainsOnlyWhitespace
=
true
;
let
_tab
=
'
\t
'
.
charCodeAt
(
0
);
let
_space
=
'
'
.
charCodeAt
(
0
);
for
(
let
lineNumber
=
selection
.
startLineNumber
;
lineNumber
<=
selection
.
endLineNumber
;
lineNumber
++
)
{
let
lineText
=
cursor
.
model
.
getLineContent
(
lineNumber
);
let
startIndex
=
(
lineNumber
===
selection
.
startLineNumber
?
selection
.
startColumn
-
1
:
0
);
let
endIndex
=
(
lineNumber
===
selection
.
endLineNumber
?
selection
.
endColumn
-
1
:
lineText
.
length
);
for
(
let
charIndex
=
startIndex
;
charIndex
<
endIndex
;
charIndex
++
)
{
let
charCode
=
lineText
.
charCodeAt
(
charIndex
);
if
(
charCode
!==
_tab
&&
charCode
!==
_space
)
{
selectionContainsOnlyWhitespace
=
false
;
...
...
src/vs/editor/common/model/compatMirrorModel.ts
浏览文件 @
5c19a6a0
...
...
@@ -21,7 +21,7 @@ const NO_TAB_SIZE = 0;
export
class
AbstractMirrorModel
extends
TextModelWithTokens
implements
ICompatMirrorModel
{
_associatedResource
:
URI
;
protected
_associatedResource
:
URI
;
constructor
(
allowedEventTypes
:
string
[],
versionId
:
number
,
value
:
editorCommon
.
IRawText
,
mode
:
IMode
|
TPromise
<
IMode
>
,
associatedResource
?:
URI
)
{
super
(
allowedEventTypes
.
concat
([
editorCommon
.
EventType
.
ModelDispose
]),
value
,
mode
);
...
...
src/vs/editor/common/model/editableTextModel.ts
浏览文件 @
5c19a6a0
...
...
@@ -70,7 +70,7 @@ export class EditableTextModel extends TextModelWithDecorations implements edito
super
.
dispose
();
}
_resetValue
(
e
:
editorCommon
.
IModelContentChangedFlushEvent
,
newValue
:
editorCommon
.
IRawText
):
void
{
protected
_resetValue
(
e
:
editorCommon
.
IModelContentChangedFlushEvent
,
newValue
:
editorCommon
.
IRawText
):
void
{
super
.
_resetValue
(
e
,
newValue
);
// Destroy my edit history and settings
...
...
src/vs/editor/common/model/textModelWithDecorations.ts
浏览文件 @
5c19a6a0
...
...
@@ -113,7 +113,7 @@ export class TextModelWithDecorations extends TextModelWithTrackedRanges impleme
super
.
dispose
();
}
_resetValue
(
e
:
editorCommon
.
IModelContentChangedFlushEvent
,
newValue
:
editorCommon
.
IRawText
):
void
{
protected
_resetValue
(
e
:
editorCommon
.
IModelContentChangedFlushEvent
,
newValue
:
editorCommon
.
IRawText
):
void
{
super
.
_resetValue
(
e
,
newValue
);
// Destroy all my decorations
...
...
@@ -289,7 +289,7 @@ export class TextModelWithDecorations extends TextModelWithTrackedRanges impleme
return
result
;
}
_withDeferredEvents
(
callback
:(
deferredEventsBuilder
:
DeferredEventsBuilder
)
=>
any
):
any
{
protected
_withDeferredEvents
(
callback
:(
deferredEventsBuilder
:
DeferredEventsBuilder
)
=>
any
):
any
{
return
this
.
deferredEmit
(()
=>
{
var
createDeferredEvents
=
this
.
_currentDeferredEvents
?
false
:
true
;
if
(
createDeferredEvents
)
{
...
...
src/vs/editor/common/model/textModelWithMarkers.ts
浏览文件 @
5c19a6a0
...
...
@@ -62,7 +62,7 @@ export class TextModelWithMarkers extends TextModelWithTokens implements ITextMo
super
.
dispose
();
}
_resetValue
(
e
:
IModelContentChangedFlushEvent
,
newValue
:
IRawText
):
void
{
protected
_resetValue
(
e
:
IModelContentChangedFlushEvent
,
newValue
:
IRawText
):
void
{
super
.
_resetValue
(
e
,
newValue
);
// Destroy all my markers
...
...
@@ -195,7 +195,7 @@ export class TextModelWithMarkers extends TextModelWithTokens implements ITextMo
}
}
_getMarkersInMap
(
markersMap
:{[
markerId
:
string
]:
boolean
;}):
ILineMarker
[]
{
protected
_getMarkersInMap
(
markersMap
:{[
markerId
:
string
]:
boolean
;}):
ILineMarker
[]
{
let
result
:
ILineMarker
[]
=
[];
let
keys
=
Object
.
keys
(
markersMap
);
for
(
let
i
=
0
,
len
=
keys
.
length
;
i
<
len
;
i
++
)
{
...
...
src/vs/editor/common/model/textModelWithTokens.ts
浏览文件 @
5c19a6a0
...
...
@@ -92,7 +92,7 @@ export class FullModelRetokenizer implements IRetokenizeRequest {
public
isFulfilled
:
boolean
;
_model
:
TextModelWithTokens
;
protected
_model
:
TextModelWithTokens
;
private
_retokenizePromise
:
TPromise
<
void
>
;
private
_isDisposed
:
boolean
;
...
...
@@ -302,17 +302,17 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
}
}
_createRetokenizer
(
retokenizePromise
:
TPromise
<
void
>
,
lineNumber
:
number
):
IRetokenizeRequest
{
protected
_createRetokenizer
(
retokenizePromise
:
TPromise
<
void
>
,
lineNumber
:
number
):
IRetokenizeRequest
{
return
new
FullModelRetokenizer
(
retokenizePromise
,
this
);
}
_resetValue
(
e
:
editorCommon
.
IModelContentChangedFlushEvent
,
newValue
:
editorCommon
.
IRawText
):
void
{
protected
_resetValue
(
e
:
editorCommon
.
IModelContentChangedFlushEvent
,
newValue
:
editorCommon
.
IRawText
):
void
{
super
.
_resetValue
(
e
,
newValue
);
// Cancel tokenization, clear all tokens and begin tokenizing
this
.
_resetTokenizationState
();
}
_resetMode
(
e
:
editorCommon
.
IModelModeChangedEvent
,
newMode
:
IMode
):
void
{
protected
_resetMode
(
e
:
editorCommon
.
IModelModeChangedEvent
,
newMode
:
IMode
):
void
{
// Cancel tokenization, clear all tokens and begin tokenizing
this
.
_mode
=
newMode
;
this
.
_resetModeListener
(
newMode
);
...
...
@@ -339,7 +339,7 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
}
}
_resetTokenizationState
():
void
{
protected
_resetTokenizationState
():
void
{
this
.
_retokenizers
=
dispose
(
this
.
_retokenizers
);
this
.
_scheduleRetokenizeNow
.
cancel
();
this
.
_clearTimers
();
...
...
@@ -397,7 +397,7 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
return
new
LineContext
(
this
.
getModeId
(),
this
.
_lines
[
lineNumber
-
1
],
this
.
_tokensInflatorMap
);
}
_getInternalTokens
(
lineNumber
:
number
):
editorCommon
.
ILineTokens
{
protected
_getInternalTokens
(
lineNumber
:
number
):
editorCommon
.
ILineTokens
{
this
.
_updateTokensUntilLine
(
lineNumber
,
true
);
return
this
.
_lines
[
lineNumber
-
1
].
getTokens
(
this
.
_tokensInflatorMap
);
}
...
...
@@ -454,7 +454,7 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
}
}
_invalidateLine
(
lineIndex
:
number
):
void
{
protected
_invalidateLine
(
lineIndex
:
number
):
void
{
this
.
_lines
[
lineIndex
].
isInvalid
=
true
;
if
(
lineIndex
<
this
.
_invalidLineStartIndex
)
{
if
(
this
.
_invalidLineStartIndex
<
this
.
_lines
.
length
)
{
...
...
@@ -685,7 +685,7 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
return
this
.
_invalidLineStartIndex
>
lineNumber
-
1
;
}
_getWordDefinition
():
RegExp
{
protected
_getWordDefinition
():
RegExp
{
return
WordHelper
.
massageWordDefinitionOf
(
this
.
getModeId
());
}
...
...
src/vs/editor/common/model/textModelWithTrackedRanges.ts
浏览文件 @
5c19a6a0
...
...
@@ -85,7 +85,7 @@ export class TextModelWithTrackedRanges extends TextModelWithMarkers implements
this
.
_multiLineTrackedRanges
=
{};
}
_createRetokenizer
(
retokenizePromise
:
TPromise
<
void
>
,
lineNumber
:
number
):
IRetokenizeRequest
{
protected
_createRetokenizer
(
retokenizePromise
:
TPromise
<
void
>
,
lineNumber
:
number
):
IRetokenizeRequest
{
return
new
TrackedRangeModelRetokenizer
(
retokenizePromise
,
lineNumber
,
this
);
}
...
...
@@ -96,7 +96,7 @@ export class TextModelWithTrackedRanges extends TextModelWithMarkers implements
super
.
dispose
();
}
_resetValue
(
e
:
editorCommon
.
IModelContentChangedFlushEvent
,
newValue
:
editorCommon
.
IRawText
):
void
{
protected
_resetValue
(
e
:
editorCommon
.
IModelContentChangedFlushEvent
,
newValue
:
editorCommon
.
IRawText
):
void
{
super
.
_resetValue
(
e
,
newValue
);
// Destroy all my tracked ranges
...
...
@@ -346,7 +346,7 @@ export class TextModelWithTrackedRanges extends TextModelWithMarkers implements
return
result
;
}
_onChangedMarkers
(
changedMarkers
:
ILineMarker
[]):
editorCommon
.
IChangedTrackedRanges
{
protected
_onChangedMarkers
(
changedMarkers
:
ILineMarker
[]):
editorCommon
.
IChangedTrackedRanges
{
var
changedRanges
:
editorCommon
.
IChangedTrackedRanges
=
{},
changedRange
:
editorCommon
.
IRange
,
range
:
ITrackedRange
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录