Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
78a2f08d
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,发现更多精彩内容 >>
提交
78a2f08d
编写于
3月 02, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename to RenameInformation, #7340
上级
f0784a39
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
12 deletion
+12
-12
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+2
-2
src/vs/editor/contrib/rename/rename.ts
src/vs/editor/contrib/rename/rename.ts
+3
-3
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+2
-2
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
...kbench/api/electron-browser/mainThreadLanguageFeatures.ts
+1
-1
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/api/node/extHostLanguageFeatures.ts
src/vs/workbench/api/node/extHostLanguageFeatures.ts
+3
-3
未找到文件。
src/vs/editor/common/modes.ts
浏览文件 @
78a2f08d
...
...
@@ -917,14 +917,14 @@ export interface WorkspaceEdit {
rejectReason
?:
string
;
// TODO@joh, move to rename
}
export
interface
RenameIn
itialValue
{
export
interface
RenameIn
formation
{
range
:
IRange
;
text
?:
string
;
}
export
interface
RenameProvider
{
provideRenameEdits
(
model
:
model
.
ITextModel
,
position
:
Position
,
newName
:
string
,
token
:
CancellationToken
):
WorkspaceEdit
|
Thenable
<
WorkspaceEdit
>
;
resolveInitialRenameValue
?(
model
:
model
.
ITextModel
,
position
:
Position
,
token
:
CancellationToken
):
RenameIn
itialValue
|
Thenable
<
RenameInitialValue
>
;
resolveInitialRenameValue
?(
model
:
model
.
ITextModel
,
position
:
Position
,
token
:
CancellationToken
):
RenameIn
formation
|
Thenable
<
RenameInformation
>
;
}
...
...
src/vs/editor/contrib/rename/rename.ts
浏览文件 @
78a2f08d
...
...
@@ -23,7 +23,7 @@ import { ITextModelService } from 'vs/editor/common/services/resolverService';
import
{
optional
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
sequence
,
asWinJsPromise
}
from
'
vs/base/common/async
'
;
import
{
WorkspaceEdit
,
RenameProviderRegistry
,
RenameIn
itialValue
}
from
'
vs/editor/common/modes
'
;
import
{
WorkspaceEdit
,
RenameProviderRegistry
,
RenameIn
formation
}
from
'
vs/editor/common/modes
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
alert
}
from
'
vs/base/browser/ui/aria/aria
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
...
...
@@ -81,7 +81,7 @@ export function rename(model: ITextModel, position: Position, newName: string):
// TODO@joh
// merge this into above function to make we always
// use the same provider for resolving and renamin
function
resolveInitialRenameValue
(
model
:
ITextModel
,
position
:
Position
):
TPromise
<
RenameIn
itialValue
>
{
function
resolveInitialRenameValue
(
model
:
ITextModel
,
position
:
Position
):
TPromise
<
RenameIn
formation
>
{
const
[
first
]
=
RenameProviderRegistry
.
ordered
(
model
);
if
(
!
first
||
typeof
first
.
resolveInitialRenameValue
!==
'
function
'
)
{
return
TPromise
.
as
(
null
);
...
...
@@ -91,7 +91,7 @@ function resolveInitialRenameValue(model: ITextModel, position: Position): TProm
return
!
result
?
undefined
:
result
;
},
err
=>
{
onUnexpectedExternalError
(
err
);
return
TPromise
.
wrapError
<
RenameIn
itialValue
>
(
new
Error
(
'
provider failed
'
));
return
TPromise
.
wrapError
<
RenameIn
formation
>
(
new
Error
(
'
provider failed
'
));
});
}
...
...
src/vs/monaco.d.ts
浏览文件 @
78a2f08d
...
...
@@ -4964,14 +4964,14 @@ declare module monaco.languages {
rejectReason
?:
string
;
}
export
interface
RenameIn
itialValue
{
export
interface
RenameIn
formation
{
range
:
IRange
;
text
?:
string
;
}
export
interface
RenameProvider
{
provideRenameEdits
(
model
:
editor
.
ITextModel
,
position
:
Position
,
newName
:
string
,
token
:
CancellationToken
):
WorkspaceEdit
|
Thenable
<
WorkspaceEdit
>
;
resolveInitialRenameValue
?(
model
:
editor
.
ITextModel
,
position
:
Position
,
token
:
CancellationToken
):
RenameIn
itialValue
|
Thenable
<
RenameInitialValue
>
;
resolveInitialRenameValue
?(
model
:
editor
.
ITextModel
,
position
:
Position
,
token
:
CancellationToken
):
RenameIn
formation
|
Thenable
<
RenameInformation
>
;
}
export
interface
Command
{
...
...
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
浏览文件 @
78a2f08d
...
...
@@ -257,7 +257,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideRenameEdits
(
handle
,
model
.
uri
,
position
,
newName
)).
then
(
reviveWorkspaceEditDto
);
},
resolveInitialRenameValue
:
supportsResolveInitialValues
?
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Thenable
<
modes
.
RenameIn
itialValue
>
=>
wireCancellationToken
(
token
,
this
.
_proxy
.
$resolveInitialRenameValue
(
handle
,
model
.
uri
,
position
))
?
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Thenable
<
modes
.
RenameIn
formation
>
=>
wireCancellationToken
(
token
,
this
.
_proxy
.
$resolveInitialRenameValue
(
handle
,
model
.
uri
,
position
))
:
undefined
});
}
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
78a2f08d
...
...
@@ -692,7 +692,7 @@ export interface ExtHostLanguageFeaturesShape {
$resolveWorkspaceSymbol
(
handle
:
number
,
symbol
:
SymbolInformationDto
):
TPromise
<
SymbolInformationDto
>
;
$releaseWorkspaceSymbols
(
handle
:
number
,
id
:
number
):
void
;
$provideRenameEdits
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
newName
:
string
):
TPromise
<
WorkspaceEditDto
>
;
$resolveInitialRenameValue
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
):
TPromise
<
modes
.
RenameIn
itialValue
>
;
$resolveInitialRenameValue
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
):
TPromise
<
modes
.
RenameIn
formation
>
;
$provideCompletionItems
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
context
:
modes
.
SuggestContext
):
TPromise
<
SuggestResultDto
>
;
$resolveCompletionItem
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
suggestion
:
modes
.
ISuggestion
):
TPromise
<
modes
.
ISuggestion
>
;
$releaseCompletionItems
(
handle
:
number
,
id
:
number
):
void
;
...
...
src/vs/workbench/api/node/extHostLanguageFeatures.ts
浏览文件 @
78a2f08d
...
...
@@ -514,7 +514,7 @@ class RenameAdapter {
});
}
resolveInitialRenameValue
(
resource
:
URI
,
position
:
IPosition
):
TPromise
<
modes
.
RenameIn
itialValue
>
{
resolveInitialRenameValue
(
resource
:
URI
,
position
:
IPosition
):
TPromise
<
modes
.
RenameIn
formation
>
{
if
(
typeof
this
.
_provider
.
resolveInitialRenameValue
!==
'
function
'
)
{
return
TPromise
.
as
(
undefined
);
}
...
...
@@ -523,7 +523,7 @@ class RenameAdapter {
let
pos
=
TypeConverters
.
toPosition
(
position
);
return
asWinJsPromise
(
token
=>
this
.
_provider
.
resolveInitialRenameValue
(
doc
,
pos
,
token
)).
then
((
value
)
=>
{
return
<
modes
.
RenameIn
itialValue
>
{
return
<
modes
.
RenameIn
formation
>
{
range
:
TypeConverters
.
fromRange
(
value
.
range
),
text
:
value
.
text
};
...
...
@@ -1061,7 +1061,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return
this
.
_withAdapter
(
handle
,
RenameAdapter
,
adapter
=>
adapter
.
provideRenameEdits
(
URI
.
revive
(
resource
),
position
,
newName
));
}
$resolveInitialRenameValue
(
handle
:
number
,
resource
:
URI
,
position
:
IPosition
):
TPromise
<
modes
.
RenameIn
itialValue
>
{
$resolveInitialRenameValue
(
handle
:
number
,
resource
:
URI
,
position
:
IPosition
):
TPromise
<
modes
.
RenameIn
formation
>
{
return
this
.
_withAdapter
(
handle
,
RenameAdapter
,
adapter
=>
adapter
.
resolveInitialRenameValue
(
resource
,
position
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录