Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
55741c8c
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
55741c8c
编写于
9月 23, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix TS adoption issues
上级
c0dd44ef
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
27 deletion
+7
-27
src/vs/editor/common/model/textModel.ts
src/vs/editor/common/model/textModel.ts
+1
-3
src/vs/workbench/api/node/extHostEditors.ts
src/vs/workbench/api/node/extHostEditors.ts
+3
-13
src/vs/workbench/services/keybinding/electron-browser/nativeKeymap.ts
...ench/services/keybinding/electron-browser/nativeKeymap.ts
+2
-10
src/vs/workbench/services/themes/electron-browser/stylesContributions.ts
...h/services/themes/electron-browser/stylesContributions.ts
+1
-1
未找到文件。
src/vs/editor/common/model/textModel.ts
浏览文件 @
55741c8c
...
...
@@ -785,9 +785,7 @@ export class TextModel extends OrderGuaranteeEventEmitter implements editorCommo
let
searchRange
:
Range
;
if
(
Range
.
isIRange
(
rawSearchScope
))
{
// @alex TS(2.0.2) - isIRange tests for IRange but all our code assumes Range which now fails.
// Kept sematic using cast. But you should check.
searchRange
=
rawSearchScope
as
Range
;
searchRange
=
this
.
validateRange
(
rawSearchScope
);
}
else
{
searchRange
=
this
.
getFullModelRange
();
}
...
...
src/vs/workbench/api/node/extHostEditors.ts
浏览文件 @
55741c8c
...
...
@@ -214,15 +214,11 @@ export class TextEditorEdit {
replace
(
location
:
Position
|
Range
|
Selection
,
value
:
string
):
void
{
let
range
:
Range
=
null
;
// @alex TS(2.0.2) - Selection is subclass of Range so the else if (location instanceof Selection) isn't reachable.
// Deleted it to keep sematic. You need to check if creating a new Range from a Selection is intended.
if
(
location
instanceof
Position
)
{
range
=
new
Range
(
location
,
location
);
}
else
if
(
location
instanceof
Range
)
{
range
=
location
;
}
/* else if (location instanceof Selection) {
range = new Range(location.start, location.end);
} */
else
{
}
else
{
throw
new
Error
(
'
Unrecognized location
'
);
}
...
...
@@ -244,13 +240,9 @@ export class TextEditorEdit {
delete
(
location
:
Range
|
Selection
):
void
{
let
range
:
Range
=
null
;
// @alex TS(2.0.2) - Selection is subclass of Range so the else if (location instanceof Selection) isn't reachable.
// Deleted it to keep sematic. You need to check if creating a new Range from a Selection is intended.
if
(
location
instanceof
Range
)
{
range
=
location
;
}
/* else if (location instanceof Selection) {
range = new Range(location.start, location.end);
} */
else
{
}
else
{
throw
new
Error
(
'
Unrecognized location
'
);
}
...
...
@@ -397,9 +389,7 @@ class ExtHostTextEditor implements vscode.TextEditor {
()
=>
this
.
_proxy
.
$tryRevealRange
(
this
.
_id
,
TypeConverters
.
fromRange
(
range
),
// @alex TS(2.0.2) - we still don't hack duck typing on enums. I added a cast since the
// values are the same. May be you want to write nicer code for this.
(
revealType
||
TextEditorRevealType
.
Default
)
as
any
(
revealType
||
TextEditorRevealType
.
Default
)
),
true
);
...
...
src/vs/workbench/services/keybinding/electron-browser/nativeKeymap.ts
浏览文件 @
55741c8c
...
...
@@ -283,11 +283,7 @@ let _b24_getActualKeyCodeMap = (function() {
if
(
nativeMapping
.
value
&&
_b24_interestingChars
[
nativeMapping
.
value
])
{
// console.log(nativeMapping.value + " is made by " + nativeMapping.key_code);
let
keyCode
=
NATIVE_KEY_CODE_TO_KEY_CODE
[
nativeMapping
.
key_code
];
// @alex TS(2.0.2) - KeyCode.Unknown === 0 so if (keyCode) is true then KeyCode !== KeyCode.Unknown
// is superflous code which is now flagged as a compile error (actually as a type check error that
// is very hard to understand)
// Will comment out the keyCode !== KeyCode.Unknown check.
if
(
keyCode
/* && keyCode !== KeyCode.Unknown */
)
{
if
(
keyCode
)
{
if
(
!
result
[
nativeMapping
.
value
]
||
result
[
nativeMapping
.
value
]
>
keyCode
)
{
result
[
nativeMapping
.
value
]
=
keyCode
;
}
...
...
@@ -297,11 +293,7 @@ let _b24_getActualKeyCodeMap = (function() {
if
(
nativeMapping
.
withShift
&&
_b24_interestingChars
[
nativeMapping
.
withShift
])
{
// console.log(nativeMapping.withShift + " is made by " + nativeMapping.key_code);
let
keyCode
=
NATIVE_KEY_CODE_TO_KEY_CODE
[
nativeMapping
.
key_code
];
// @alex TS(2.0.2) - KeyCode.Unknown === 0 so if (keyCode) is true then KeyCode !== KeyCode.Unknown
// is superflous code which is now flagged as a compile error (actually as a type check error that
// is very hard to understand)
// Will comment out the keyCode !== KeyCode.Unknown check.
if
(
keyCode
/* && keyCode !== KeyCode.Unknown */
)
{
if
(
keyCode
)
{
if
(
!
result
[
nativeMapping
.
withShift
]
||
result
[
nativeMapping
.
withShift
]
>
keyCode
)
{
result
[
nativeMapping
.
withShift
]
=
keyCode
;
}
...
...
src/vs/workbench/services/themes/electron-browser/stylesContributions.ts
浏览文件 @
55741c8c
...
...
@@ -78,7 +78,7 @@ export class TokenStylesContribution {
public
contributeStyles
(
themeId
:
string
,
themeDocument
:
IThemeDocument
,
cssRules
:
string
[]):
void
{
let
theme
=
new
Theme
(
themeId
,
themeDocument
);
theme
.
getSettings
().
forEach
((
s
:
IThemeSetting
,
index
,
arr
)
=>
{
// @
alex
TS(2.0.2) - s.scope is already a string[] so no need for all this checking.
// @
martin
TS(2.0.2) - s.scope is already a string[] so no need for all this checking.
// However will add a cast at split to keep semantic in case s.scope is wrongly typed.
let
scope
:
string
|
string
[]
=
s
.
scope
;
let
settings
=
s
.
settings
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录