Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
09bfb693
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,发现更多精彩内容 >>
提交
09bfb693
编写于
7月 29, 2019
作者:
P
Pine Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Fix #70731"
This reverts commit
c25e395a
.
上级
5caff73e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
87 deletion
+32
-87
extensions/emmet/.vscode/launch.json
extensions/emmet/.vscode/launch.json
+20
-30
extensions/emmet/package.json
extensions/emmet/package.json
+3
-4
extensions/emmet/src/defaultCompletionProvider.ts
extensions/emmet/src/defaultCompletionProvider.ts
+8
-28
extensions/emmet/src/test/abbreviationAction.test.ts
extensions/emmet/src/test/abbreviationAction.test.ts
+1
-1
extensions/emmet/yarn.lock
extensions/emmet/yarn.lock
+0
-24
未找到文件。
extensions/emmet/.vscode/launch.json
浏览文件 @
09bfb693
{
//
Use
IntelliSense
to
learn
about
possible
Node.js
debug
attributes.
//
Hover
to
view
descriptions
of
existing
attributes.
//
For
more
information
,
visit:
https://go.microsoft.com/fwlink/?linkid=
830387
"version"
:
"0.2.0"
,
"configurations"
:
[
{
"type"
:
"extensionHost"
,
"request"
:
"launch"
,
"name"
:
"Launch Extension"
,
"runtimeExecutable"
:
"${execPath}"
,
"args"
:
[
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps"
:
true
,
"outFiles"
:
[
"${workspaceFolder}/out/**/*.js"
]
},
{
"type"
:
"extensionHost"
,
"request"
:
"launch"
,
"name"
:
"Launch Tests"
,
"runtimeExecutable"
:
"${execPath}"
,
"args"
:
[
"--extensionDevelopmentPath=${workspaceFolder}"
,
"--extensionTestsPath=${workspaceFolder}/out/test"
,
"--disable-extensions"
,
"--skip-getting-started"
,
],
"sourceMaps"
:
true
,
"outFiles"
:
[
"${workspaceFolder}/out/**/*.js"
]
}
]
}
//
Use
IntelliSense
to
learn
about
possible
Node.js
debug
attributes.
//
Hover
to
view
descriptions
of
existing
attributes.
//
For
more
information
,
visit:
https://go.microsoft.com/fwlink/?linkid=
830387
"version"
:
"0.2.0"
,
"configurations"
:
[
{
"type"
:
"extensionHost"
,
"request"
:
"launch"
,
"name"
:
"Launch Extension"
,
"runtimeExecutable"
:
"${execPath}"
,
"args"
:
[
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps"
:
true
,
"outFiles"
:
[
"${workspaceFolder}/out/**/*.js"
]
}
]
}
\ No newline at end of file
extensions/emmet/package.json
浏览文件 @
09bfb693
...
...
@@ -3,8 +3,8 @@
"displayName"
:
"Emmet"
,
"description"
:
"%description%"
,
"version"
:
"1.0.0"
,
"publisher"
:
"vscode"
,
"license"
:
"MIT"
,
"publisher"
:
"vscode"
,
"license"
:
"MIT"
,
"engines"
:
{
"vscode"
:
"^1.13.0"
},
...
...
@@ -450,7 +450,6 @@
"@emmetio/html-matcher"
:
"^0.3.3"
,
"@emmetio/math-expression"
:
"^0.1.1"
,
"image-size"
:
"^0.5.2"
,
"vscode-emmet-helper"
:
"^1.2.15"
,
"vscode-html-languageservice"
:
"^3.0.3"
"vscode-emmet-helper"
:
"^1.2.15"
}
}
extensions/emmet/src/defaultCompletionProvider.ts
浏览文件 @
09bfb693
...
...
@@ -6,15 +6,12 @@
import
*
as
vscode
from
'
vscode
'
;
import
{
Node
,
Stylesheet
}
from
'
EmmetNode
'
;
import
{
isValidLocationForEmmetAbbreviation
}
from
'
./abbreviationActions
'
;
import
{
getEmmetHelper
,
getMappingForIncludedLanguages
,
parsePartialStylesheet
,
getEmmetConfiguration
,
getEmmetMode
,
isStyleSheet
,
parseDocument
,
getNode
}
from
'
./util
'
;
import
{
getLanguageService
,
TextDocument
,
TokenType
}
from
'
vscode-html-languageservice
'
;
import
{
getEmmetHelper
,
getMappingForIncludedLanguages
,
parsePartialStylesheet
,
getEmmetConfiguration
,
getEmmetMode
,
isStyleSheet
,
parseDocument
,
getEmbeddedCssNodeIfAny
,
isStyleAttribute
,
getNode
}
from
'
./util
'
;
export
class
DefaultCompletionItemProvider
implements
vscode
.
CompletionItemProvider
{
private
lastCompletionType
:
string
|
undefined
;
private
htmlLS
=
getLanguageService
();
public
provideCompletionItems
(
document
:
vscode
.
TextDocument
,
position
:
vscode
.
Position
,
_
:
vscode
.
CancellationToken
,
context
:
vscode
.
CompletionContext
):
Thenable
<
vscode
.
CompletionList
|
undefined
>
|
undefined
{
const
completionResult
=
this
.
provideCompletionItemsInternal
(
document
,
position
,
context
);
if
(
!
completionResult
)
{
...
...
@@ -79,37 +76,20 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
}
if
(
validateLocation
)
{
const
lsDoc
=
TextDocument
.
create
(
document
.
uri
.
toString
(),
'
html
'
,
0
,
document
.
getText
());
const
parsedLsDoc
=
this
.
htmlLS
.
parseHTMLDocument
(
lsDoc
);
const
positionOffset
=
document
.
offsetAt
(
position
);
const
node
=
parsedLsDoc
.
findNodeAt
(
positionOffset
);
if
(
node
.
tag
===
'
script
'
)
{
return
;
}
if
(
node
.
tag
===
'
style
'
)
{
rootNode
=
parseDocument
(
document
,
false
);
currentNode
=
getNode
(
rootNode
,
position
,
true
);
if
(
isStyleAttribute
(
currentNode
,
position
))
{
syntax
=
'
css
'
;
validateLocation
=
false
;
}
else
{
if
(
node
.
attributes
&&
node
.
attributes
[
'
style
'
])
{
const
scanner
=
this
.
htmlLS
.
createScanner
(
document
.
getText
(),
node
.
start
);
let
tokenType
=
scanner
.
scan
();
let
prevAttr
=
undefined
;
while
(
tokenType
!==
TokenType
.
EOS
&&
(
scanner
.
getTokenEnd
()
<=
positionOffset
))
{
tokenType
=
scanner
.
scan
();
if
(
tokenType
===
TokenType
.
AttributeName
)
{
prevAttr
=
scanner
.
getTokenText
();
}
}
if
(
prevAttr
===
'
style
'
)
{
syntax
=
'
css
'
;
validateLocation
=
false
;
}
const
embeddedCssNode
=
getEmbeddedCssNodeIfAny
(
document
,
currentNode
,
position
);
if
(
embeddedCssNode
)
{
currentNode
=
getNode
(
embeddedCssNode
,
position
,
true
);
syntax
=
'
css
'
;
}
}
}
}
const
extractAbbreviationResults
=
helper
.
extractAbbreviation
(
document
,
position
,
!
isStyleSheet
(
syntax
));
...
...
extensions/emmet/src/test/abbreviationAction.test.ts
浏览文件 @
09bfb693
...
...
@@ -269,7 +269,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
editor
.
selection
=
new
Selection
(
13
,
14
,
13
,
14
);
const
cancelSrc
=
new
CancellationTokenSource
();
const
completionPromise
=
completionProvider
.
provideCompletionItems
(
editor
.
document
,
editor
.
selection
.
active
,
cancelSrc
.
token
,
{
triggerKind
:
CompletionTriggerKind
.
Invoke
});
assert
.
equal
(
!
completionPromise
,
true
,
`Got unexpected completion promise instead of undefined`
);
assert
.
equal
(
!
completionPromise
,
true
,
`Got unexpected com
a
pletion promise instead of undefined`
);
return
Promise
.
resolve
();
});
});
...
...
extensions/emmet/yarn.lock
浏览文件 @
09bfb693
...
...
@@ -2478,35 +2478,11 @@ vscode-emmet-helper@^1.2.15:
jsonc-parser "^1.0.0"
vscode-languageserver-types "^3.6.0-next.1"
vscode-html-languageservice@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-3.0.3.tgz#0aeae18a59000e317447ea34965f72680a2140ef"
integrity sha512-U+upM3gHp3HaF3wXAnUduA6IDKcz6frWS/dTAju3cZVIyZwOLBBFElQVlLH0ycHyMzqUFrjvdv+kEyPAEWfQ/g==
dependencies:
vscode-languageserver-types "^3.15.0-next.2"
vscode-nls "^4.1.1"
vscode-uri "^2.0.3"
vscode-languageserver-types@^3.15.0-next.2:
version "3.15.0-next.2"
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0-next.2.tgz#a0601332cdaafac21931f497bb080cfb8d73f254"
integrity sha512-2JkrMWWUi2rlVLSo9OFR2PIGUzdiowEM8NgNYiwLKnXTjpwpjjIrJbNNxDik7Rv4oo9KtikcFQZKXbrKilL/MQ==
vscode-languageserver-types@^3.6.0-next.1:
version "3.6.0-next.1"
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.6.0-next.1.tgz#98e488d3f87b666b4ee1a3d89f0023e246d358f3"
integrity sha512-n4G+hCgZwAhtcJSCkwJP153TLdcEBWwrIrb3Su/SpOkhmU7KjDgxaQBLA45hf+QbhB8uKQb+TVStPvbuYFHSMA==
vscode-nls@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c"
integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A==
vscode-uri@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.0.3.tgz#25e5f37f552fbee3cec7e5f80cef8469cefc6543"
integrity sha512-4D3DI3F4uRy09WNtDGD93H9q034OHImxiIcSq664Hq1Y1AScehlP3qqZyTkX/RWxeu0MRMHGkrxYqm2qlDF/aw==
vscode@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/vscode/-/vscode-1.0.1.tgz#3d161200615fe2af1d92ddc650751159411a513b"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录