Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
bf634bf4
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,发现更多精彩内容 >>
提交
bf634bf4
编写于
7月 24, 2017
作者:
R
Ramya Achutha Rao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Renaming utilties for clarity
上级
76392ae9
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
33 addition
and
33 deletion
+33
-33
extensions/emmet/src/abbreviationActions.ts
extensions/emmet/src/abbreviationActions.ts
+2
-2
extensions/emmet/src/balance.ts
extensions/emmet/src/balance.ts
+2
-2
extensions/emmet/src/defaultCompletionProvider.ts
extensions/emmet/src/defaultCompletionProvider.ts
+2
-2
extensions/emmet/src/matchTag.ts
extensions/emmet/src/matchTag.ts
+2
-2
extensions/emmet/src/mergeLines.ts
extensions/emmet/src/mergeLines.ts
+2
-2
extensions/emmet/src/reflectCssValue.ts
extensions/emmet/src/reflectCssValue.ts
+3
-3
extensions/emmet/src/removeTag.ts
extensions/emmet/src/removeTag.ts
+2
-2
extensions/emmet/src/selectItem.ts
extensions/emmet/src/selectItem.ts
+2
-2
extensions/emmet/src/splitJoinTag.ts
extensions/emmet/src/splitJoinTag.ts
+2
-2
extensions/emmet/src/toggleComment.ts
extensions/emmet/src/toggleComment.ts
+2
-2
extensions/emmet/src/updateImageSize.ts
extensions/emmet/src/updateImageSize.ts
+6
-6
extensions/emmet/src/updateTag.ts
extensions/emmet/src/updateTag.ts
+2
-2
extensions/emmet/src/util.ts
extensions/emmet/src/util.ts
+4
-4
未找到文件。
extensions/emmet/src/abbreviationActions.ts
浏览文件 @
bf634bf4
...
...
@@ -6,7 +6,7 @@
import
*
as
vscode
from
'
vscode
'
;
import
{
expand
}
from
'
@emmetio/expand-abbreviation
'
;
import
{
Node
,
HtmlNode
,
Rule
}
from
'
EmmetNode
'
;
import
{
getNode
,
getInnerRange
,
getMappingForIncludedLanguages
,
parse
,
validate
}
from
'
./util
'
;
import
{
getNode
,
getInnerRange
,
getMappingForIncludedLanguages
,
parse
Document
,
validate
}
from
'
./util
'
;
import
{
getExpandOptions
,
extractAbbreviation
,
isStyleSheet
,
isAbbreviationValid
,
getEmmetMode
}
from
'
vscode-emmet-helper
'
;
interface
ExpandAbbreviationInput
{
...
...
@@ -88,7 +88,7 @@ export function expandAbbreviation(args) {
const
editor
=
vscode
.
window
.
activeTextEditor
;
let
rootNode
=
parse
(
editor
.
document
);
let
rootNode
=
parse
Document
(
editor
.
document
);
if
(
!
rootNode
)
{
return
;
}
...
...
extensions/emmet/src/balance.ts
浏览文件 @
bf634bf4
...
...
@@ -5,7 +5,7 @@
import
*
as
vscode
from
'
vscode
'
;
import
{
HtmlNode
}
from
'
EmmetNode
'
;
import
{
getNode
,
parse
,
validate
}
from
'
./util
'
;
import
{
getNode
,
parse
Document
,
validate
}
from
'
./util
'
;
export
function
balanceOut
()
{
balance
(
true
);
...
...
@@ -21,7 +21,7 @@ function balance(out: boolean) {
return
;
}
let
rootNode
=
<
HtmlNode
>
parse
(
editor
.
document
);
let
rootNode
=
<
HtmlNode
>
parse
Document
(
editor
.
document
);
if
(
!
rootNode
)
{
return
;
}
...
...
extensions/emmet/src/defaultCompletionProvider.ts
浏览文件 @
bf634bf4
...
...
@@ -7,7 +7,7 @@ import * as vscode from 'vscode';
import
{
HtmlNode
}
from
'
EmmetNode
'
;
import
{
doComplete
,
isStyleSheet
,
getEmmetMode
}
from
'
vscode-emmet-helper
'
;
import
{
isValidLocationForEmmetAbbreviation
}
from
'
./abbreviationActions
'
;
import
{
getNode
,
getInnerRange
,
getMappingForIncludedLanguages
,
parse
,
getEmmetConfiguration
}
from
'
./util
'
;
import
{
getNode
,
getInnerRange
,
getMappingForIncludedLanguages
,
parse
Document
,
getEmmetConfiguration
}
from
'
./util
'
;
export
class
DefaultCompletionItemProvider
implements
vscode
.
CompletionItemProvider
{
...
...
@@ -61,7 +61,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
if
(
!
syntax
)
{
return
syntax
;
}
let
rootNode
=
parse
(
document
,
false
);
let
rootNode
=
parse
Document
(
document
,
false
);
if
(
!
rootNode
)
{
return
;
}
...
...
extensions/emmet/src/matchTag.ts
浏览文件 @
bf634bf4
...
...
@@ -5,7 +5,7 @@
import
*
as
vscode
from
'
vscode
'
;
import
{
HtmlNode
}
from
'
EmmetNode
'
;
import
{
getNode
,
parse
,
validate
}
from
'
./util
'
;
import
{
getNode
,
parse
Document
,
validate
}
from
'
./util
'
;
export
function
matchTag
()
{
let
editor
=
vscode
.
window
.
activeTextEditor
;
...
...
@@ -13,7 +13,7 @@ export function matchTag() {
return
;
}
let
rootNode
=
<
HtmlNode
>
parse
(
editor
.
document
);
let
rootNode
=
<
HtmlNode
>
parse
Document
(
editor
.
document
);
if
(
!
rootNode
)
{
return
;
}
...
...
extensions/emmet/src/mergeLines.ts
浏览文件 @
bf634bf4
...
...
@@ -5,7 +5,7 @@
import
*
as
vscode
from
'
vscode
'
;
import
{
Node
}
from
'
EmmetNode
'
;
import
{
getNode
,
parse
,
validate
}
from
'
./util
'
;
import
{
getNode
,
parse
Document
,
validate
}
from
'
./util
'
;
export
function
mergeLines
()
{
let
editor
=
vscode
.
window
.
activeTextEditor
;
...
...
@@ -13,7 +13,7 @@ export function mergeLines() {
return
;
}
let
rootNode
=
parse
(
editor
.
document
);
let
rootNode
=
parse
Document
(
editor
.
document
);
if
(
!
rootNode
)
{
return
;
}
...
...
extensions/emmet/src/reflectCssValue.ts
浏览文件 @
bf634bf4
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
Range
,
window
,
TextEditor
}
from
'
vscode
'
;
import
{
getCssProperty
,
getCssPropertyNode
}
from
'
./util
'
;
import
{
getCssProperty
FromRule
,
getCssPropertyFromDocument
}
from
'
./util
'
;
import
{
Property
,
Rule
}
from
'
EmmetNode
'
;
const
vendorPrefixes
=
[
'
-webkit-
'
,
'
-moz-
'
,
'
-ms-
'
,
'
-o-
'
,
''
];
...
...
@@ -16,7 +16,7 @@ export function reflectCssValue() {
return
;
}
let
node
=
getCssProperty
Node
(
editor
,
editor
.
selection
.
active
);
let
node
=
getCssProperty
FromDocument
(
editor
,
editor
.
selection
.
active
);
if
(
!
node
)
{
return
;
}
...
...
@@ -45,7 +45,7 @@ function updateCSSNode(editor: TextEditor, property: Property) {
if
(
prefix
===
currentPrefix
)
{
return
;
}
let
vendorProperty
=
getCssProperty
(
rule
,
prefix
+
propertyName
);
let
vendorProperty
=
getCssProperty
FromRule
(
rule
,
prefix
+
propertyName
);
if
(
vendorProperty
)
{
builder
.
replace
(
new
Range
(
vendorProperty
.
valueToken
.
start
,
vendorProperty
.
valueToken
.
end
),
propertyValue
);
}
...
...
extensions/emmet/src/removeTag.ts
浏览文件 @
bf634bf4
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
vscode
from
'
vscode
'
;
import
{
parse
,
validate
,
getNode
}
from
'
./util
'
;
import
{
parse
Document
,
validate
,
getNode
}
from
'
./util
'
;
import
{
HtmlNode
}
from
'
EmmetNode
'
;
export
function
removeTag
()
{
...
...
@@ -13,7 +13,7 @@ export function removeTag() {
return
;
}
let
rootNode
=
<
HtmlNode
>
parse
(
editor
.
document
);
let
rootNode
=
<
HtmlNode
>
parse
Document
(
editor
.
document
);
if
(
!
rootNode
)
{
return
;
}
...
...
extensions/emmet/src/selectItem.ts
浏览文件 @
bf634bf4
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
vscode
from
'
vscode
'
;
import
{
validate
,
parse
}
from
'
./util
'
;
import
{
validate
,
parse
Document
}
from
'
./util
'
;
import
{
nextItemHTML
,
prevItemHTML
}
from
'
./selectItemHTML
'
;
import
{
nextItemStylesheet
,
prevItemStylesheet
}
from
'
./selectItemStylesheet
'
;
import
{
isStyleSheet
}
from
'
vscode-emmet-helper
'
;
...
...
@@ -27,7 +27,7 @@ export function fetchSelectItem(direction: string): void {
prevItem
=
prevItemHTML
;
}
let
rootNode
=
parse
(
editor
.
document
);
let
rootNode
=
parse
Document
(
editor
.
document
);
if
(
!
rootNode
)
{
return
;
}
...
...
extensions/emmet/src/splitJoinTag.ts
浏览文件 @
bf634bf4
...
...
@@ -5,7 +5,7 @@
import
*
as
vscode
from
'
vscode
'
;
import
Node
from
'
@emmetio/node
'
;
import
{
getNode
,
parse
,
validate
}
from
'
./util
'
;
import
{
getNode
,
parse
Document
,
validate
}
from
'
./util
'
;
export
function
splitJoinTag
()
{
let
editor
=
vscode
.
window
.
activeTextEditor
;
...
...
@@ -13,7 +13,7 @@ export function splitJoinTag() {
return
;
}
let
rootNode
=
parse
(
editor
.
document
);
let
rootNode
=
parse
Document
(
editor
.
document
);
if
(
!
rootNode
)
{
return
;
}
...
...
extensions/emmet/src/toggleComment.ts
浏览文件 @
bf634bf4
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
vscode
from
'
vscode
'
;
import
{
getNodesInBetween
,
getNode
,
parse
}
from
'
./util
'
;
import
{
getNodesInBetween
,
getNode
,
parse
Document
}
from
'
./util
'
;
import
{
Node
,
Stylesheet
}
from
'
EmmetNode
'
;
import
{
isStyleSheet
}
from
'
vscode-emmet-helper
'
;
...
...
@@ -34,7 +34,7 @@ export function toggleComment() {
endComment
=
endCommentHTML
;
}
let
rootNode
=
parse
(
editor
.
document
);
let
rootNode
=
parse
Document
(
editor
.
document
);
if
(
!
rootNode
)
{
return
;
}
...
...
extensions/emmet/src/updateImageSize.ts
浏览文件 @
bf634bf4
...
...
@@ -11,7 +11,7 @@ import { TextEditor, Range, Position, window } from 'vscode';
import
*
as
path
from
'
path
'
;
import
{
getImageSize
}
from
'
./imageSizeHelper
'
;
import
{
isStyleSheet
}
from
'
vscode-emmet-helper
'
;
import
{
parse
,
getNode
,
iterateCSSToken
,
getCssProperty
}
from
'
./util
'
;
import
{
parse
Document
,
getNode
,
iterateCSSToken
,
getCssPropertyFromRule
}
from
'
./util
'
;
import
{
HtmlNode
,
CssToken
,
HtmlToken
,
Attribute
,
Property
}
from
'
EmmetNode
'
;
import
{
locateFile
}
from
'
./locateFile
'
;
import
parseStylesheet
from
'
@emmetio/css-parser
'
;
...
...
@@ -59,7 +59,7 @@ function updateImageSizeHTML(editor: TextEditor) {
function
updateImageSizeStyleTag
(
editor
:
TextEditor
)
{
let
getPropertyInsiderStyleTag
=
(
editor
)
=>
{
const
rootNode
=
parse
(
editor
.
document
);
const
rootNode
=
parse
Document
(
editor
.
document
);
const
currentNode
=
<
HtmlNode
>
getNode
(
rootNode
,
editor
.
selection
.
active
);
if
(
currentNode
&&
currentNode
.
name
===
'
style
'
&&
currentNode
.
open
.
end
.
isBefore
(
editor
.
selection
.
active
)
...
...
@@ -109,7 +109,7 @@ function updateImageSizeCSS(editor: TextEditor, fetchNode: (editor) => Property)
* @return {HtmlNode}
*/
function
getImageHTMLNode
(
editor
:
TextEditor
):
HtmlNode
{
const
rootNode
=
parse
(
editor
.
document
);
const
rootNode
=
parse
Document
(
editor
.
document
);
const
node
=
<
HtmlNode
>
getNode
(
rootNode
,
editor
.
selection
.
active
,
true
);
return
node
&&
node
.
name
.
toLowerCase
()
===
'
img
'
?
node
:
null
;
...
...
@@ -122,7 +122,7 @@ function getImageHTMLNode(editor: TextEditor): HtmlNode {
* @return {Property}
*/
function
getImageCSSNode
(
editor
:
TextEditor
):
Property
{
const
rootNode
=
parse
(
editor
.
document
);
const
rootNode
=
parse
Document
(
editor
.
document
);
const
node
=
getNode
(
rootNode
,
editor
.
selection
.
active
,
true
);
return
node
&&
node
.
type
===
'
property
'
?
<
Property
>
node
:
null
;
}
...
...
@@ -213,8 +213,8 @@ function updateHTMLTag(editor: TextEditor, node: HtmlNode, width: number, height
*/
function
updateCSSNode
(
editor
:
TextEditor
,
srcProp
:
Property
,
width
:
number
,
height
:
number
)
{
const
rule
=
srcProp
.
parent
;
const
widthProp
=
getCssProperty
(
rule
,
'
width
'
);
const
heightProp
=
getCssProperty
(
rule
,
'
height
'
);
const
widthProp
=
getCssProperty
FromRule
(
rule
,
'
width
'
);
const
heightProp
=
getCssProperty
FromRule
(
rule
,
'
height
'
);
// Detect formatting
const
separator
=
srcProp
.
separator
||
'
:
'
;
...
...
extensions/emmet/src/updateTag.ts
浏览文件 @
bf634bf4
...
...
@@ -5,14 +5,14 @@
import
*
as
vscode
from
'
vscode
'
;
import
{
HtmlNode
}
from
'
EmmetNode
'
;
import
{
getNode
,
parse
,
validate
}
from
'
./util
'
;
import
{
getNode
,
parse
Document
,
validate
}
from
'
./util
'
;
export
function
updateTag
(
tagName
:
string
):
Thenable
<
boolean
>
{
let
editor
=
vscode
.
window
.
activeTextEditor
;
if
(
!
validate
(
false
))
{
return
;
}
let
rootNode
=
<
HtmlNode
>
parse
(
editor
.
document
);
let
rootNode
=
<
HtmlNode
>
parse
Document
(
editor
.
document
);
if
(
!
rootNode
)
{
return
;
}
...
...
extensions/emmet/src/util.ts
浏览文件 @
bf634bf4
...
...
@@ -63,7 +63,7 @@ export function getMappingForIncludedLanguages(): any {
* Parses the given document using emmet parsing modules
* @param document
*/
export
function
parse
(
document
:
vscode
.
TextDocument
,
showError
:
boolean
=
true
):
Node
{
export
function
parse
Document
(
document
:
vscode
.
TextDocument
,
showError
:
boolean
=
true
):
Node
{
let
parseContent
=
isStyleSheet
(
document
.
languageId
)
?
parseStylesheet
:
parse
;
let
rootNode
:
Node
;
try
{
...
...
@@ -283,7 +283,7 @@ export function iterateCSSToken(token: CssToken, fn) {
* @param {String} name
* @return {Property}
*/
export
function
getCssProperty
(
rule
,
name
):
Property
{
export
function
getCssProperty
FromRule
(
rule
,
name
):
Property
{
return
rule
.
children
.
find
(
node
=>
node
.
type
===
'
property
'
&&
node
.
name
===
name
);
}
...
...
@@ -293,8 +293,8 @@ export function getCssProperty(rule, name): Property {
* @param {TextEditor} editor
* @return {Property}
*/
export
function
getCssProperty
Node
(
editor
:
vscode
.
TextEditor
,
position
:
vscode
.
Position
):
Property
{
const
rootNode
=
this
.
parse
(
editor
.
document
);
export
function
getCssProperty
FromDocument
(
editor
:
vscode
.
TextEditor
,
position
:
vscode
.
Position
):
Property
{
const
rootNode
=
parseDocument
(
editor
.
document
);
const
node
=
getNode
(
rootNode
,
position
);
if
(
isStyleSheet
(
editor
.
document
.
languageId
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录