Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f1c7c19a
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,发现更多精彩内容 >>
提交
f1c7c19a
编写于
10月 01, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixing some strict mode typing issues in emmet
上级
86ceb0c8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
19 deletion
+19
-19
extensions/emmet/src/abbreviationActions.ts
extensions/emmet/src/abbreviationActions.ts
+2
-2
extensions/emmet/src/test/cssAbbreviationAction.test.ts
extensions/emmet/src/test/cssAbbreviationAction.test.ts
+14
-14
extensions/emmet/src/typings/EmmetNode.d.ts
extensions/emmet/src/typings/EmmetNode.d.ts
+3
-3
未找到文件。
extensions/emmet/src/abbreviationActions.ts
浏览文件 @
f1c7c19a
...
@@ -216,7 +216,7 @@ function doWrapping(individualLines: boolean, args: any) {
...
@@ -216,7 +216,7 @@ function doWrapping(individualLines: boolean, args: any) {
}
}
return
''
;
return
''
;
}
}
const
abbreviationPromise
=
(
args
&&
args
[
'
abbreviation
'
])
?
Promise
.
resolve
(
args
[
'
abbreviation
'
])
:
vscode
.
window
.
showInputBox
({
prompt
:
'
Enter Abbreviation
'
,
validateInput
:
inputChanged
});
const
abbreviationPromise
:
Thenable
<
string
|
undefined
>
=
(
args
&&
args
[
'
abbreviation
'
])
?
Promise
.
resolve
(
args
[
'
abbreviation
'
])
:
vscode
.
window
.
showInputBox
({
prompt
:
'
Enter Abbreviation
'
,
validateInput
:
inputChanged
});
return
abbreviationPromise
.
then
(
inputAbbreviation
=>
{
return
abbreviationPromise
.
then
(
inputAbbreviation
=>
{
return
makeChanges
(
inputAbbreviation
,
true
);
return
makeChanges
(
inputAbbreviation
,
true
);
});
});
...
@@ -637,7 +637,7 @@ function expandAbbr(input: ExpandAbbreviationInput): string | undefined {
...
@@ -637,7 +637,7 @@ function expandAbbr(input: ExpandAbbreviationInput): string | undefined {
}
}
function
getSyntaxFromArgs
(
args
:
Object
):
string
|
undefined
{
function
getSyntaxFromArgs
(
args
:
{
[
x
:
string
]:
string
}
):
string
|
undefined
{
const
mappedModes
=
getMappingForIncludedLanguages
();
const
mappedModes
=
getMappingForIncludedLanguages
();
const
language
:
string
=
args
[
'
language
'
];
const
language
:
string
=
args
[
'
language
'
];
const
parentMode
:
string
=
args
[
'
parentMode
'
];
const
parentMode
:
string
=
args
[
'
parentMode
'
];
...
...
extensions/emmet/src/test/cssAbbreviationAction.test.ts
浏览文件 @
f1c7c19a
...
@@ -406,7 +406,7 @@ nav#
...
@@ -406,7 +406,7 @@ nav#
return
Promise
.
resolve
();
return
Promise
.
resolve
();
}
}
const
callBack
=
(
completionList
:
CompletionList
,
abbreviation
,
expandedText
)
=>
{
const
callBack
=
(
completionList
:
CompletionList
,
abbreviation
:
string
,
expandedText
:
string
)
=>
{
if
(
!
completionList
.
items
||
!
completionList
.
items
.
length
)
{
if
(
!
completionList
.
items
||
!
completionList
.
items
.
length
)
{
assert
.
equal
(
1
,
2
,
`Problem with expanding m10`
);
assert
.
equal
(
1
,
2
,
`Problem with expanding m10`
);
return
;
return
;
...
@@ -473,7 +473,7 @@ m10
...
@@ -473,7 +473,7 @@ m10
editor
.
selection
=
new
Selection
(
5
,
15
,
5
,
15
);
// in the value part of property value
editor
.
selection
=
new
Selection
(
5
,
15
,
5
,
15
);
// in the value part of property value
completionPromise
=
completionProvider
.
provideCompletionItems
(
editor
.
document
,
editor
.
selection
.
active
,
cancelSrc
.
token
,
{
triggerKind
:
CompletionTriggerKind
.
Invoke
});
completionPromise
=
completionProvider
.
provideCompletionItems
(
editor
.
document
,
editor
.
selection
.
active
,
cancelSrc
.
token
,
{
triggerKind
:
CompletionTriggerKind
.
Invoke
});
if
(
completionPromise
)
{
if
(
completionPromise
)
{
return
completionPromise
.
then
((
completionList
:
CompletionList
)
=>
{
return
completionPromise
.
then
((
completionList
:
CompletionList
|
undefined
)
=>
{
if
(
completionList
&&
completionList
.
items
&&
completionList
.
items
.
length
>
0
)
{
if
(
completionList
&&
completionList
.
items
&&
completionList
.
items
.
length
>
0
)
{
assert
.
equal
(
1
,
2
,
`m10 gets expanded in invalid location (n the value part of property value)`
);
assert
.
equal
(
1
,
2
,
`m10 gets expanded in invalid location (n the value part of property value)`
);
}
}
...
@@ -486,18 +486,18 @@ m10
...
@@ -486,18 +486,18 @@ m10
});
});
test
(
'
Skip when typing property values when there is a nested rule in the next line (SCSS)
'
,
()
=>
{
test
(
'
Skip when typing property values when there is a nested rule in the next line (SCSS)
'
,
()
=>
{
return
withRandomFileEditor
(
scssContents
,
'
scss
'
,
(
editor
,
doc
)
=>
{
return
withRandomFileEditor
(
scssContents
,
'
scss
'
,
(
editor
,
doc
)
=>
{
editor
.
selection
=
new
Selection
(
19
,
10
,
19
,
10
);
editor
.
selection
=
new
Selection
(
19
,
10
,
19
,
10
);
return
expandEmmetAbbreviation
(
null
).
then
(()
=>
{
return
expandEmmetAbbreviation
(
null
).
then
(()
=>
{
assert
.
equal
(
editor
.
document
.
getText
(),
scssContents
);
assert
.
equal
(
editor
.
document
.
getText
(),
scssContents
);
const
cancelSrc
=
new
CancellationTokenSource
();
const
cancelSrc
=
new
CancellationTokenSource
();
const
completionPromise
=
completionProvider
.
provideCompletionItems
(
editor
.
document
,
new
Position
(
19
,
10
),
cancelSrc
.
token
,
{
triggerKind
:
CompletionTriggerKind
.
Invoke
});
const
completionPromise
=
completionProvider
.
provideCompletionItems
(
editor
.
document
,
new
Position
(
19
,
10
),
cancelSrc
.
token
,
{
triggerKind
:
CompletionTriggerKind
.
Invoke
});
if
(
completionPromise
)
{
if
(
completionPromise
)
{
assert
.
equal
(
1
,
2
,
`Invalid completion at property value`
);
assert
.
equal
(
1
,
2
,
`Invalid completion at property value`
);
}
}
return
Promise
.
resolve
();
return
Promise
.
resolve
();
});
});
});
});
});
});
extensions/emmet/src/typings/EmmetNode.d.ts
浏览文件 @
f1c7c19a
...
@@ -26,7 +26,7 @@ declare module 'EmmetNode' {
...
@@ -26,7 +26,7 @@ declare module 'EmmetNode' {
export
interface
CssToken
extends
Token
{
export
interface
CssToken
extends
Token
{
size
:
number
size
:
number
item
(
number
):
any
item
(
number
:
number
):
any
type
:
string
type
:
string
}
}
...
@@ -85,8 +85,8 @@ declare module 'EmmetNode' {
...
@@ -85,8 +85,8 @@ declare module 'EmmetNode' {
backUp
(
n
:
number
):
number
backUp
(
n
:
number
):
number
current
():
string
current
():
string
substring
(
from
:
Position
,
to
:
Position
):
string
substring
(
from
:
Position
,
to
:
Position
):
string
eat
(
match
):
boolean
eat
(
match
:
any
):
boolean
eatWhile
(
match
):
boolean
eatWhile
(
match
:
any
):
boolean
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录