Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
07574365
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,发现更多精彩内容 >>
提交
07574365
编写于
11月 19, 2019
作者:
P
Pine Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add HTML rename for #47069
上级
d630afbb
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
6 deletion
+26
-6
extensions/html-language-features/server/package.json
extensions/html-language-features/server/package.json
+1
-1
extensions/html-language-features/server/src/htmlServerMain.ts
...sions/html-language-features/server/src/htmlServerMain.ts
+15
-0
extensions/html-language-features/server/src/modes/htmlMode.ts
...sions/html-language-features/server/src/modes/htmlMode.ts
+4
-0
extensions/html-language-features/server/src/modes/languageModes.ts
.../html-language-features/server/src/modes/languageModes.ts
+2
-1
extensions/html-language-features/server/yarn.lock
extensions/html-language-features/server/yarn.lock
+4
-4
未找到文件。
extensions/html-language-features/server/package.json
浏览文件 @
07574365
...
...
@@ -10,7 +10,7 @@
"main"
:
"./out/htmlServerMain"
,
"dependencies"
:
{
"vscode-css-languageservice"
:
"^4.0.3-next.20"
,
"vscode-html-languageservice"
:
"^3.0.4-next.
8
"
,
"vscode-html-languageservice"
:
"^3.0.4-next.
9
"
,
"vscode-languageserver"
:
"^6.0.0-next.3"
,
"vscode-nls"
:
"^4.1.1"
,
"vscode-uri"
:
"^2.0.3"
...
...
extensions/html-language-features/server/src/htmlServerMain.ts
浏览文件 @
07574365
...
...
@@ -136,6 +136,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
colorProvider
:
{},
foldingRangeProvider
:
true
,
selectionRangeProvider
:
true
,
renameProvider
:
true
};
return
{
capabilities
};
});
...
...
@@ -469,6 +470,20 @@ connection.onSelectionRanges((params, token) => {
},
[],
`Error while computing selection ranges for
${
params
.
textDocument
.
uri
}
`
,
token
);
});
connection
.
onRenameRequest
((
params
,
token
)
=>
{
return
runSafe
(()
=>
{
const
document
=
documents
.
get
(
params
.
textDocument
.
uri
);
const
position
:
Position
=
params
.
position
;
if
(
document
)
{
const
htmlMode
=
languageModes
.
getMode
(
'
html
'
);
if
(
htmlMode
&&
htmlMode
.
doRename
)
{
return
htmlMode
.
doRename
(
document
,
position
,
params
.
newName
);
}
}
return
null
;
},
null
,
`Error while computing rename for
${
params
.
textDocument
.
uri
}
`
,
token
);
});
// Listen on the connection
connection
.
listen
();
extensions/html-language-features/server/src/modes/htmlMode.ts
浏览文件 @
07574365
...
...
@@ -74,6 +74,10 @@ export function getHTMLMode(htmlLanguageService: HTMLLanguageService, workspace:
}
return
null
;
},
doRename
(
document
:
TextDocument
,
position
:
Position
,
newName
:
string
)
{
const
htmlDocument
=
htmlDocuments
.
get
(
document
);
return
htmlLanguageService
.
doRename
(
document
,
position
,
newName
,
htmlDocument
);
},
onDocumentRemoved
(
document
:
TextDocument
)
{
htmlDocuments
.
onDocumentRemoved
(
document
);
},
...
...
extensions/html-language-features/server/src/modes/languageModes.ts
浏览文件 @
07574365
...
...
@@ -8,7 +8,7 @@ import {
ClientCapabilities
,
DocumentContext
,
getLanguageService
as
getHTMLLanguageService
,
IHTMLDataProvider
,
SelectionRange
,
CompletionItem
,
CompletionList
,
Definition
,
Diagnostic
,
DocumentHighlight
,
DocumentLink
,
FoldingRange
,
FormattingOptions
,
Hover
,
Location
,
Position
,
Range
,
SignatureHelp
,
SymbolInformation
,
TextDocument
,
TextEdit
,
Color
,
ColorInformation
,
ColorPresentation
Color
,
ColorInformation
,
ColorPresentation
,
WorkspaceEdit
}
from
'
vscode-html-languageservice
'
;
import
{
WorkspaceFolder
}
from
'
vscode-languageserver
'
;
import
{
getLanguageModelCache
,
LanguageModelCache
}
from
'
../languageModelCache
'
;
...
...
@@ -38,6 +38,7 @@ export interface LanguageMode {
doResolve
?:
(
document
:
TextDocument
,
item
:
CompletionItem
)
=>
CompletionItem
;
doHover
?:
(
document
:
TextDocument
,
position
:
Position
)
=>
Hover
|
null
;
doSignatureHelp
?:
(
document
:
TextDocument
,
position
:
Position
)
=>
SignatureHelp
|
null
;
doRename
?:
(
document
:
TextDocument
,
position
:
Position
,
newName
:
string
)
=>
WorkspaceEdit
|
null
;
findDocumentHighlight
?:
(
document
:
TextDocument
,
position
:
Position
)
=>
DocumentHighlight
[];
findDocumentSymbols
?:
(
document
:
TextDocument
)
=>
SymbolInformation
[];
findDocumentLinks
?:
(
document
:
TextDocument
,
documentContext
:
DocumentContext
)
=>
DocumentLink
[];
...
...
extensions/html-language-features/server/yarn.lock
浏览文件 @
07574365
...
...
@@ -621,10 +621,10 @@ vscode-css-languageservice@^4.0.3-next.20:
vscode-nls "^4.1.1"
vscode-uri "^2.1.1"
vscode-html-languageservice@^3.0.4-next.
8
:
version "3.0.4-next.
8
"
resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-3.0.4-next.
8.tgz#b3df7b7e8f69c1bf76392c4fd4df4cf483e77e7d
"
integrity sha512-
gT34wzCwM1rCJzd0EAFnuVe0FaaSr3eXaJpYcMj6rt1UspIJYaL4WtDLCcw4eBL906N1b1Vu+sapiRmV5PjZpg
==
vscode-html-languageservice@^3.0.4-next.
9
:
version "3.0.4-next.
9
"
resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-3.0.4-next.
9.tgz#b27f26c29f3af64fa32eabb7425749f95f64036a
"
integrity sha512-
9V9G7508ybFcn9gQpuucEZIGv8kKlBMEVD8lFFWwWS1yEonKchsxIGJZFbmSGr/n//2anfya8F8yL5ybKuWIRA
==
dependencies:
vscode-languageserver-textdocument "^1.0.0-next.4"
vscode-languageserver-types "^3.15.0-next.6"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录