Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f0e70a6c
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,发现更多精彩内容 >>
提交
f0e70a6c
编写于
2月 18, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove diffSupport and dirtyDiffSupport from modes
上级
f0805c28
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
1 addition
and
88 deletion
+1
-88
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+0
-2
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+0
-26
src/vs/editor/common/modes/abstractMode.ts
src/vs/editor/common/modes/abstractMode.ts
+1
-19
src/vs/editor/common/modes/abstractModeWorker.ts
src/vs/editor/common/modes/abstractModeWorker.ts
+0
-41
未找到文件。
src/vs/editor/common/editorCommon.ts
浏览文件 @
f0e70a6c
...
...
@@ -752,8 +752,6 @@ export interface IModeSupportChangedEvent {
logicalSelectionSupport
:
boolean
;
formattingSupport
:
boolean
;
inplaceReplaceSupport
:
boolean
;
diffSupport
:
boolean
;
dirtyDiffSupport
:
boolean
;
emitOutputSupport
:
boolean
;
linkSupport
:
boolean
;
configSupport
:
boolean
;
...
...
src/vs/editor/common/modes.ts
浏览文件 @
f0e70a6c
...
...
@@ -257,16 +257,6 @@ export interface IMode {
*/
inplaceReplaceSupport
?:
IInplaceReplaceSupport
;
/**
* Optional adapter to support diff'ing two models.
*/
diffSupport
?:
IDiffSupport
;
/**
* Optional adapter to support diff'ing a model with its original version.
*/
dirtyDiffSupport
?:
IDirtyDiffSupport
;
/**
* Optional adapter to support output for a model (e.g. markdown -> html)
*/
...
...
@@ -566,22 +556,6 @@ export interface IInplaceReplaceSupport {
navigateValueSet
(
resource
:
URI
,
range
:
EditorCommon
.
IRange
,
up
:
boolean
):
TPromise
<
IInplaceReplaceSupportResult
>
;
}
/**
* Interface used to compute the diff between two models.
*/
export
interface
IDiffSupport
{
computeDiff
(
original
:
URI
,
modified
:
URI
,
ignoreTrimWhitespace
:
boolean
):
TPromise
<
EditorCommon
.
ILineChange
[]
>
;
}
/**
* Interface used to compute the diff between a model and its original version.
*/
export
interface
IDirtyDiffSupport
{
computeDirtyDiff
(
resource
:
URI
,
ignoreTrimWhitespace
:
boolean
):
TPromise
<
EditorCommon
.
IChange
[]
>
;
}
/**
* Interface used to get output for a language that supports transformation (e.g. markdown -> html)
*/
...
...
src/vs/editor/common/modes/abstractMode.ts
浏览文件 @
f0e70a6c
...
...
@@ -37,8 +37,6 @@ export class AbstractMode<W extends AbstractModeWorker> implements Modes.IMode {
public
autoValidateDelay
:
number
;
public
suggestSupport
:
Modes
.
ISuggestSupport
;
public
inplaceReplaceSupport
:
Modes
.
IInplaceReplaceSupport
;
public
diffSupport
:
Modes
.
IDiffSupport
;
public
dirtyDiffSupport
:
Modes
.
IDirtyDiffSupport
;
public
linkSupport
:
Modes
.
ILinkSupport
;
public
configSupport
:
Modes
.
IConfigurationSupport
;
public
codeLensSupport
:
Modes
.
ICodeLensSupport
;
...
...
@@ -62,8 +60,6 @@ export class AbstractMode<W extends AbstractModeWorker> implements Modes.IMode {
this
.
autoValidateDelay
=
500
;
this
.
suggestSupport
=
this
;
this
.
inplaceReplaceSupport
=
this
;
this
.
diffSupport
=
this
;
this
.
dirtyDiffSupport
=
this
;
this
.
linkSupport
=
this
;
this
.
configSupport
=
this
;
...
...
@@ -193,16 +189,6 @@ export class AbstractMode<W extends AbstractModeWorker> implements Modes.IMode {
return
this
.
_worker
((
w
)
=>
w
.
inplaceReplaceSupport
.
navigateValueSet
(
resource
,
position
,
up
));
}
static
$computeDiff
=
OneWorkerAttr
(
AbstractMode
,
AbstractMode
.
prototype
.
computeDiff
);
public
computeDiff
(
original
:
URI
,
modified
:
URI
,
ignoreTrimWhitespace
:
boolean
):
TPromise
<
EditorCommon
.
ILineChange
[]
>
{
return
this
.
_worker
((
w
)
=>
w
.
computeDiff
(
original
,
modified
,
ignoreTrimWhitespace
));
}
static
$computeDirtyDiff
=
OneWorkerAttr
(
AbstractMode
,
AbstractMode
.
prototype
.
computeDirtyDiff
);
public
computeDirtyDiff
(
resource
:
URI
,
ignoreTrimWhitespace
:
boolean
):
TPromise
<
EditorCommon
.
IChange
[]
>
{
return
this
.
_worker
((
w
)
=>
w
.
computeDirtyDiff
(
resource
,
ignoreTrimWhitespace
));
}
static
$computeLinks
=
OneWorkerAttr
(
AbstractMode
,
AbstractMode
.
prototype
.
computeLinks
);
public
computeLinks
(
resource
:
URI
):
TPromise
<
Modes
.
ILink
[]
>
{
return
this
.
_worker
((
w
)
=>
w
.
computeLinks
(
resource
));
...
...
@@ -266,7 +252,7 @@ class SimplifiedMode implements Modes.IMode {
}
private
static
_createModeSupportChangedEvent
(
originalModeEvent
:
EditorCommon
.
IModeSupportChangedEvent
):
EditorCommon
.
IModeSupportChangedEvent
{
var
event
=
{
var
event
:
EditorCommon
.
IModeSupportChangedEvent
=
{
codeLensSupport
:
false
,
tokenizationSupport
:
originalModeEvent
.
tokenizationSupport
,
occurrencesSupport
:
false
,
...
...
@@ -281,8 +267,6 @@ class SimplifiedMode implements Modes.IMode {
logicalSelectionSupport
:
false
,
formattingSupport
:
false
,
inplaceReplaceSupport
:
false
,
diffSupport
:
false
,
dirtyDiffSupport
:
false
,
emitOutputSupport
:
false
,
linkSupport
:
false
,
configSupport
:
false
,
...
...
@@ -383,8 +367,6 @@ function _createModeSupportChangedEvent(...changedSupports: string[]): EditorCom
logicalSelectionSupport
:
false
,
formattingSupport
:
false
,
inplaceReplaceSupport
:
false
,
diffSupport
:
false
,
dirtyDiffSupport
:
false
,
emitOutputSupport
:
false
,
linkSupport
:
false
,
configSupport
:
false
,
...
...
src/vs/editor/common/modes/abstractModeWorker.ts
浏览文件 @
f0e70a6c
...
...
@@ -8,9 +8,7 @@ import URI from 'vs/base/common/uri';
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IResourceService
}
from
'
vs/editor/common/services/resourceService
'
;
import
{
computeLinks
}
from
'
vs/editor/common/modes/linkComputer
'
;
import
{
DiffComputer
}
from
'
vs/editor/common/diff/diffComputer
'
;
import
{
DefaultFilter
}
from
'
vs/editor/common/modes/modesFilters
'
;
import
{
TextModel
}
from
'
vs/editor/common/model/textModel
'
;
import
{
ValidationHelper
}
from
'
vs/editor/common/worker/validationHelper
'
;
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
...
...
@@ -176,45 +174,6 @@ export class AbstractModeWorker {
return
AbstractModeWorker
.
filter
;
}
// ---- diff --------------------------------------------------------------------------
public
computeDiff
(
original
:
URI
,
modified
:
URI
,
ignoreTrimWhitespace
:
boolean
):
TPromise
<
EditorCommon
.
ILineChange
[]
>
{
var
originalModel
=
this
.
resourceService
.
get
(
original
);
var
modifiedModel
=
this
.
resourceService
.
get
(
modified
);
if
(
originalModel
!==
null
&&
modifiedModel
!==
null
)
{
var
originalLines
=
originalModel
.
getLinesContent
();
var
modifiedLines
=
modifiedModel
.
getLinesContent
();
var
diffComputer
=
new
DiffComputer
(
originalLines
,
modifiedLines
,
{
shouldPostProcessCharChanges
:
true
,
shouldIgnoreTrimWhitespace
:
ignoreTrimWhitespace
,
shouldConsiderTrimWhitespaceInEmptyCase
:
true
});
return
TPromise
.
as
(
diffComputer
.
computeDiff
());
}
return
TPromise
.
as
(
null
);
}
// ---- dirty diff --------------------------------------------------------------------
public
computeDirtyDiff
(
resource
:
URI
,
ignoreTrimWhitespace
:
boolean
):
TPromise
<
EditorCommon
.
IChange
[]
>
{
var
model
=
this
.
resourceService
.
get
(
resource
);
var
original
=
<
string
>
model
.
getProperty
(
'
original
'
);
if
(
original
&&
model
!==
null
)
{
var
splitText
=
TextModel
.
toRawText
(
original
);
var
originalLines
=
splitText
.
lines
;
var
modifiedLines
=
model
.
getLinesContent
();
var
diffComputer
=
new
DiffComputer
(
originalLines
,
modifiedLines
,
{
shouldPostProcessCharChanges
:
false
,
shouldIgnoreTrimWhitespace
:
ignoreTrimWhitespace
,
shouldConsiderTrimWhitespaceInEmptyCase
:
false
});
return
TPromise
.
as
(
diffComputer
.
computeDiff
());
}
return
TPromise
.
as
([]);
}
// ---- link detection ------------------------------------------------------------------
public
computeLinks
(
resource
:
URI
):
TPromise
<
Modes
.
ILink
[]
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录