Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
32da48e7
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,体验更适合开发者的 AI 搜索 >>
提交
32da48e7
编写于
8月 05, 2019
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
consistent dto namings
上级
41df3bcb
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
217 addition
and
217 deletion
+217
-217
src/vs/workbench/api/browser/mainThreadEditors.ts
src/vs/workbench/api/browser/mainThreadEditors.ts
+2
-2
src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts
src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts
+41
-41
src/vs/workbench/api/browser/mainThreadTerminalService.ts
src/vs/workbench/api/browser/mainThreadTerminalService.ts
+2
-2
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+95
-95
src/vs/workbench/api/common/extHostApiCommands.ts
src/vs/workbench/api/common/extHostApiCommands.ts
+2
-2
src/vs/workbench/api/common/extHostCommands.ts
src/vs/workbench/api/common/extHostCommands.ts
+3
-3
src/vs/workbench/api/common/extHostDocumentSaveParticipant.ts
...vs/workbench/api/common/extHostDocumentSaveParticipant.ts
+2
-2
src/vs/workbench/api/common/extHostFileSystemEventService.ts
src/vs/workbench/api/common/extHostFileSystemEventService.ts
+2
-2
src/vs/workbench/api/common/extHostLanguageFeatures.ts
src/vs/workbench/api/common/extHostLanguageFeatures.ts
+43
-43
src/vs/workbench/api/common/extHostSCM.ts
src/vs/workbench/api/common/extHostSCM.ts
+2
-2
src/vs/workbench/api/common/extHostTypeConverters.ts
src/vs/workbench/api/common/extHostTypeConverters.ts
+12
-12
src/vs/workbench/api/node/extHostTerminalService.ts
src/vs/workbench/api/node/extHostTerminalService.ts
+2
-2
src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts
...ectron-browser/api/extHostDocumentSaveParticipant.test.ts
+6
-6
src/vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts
...ench/test/electron-browser/api/extHostTextEditors.test.ts
+3
-3
未找到文件。
src/vs/workbench/api/browser/mainThreadEditors.ts
浏览文件 @
32da48e7
...
...
@@ -20,7 +20,7 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
MainThreadDocumentsAndEditors
}
from
'
vs/workbench/api/browser/mainThreadDocumentsAndEditors
'
;
import
{
MainThreadTextEditor
}
from
'
vs/workbench/api/browser/mainThreadEditor
'
;
import
{
ExtHostContext
,
ExtHostEditorsShape
,
IApplyEditsOptions
,
IExtHostContext
,
ITextDocumentShowOptions
,
ITextEditorConfigurationUpdate
,
ITextEditorPositionData
,
IUndoStopOptions
,
MainThreadTextEditorsShape
,
TextEditorRevealType
,
WorkspaceEditDto
,
reviveWorkspaceEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ExtHostContext
,
ExtHostEditorsShape
,
IApplyEditsOptions
,
IExtHostContext
,
ITextDocumentShowOptions
,
ITextEditorConfigurationUpdate
,
ITextEditorPositionData
,
IUndoStopOptions
,
MainThreadTextEditorsShape
,
TextEditorRevealType
,
I
WorkspaceEditDto
,
reviveWorkspaceEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
EditorViewColumn
,
editorGroupToViewColumn
,
viewColumnToEditorGroup
}
from
'
vs/workbench/api/common/shared/editor
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
...
...
@@ -212,7 +212,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
return
Promise
.
resolve
(
editor
.
applyEdits
(
modelVersionId
,
edits
,
opts
));
}
$tryApplyWorkspaceEdit
(
dto
:
WorkspaceEditDto
):
Promise
<
boolean
>
{
$tryApplyWorkspaceEdit
(
dto
:
I
WorkspaceEditDto
):
Promise
<
boolean
>
{
const
{
edits
}
=
reviveWorkspaceEditDto
(
dto
);
return
this
.
_bulkEditService
.
apply
({
edits
},
undefined
).
then
(()
=>
true
,
err
=>
false
);
}
...
...
src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts
浏览文件 @
32da48e7
此差异已折叠。
点击以展开。
src/vs/workbench/api/browser/mainThreadTerminalService.ts
浏览文件 @
32da48e7
...
...
@@ -5,7 +5,7 @@
import
{
IDisposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
ITerminalService
,
ITerminalInstance
,
IShellLaunchConfig
,
ITerminalProcessExtHostProxy
,
ISpawnExtHostProcessRequest
,
ITerminalDimensions
,
EXT_HOST_CREATION_DELAY
,
IAvailableShellsRequest
,
IDefaultShellAndArgsRequest
,
IStartExtensionTerminalRequest
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
ExtHostContext
,
ExtHostTerminalServiceShape
,
MainThreadTerminalServiceShape
,
MainContext
,
IExtHostContext
,
ShellLaunchConfigDto
,
TerminalLaunchConfig
,
ITerminalDimensionsDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ExtHostContext
,
ExtHostTerminalServiceShape
,
MainThreadTerminalServiceShape
,
MainContext
,
IExtHostContext
,
I
ShellLaunchConfigDto
,
TerminalLaunchConfig
,
ITerminalDimensionsDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
'
vs/workbench/api/common/extHostCustomers
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
StopWatch
}
from
'
vs/base/common/stopwatch
'
;
...
...
@@ -254,7 +254,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
}
else
{
this
.
_terminalProcesses
.
set
(
proxy
.
terminalId
,
Promise
.
resolve
(
proxy
));
}
const
shellLaunchConfigDto
:
ShellLaunchConfigDto
=
{
const
shellLaunchConfigDto
:
I
ShellLaunchConfigDto
=
{
name
:
request
.
shellLaunchConfig
.
name
,
executable
:
request
.
shellLaunchConfig
.
executable
,
args
:
request
.
shellLaunchConfig
.
args
,
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
32da48e7
此差异已折叠。
点击以展开。
src/vs/workbench/api/common/extHostApiCommands.ts
浏览文件 @
32da48e7
...
...
@@ -8,7 +8,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import
*
as
vscode
from
'
vscode
'
;
import
*
as
typeConverters
from
'
vs/workbench/api/common/extHostTypeConverters
'
;
import
*
as
types
from
'
vs/workbench/api/common/extHostTypes
'
;
import
{
IRawColorInfo
,
WorkspaceEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
IRawColorInfo
,
I
WorkspaceEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ISingleEditOperation
}
from
'
vs/editor/common/model
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
*
as
search
from
'
vs/workbench/contrib/search/common/search
'
;
...
...
@@ -362,7 +362,7 @@ export class ExtHostApiCommands {
position
:
position
&&
typeConverters
.
Position
.
from
(
position
),
newName
};
return
this
.
_commands
.
executeCommand
<
WorkspaceEditDto
>
(
'
_executeDocumentRenameProvider
'
,
args
).
then
(
value
=>
{
return
this
.
_commands
.
executeCommand
<
I
WorkspaceEditDto
>
(
'
_executeDocumentRenameProvider
'
,
args
).
then
(
value
=>
{
if
(
!
value
)
{
return
undefined
;
}
...
...
src/vs/workbench/api/common/extHostCommands.ts
浏览文件 @
32da48e7
...
...
@@ -8,7 +8,7 @@ import { ICommandHandlerDescription, ICommandEvent } from 'vs/platform/commands/
import
*
as
extHostTypes
from
'
vs/workbench/api/common/extHostTypes
'
;
import
*
as
extHostTypeConverter
from
'
vs/workbench/api/common/extHostTypeConverters
'
;
import
{
cloneAndChange
}
from
'
vs/base/common/objects
'
;
import
{
MainContext
,
MainThreadCommandsShape
,
ExtHostCommandsShape
,
ObjectIdentifier
,
IMainContext
,
CommandDto
}
from
'
./extHost.protocol
'
;
import
{
MainContext
,
MainThreadCommandsShape
,
ExtHostCommandsShape
,
ObjectIdentifier
,
IMainContext
,
I
CommandDto
}
from
'
./extHost.protocol
'
;
import
{
isNonEmptyArray
}
from
'
vs/base/common/arrays
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
*
as
vscode
from
'
vscode
'
;
...
...
@@ -228,13 +228,13 @@ export class CommandsConverter {
this
.
_commands
.
registerCommand
(
true
,
this
.
_delegatingCommandId
,
this
.
_executeConvertedCommand
,
this
);
}
toInternal
(
command
:
vscode
.
Command
|
undefined
,
disposables
:
DisposableStore
):
CommandDto
|
undefined
{
toInternal
(
command
:
vscode
.
Command
|
undefined
,
disposables
:
DisposableStore
):
I
CommandDto
|
undefined
{
if
(
!
command
)
{
return
undefined
;
}
const
result
:
CommandDto
=
{
const
result
:
I
CommandDto
=
{
$ident
:
undefined
,
id
:
command
.
command
,
title
:
command
.
title
,
...
...
src/vs/workbench/api/common/extHostDocumentSaveParticipant.ts
浏览文件 @
32da48e7
...
...
@@ -7,7 +7,7 @@ import { Event } from 'vs/base/common/event';
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
sequence
}
from
'
vs/base/common/async
'
;
import
{
illegalState
}
from
'
vs/base/common/errors
'
;
import
{
ExtHostDocumentSaveParticipantShape
,
MainThreadTextEditorsShape
,
ResourceTextEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ExtHostDocumentSaveParticipantShape
,
MainThreadTextEditorsShape
,
I
ResourceTextEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
TextEdit
}
from
'
vs/workbench/api/common/extHostTypes
'
;
import
{
Range
,
TextDocumentSaveReason
,
EndOfLine
}
from
'
vs/workbench/api/common/extHostTypeConverters
'
;
import
{
ExtHostDocuments
}
from
'
vs/workbench/api/common/extHostDocuments
'
;
...
...
@@ -142,7 +142,7 @@ export class ExtHostDocumentSaveParticipant implements ExtHostDocumentSavePartic
}).
then
(
values
=>
{
const
resourceEdit
:
ResourceTextEditDto
=
{
const
resourceEdit
:
I
ResourceTextEditDto
=
{
resource
:
document
.
uri
,
edits
:
[]
};
...
...
src/vs/workbench/api/common/extHostFileSystemEventService.ts
浏览文件 @
32da48e7
...
...
@@ -9,7 +9,7 @@ import { IRelativePattern, parse } from 'vs/base/common/glob';
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
ExtHostDocumentsAndEditors
}
from
'
vs/workbench/api/common/extHostDocumentsAndEditors
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
ExtHostFileSystemEventServiceShape
,
FileSystemEvents
,
IMainContext
,
MainContext
,
ResourceFileEditDto
,
ResourceTextEditDto
,
MainThreadTextEditorsShape
}
from
'
./extHost.protocol
'
;
import
{
ExtHostFileSystemEventServiceShape
,
FileSystemEvents
,
IMainContext
,
MainContext
,
IResourceFileEditDto
,
I
ResourceTextEditDto
,
MainThreadTextEditorsShape
}
from
'
./extHost.protocol
'
;
import
*
as
typeConverter
from
'
./extHostTypeConverters
'
;
import
{
Disposable
,
WorkspaceEdit
}
from
'
./extHostTypes
'
;
import
{
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
...
...
@@ -169,7 +169,7 @@ export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServ
}
// flatten all WorkspaceEdits collected via waitUntil-call
// and apply them in one go.
const
allEdits
=
new
Array
<
Array
<
ResourceFileEditDto
|
ResourceTextEditDto
>>
();
const
allEdits
=
new
Array
<
Array
<
IResourceFileEditDto
|
I
ResourceTextEditDto
>>
();
for
(
let
edit
of
edits
)
{
if
(
edit
)
{
// sparse array
let
{
edits
}
=
typeConverter
.
WorkspaceEdit
.
from
(
edit
,
this
.
_extHostDocumentsAndEditors
);
...
...
src/vs/workbench/api/common/extHostLanguageFeatures.ts
浏览文件 @
32da48e7
...
...
@@ -14,7 +14,7 @@ import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments';
import
{
ExtHostCommands
,
CommandsConverter
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
{
ExtHostDiagnostics
}
from
'
vs/workbench/api/common/extHostDiagnostics
'
;
import
{
asPromise
}
from
'
vs/base/common/async
'
;
import
{
MainContext
,
MainThreadLanguageFeaturesShape
,
ExtHostLanguageFeaturesShape
,
IRawColorInfo
,
IMainContext
,
IdObject
,
I
SerializedRegExp
,
ISerializedIndentationRule
,
ISerializedOnEnterRule
,
ISerializedLanguageConfiguration
,
WorkspaceSymbolDto
,
SuggestResultDto
,
WorkspaceSymbolsDto
,
CodeActionDto
,
ISerializedDocumentFilter
,
WorkspaceEditDto
,
ISerializedSignatureHelpProviderMetadata
,
LinkDto
,
CodeLensDto
,
SuggestDataDto
,
LinksListDto
,
ChainedCacheId
,
CodeLensListDto
,
CodeActionListDto
,
SignatureHelpDto
,
SignatureHelpContextDto
}
from
'
./extHost.protocol
'
;
import
{
MainContext
,
MainThreadLanguageFeaturesShape
,
ExtHostLanguageFeaturesShape
,
IRawColorInfo
,
IMainContext
,
IdObject
,
I
RegExpDto
,
IIndentationRuleDto
,
IOnEnterRuleDto
,
ILanguageConfigurationDto
,
IWorkspaceSymbolDto
,
ISuggestResultDto
,
IWorkspaceSymbolsDto
,
ICodeActionDto
,
IDocumentFilterDto
,
IWorkspaceEditDto
,
ISignatureHelpProviderMetadataDto
,
ILinkDto
,
ICodeLensDto
,
ISuggestDataDto
,
ILinksListDto
,
ChainedCacheId
,
ICodeLensListDto
,
ICodeActionListDto
,
ISignatureHelpDto
,
I
SignatureHelpContextDto
}
from
'
./extHost.protocol
'
;
import
{
regExpLeadsToEndlessLoop
,
regExpFlags
}
from
'
vs/base/common/strings
'
;
import
{
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
IRange
,
Range
as
EditorRange
}
from
'
vs/editor/common/core/range
'
;
...
...
@@ -111,7 +111,7 @@ class CodeLensAdapter {
private
readonly
_provider
:
vscode
.
CodeLensProvider
)
{
}
provideCodeLenses
(
resource
:
URI
,
token
:
CancellationToken
):
Promise
<
CodeLensListDto
|
undefined
>
{
provideCodeLenses
(
resource
:
URI
,
token
:
CancellationToken
):
Promise
<
I
CodeLensListDto
|
undefined
>
{
const
doc
=
this
.
_documents
.
getDocument
(
resource
);
return
asPromise
(()
=>
this
.
_provider
.
provideCodeLenses
(
doc
,
token
)).
then
(
lenses
=>
{
...
...
@@ -124,7 +124,7 @@ class CodeLensAdapter {
const
disposables
=
new
DisposableStore
();
this
.
_disposables
.
set
(
cacheId
,
disposables
);
const
result
:
CodeLensListDto
=
{
const
result
:
I
CodeLensListDto
=
{
cacheId
,
lenses
:
[],
};
...
...
@@ -141,7 +141,7 @@ class CodeLensAdapter {
});
}
resolveCodeLens
(
symbol
:
CodeLensDto
,
token
:
CancellationToken
):
Promise
<
CodeLensDto
|
undefined
>
{
resolveCodeLens
(
symbol
:
ICodeLensDto
,
token
:
CancellationToken
):
Promise
<
I
CodeLensDto
|
undefined
>
{
const
lens
=
symbol
.
cacheId
&&
this
.
_cache
.
get
(...
symbol
.
cacheId
);
if
(
!
lens
)
{
...
...
@@ -308,7 +308,7 @@ class ReferenceAdapter {
}
}
export
interface
CustomCodeAction
extends
CodeActionDto
{
export
interface
CustomCodeAction
extends
I
CodeActionDto
{
_isSynthetic
?:
boolean
;
}
...
...
@@ -327,7 +327,7 @@ class CodeActionAdapter {
private
readonly
_extensionId
:
ExtensionIdentifier
)
{
}
provideCodeActions
(
resource
:
URI
,
rangeOrSelection
:
IRange
|
ISelection
,
context
:
modes
.
CodeActionContext
,
token
:
CancellationToken
):
Promise
<
CodeActionListDto
|
undefined
>
{
provideCodeActions
(
resource
:
URI
,
rangeOrSelection
:
IRange
|
ISelection
,
context
:
modes
.
CodeActionContext
,
token
:
CancellationToken
):
Promise
<
I
CodeActionListDto
|
undefined
>
{
const
doc
=
this
.
_documents
.
getDocument
(
resource
);
const
ran
=
Selection
.
isISelection
(
rangeOrSelection
)
...
...
@@ -391,7 +391,7 @@ class CodeActionAdapter {
}
}
return
<
CodeActionListDto
>
{
cacheId
,
actions
};
return
<
I
CodeActionListDto
>
{
cacheId
,
actions
};
});
}
...
...
@@ -480,8 +480,8 @@ class NavigateTypeAdapter {
this
.
_provider
=
provider
;
}
provideWorkspaceSymbols
(
search
:
string
,
token
:
CancellationToken
):
Promise
<
WorkspaceSymbolsDto
>
{
const
result
:
WorkspaceSymbolsDto
=
IdObject
.
mixin
({
symbols
:
[]
});
provideWorkspaceSymbols
(
search
:
string
,
token
:
CancellationToken
):
Promise
<
I
WorkspaceSymbolsDto
>
{
const
result
:
I
WorkspaceSymbolsDto
=
IdObject
.
mixin
({
symbols
:
[]
});
return
asPromise
(()
=>
this
.
_provider
.
provideWorkspaceSymbols
(
search
,
token
)).
then
(
value
=>
{
if
(
isNonEmptyArray
(
value
))
{
for
(
const
item
of
value
)
{
...
...
@@ -506,7 +506,7 @@ class NavigateTypeAdapter {
});
}
resolveWorkspaceSymbol
(
symbol
:
WorkspaceSymbolDto
,
token
:
CancellationToken
):
Promise
<
WorkspaceSymbolDto
|
undefined
>
{
resolveWorkspaceSymbol
(
symbol
:
IWorkspaceSymbolDto
,
token
:
CancellationToken
):
Promise
<
I
WorkspaceSymbolDto
|
undefined
>
{
if
(
typeof
this
.
_provider
.
resolveWorkspaceSymbol
!==
'
function
'
)
{
return
Promise
.
resolve
(
symbol
);
...
...
@@ -543,7 +543,7 @@ class RenameAdapter {
private
readonly
_provider
:
vscode
.
RenameProvider
)
{
}
provideRenameEdits
(
resource
:
URI
,
position
:
IPosition
,
newName
:
string
,
token
:
CancellationToken
):
Promise
<
WorkspaceEditDto
|
undefined
>
{
provideRenameEdits
(
resource
:
URI
,
position
:
IPosition
,
newName
:
string
,
token
:
CancellationToken
):
Promise
<
I
WorkspaceEditDto
|
undefined
>
{
const
doc
=
this
.
_documents
.
getDocument
(
resource
);
const
pos
=
typeConvert
.
Position
.
to
(
position
);
...
...
@@ -556,10 +556,10 @@ class RenameAdapter {
},
err
=>
{
const
rejectReason
=
RenameAdapter
.
_asMessage
(
err
);
if
(
rejectReason
)
{
return
<
WorkspaceEditDto
>
{
rejectReason
,
edits
:
undefined
!
};
return
<
I
WorkspaceEditDto
>
{
rejectReason
,
edits
:
undefined
!
};
}
else
{
// generic error
return
Promise
.
reject
<
WorkspaceEditDto
>
(
err
);
return
Promise
.
reject
<
I
WorkspaceEditDto
>
(
err
);
}
});
}
...
...
@@ -633,7 +633,7 @@ class SuggestAdapter {
this
.
_provider
=
provider
;
}
provideCompletionItems
(
resource
:
URI
,
position
:
IPosition
,
context
:
modes
.
CompletionContext
,
token
:
CancellationToken
):
Promise
<
SuggestResultDto
|
undefined
>
{
provideCompletionItems
(
resource
:
URI
,
position
:
IPosition
,
context
:
modes
.
CompletionContext
,
token
:
CancellationToken
):
Promise
<
I
SuggestResultDto
|
undefined
>
{
const
doc
=
this
.
_documents
.
getDocument
(
resource
);
const
pos
=
typeConvert
.
Position
.
to
(
position
);
...
...
@@ -662,7 +662,7 @@ class SuggestAdapter {
const
wordRangeBeforePos
=
(
doc
.
getWordRangeAtPosition
(
pos
)
as
Range
||
new
Range
(
pos
,
pos
))
.
with
({
end
:
pos
});
const
result
:
SuggestResultDto
=
{
const
result
:
I
SuggestResultDto
=
{
x
:
pid
,
b
:
[],
a
:
typeConvert
.
Range
.
from
(
wordRangeBeforePos
),
...
...
@@ -682,7 +682,7 @@ class SuggestAdapter {
});
}
resolveCompletionItem
(
_resource
:
URI
,
position
:
IPosition
,
id
:
ChainedCacheId
,
token
:
CancellationToken
):
Promise
<
SuggestDataDto
|
undefined
>
{
resolveCompletionItem
(
_resource
:
URI
,
position
:
IPosition
,
id
:
ChainedCacheId
,
token
:
CancellationToken
):
Promise
<
I
SuggestDataDto
|
undefined
>
{
if
(
typeof
this
.
_provider
.
resolveCompletionItem
!==
'
function
'
)
{
return
Promise
.
resolve
(
undefined
);
...
...
@@ -710,7 +710,7 @@ class SuggestAdapter {
this
.
_cache
.
delete
(
id
);
}
private
_convertCompletionItem
(
item
:
vscode
.
CompletionItem
,
position
:
vscode
.
Position
,
id
:
ChainedCacheId
):
SuggestDataDto
|
undefined
{
private
_convertCompletionItem
(
item
:
vscode
.
CompletionItem
,
position
:
vscode
.
Position
,
id
:
ChainedCacheId
):
I
SuggestDataDto
|
undefined
{
if
(
typeof
item
.
label
!==
'
string
'
||
item
.
label
.
length
===
0
)
{
console
.
warn
(
'
INVALID text edit -> must have at least a label
'
);
return
undefined
;
...
...
@@ -721,7 +721,7 @@ class SuggestAdapter {
throw
Error
(
'
DisposableStore is missing...
'
);
}
const
result
:
SuggestDataDto
=
{
const
result
:
I
SuggestDataDto
=
{
//
x
:
id
,
//
...
...
@@ -777,7 +777,7 @@ class SignatureHelpAdapter {
private
readonly
_provider
:
vscode
.
SignatureHelpProvider
,
)
{
}
provideSignatureHelp
(
resource
:
URI
,
position
:
IPosition
,
context
:
SignatureHelpContextDto
,
token
:
CancellationToken
):
Promise
<
SignatureHelpDto
|
undefined
>
{
provideSignatureHelp
(
resource
:
URI
,
position
:
IPosition
,
context
:
ISignatureHelpContextDto
,
token
:
CancellationToken
):
Promise
<
I
SignatureHelpDto
|
undefined
>
{
const
doc
=
this
.
_documents
.
getDocument
(
resource
);
const
pos
=
typeConvert
.
Position
.
to
(
position
);
const
vscodeContext
=
this
.
reviveContext
(
context
);
...
...
@@ -791,7 +791,7 @@ class SignatureHelpAdapter {
});
}
private
reviveContext
(
context
:
SignatureHelpContextDto
):
vscode
.
SignatureHelpContext
{
private
reviveContext
(
context
:
I
SignatureHelpContextDto
):
vscode
.
SignatureHelpContext
{
let
activeSignatureHelp
:
vscode
.
SignatureHelp
|
undefined
=
undefined
;
if
(
context
.
activeSignatureHelp
)
{
const
revivedSignatureHelp
=
typeConvert
.
SignatureHelp
.
to
(
context
.
activeSignatureHelp
);
...
...
@@ -855,7 +855,7 @@ class LinkProviderAdapter {
private
readonly
_provider
:
vscode
.
DocumentLinkProvider
)
{
}
provideLinks
(
resource
:
URI
,
token
:
CancellationToken
):
Promise
<
LinksListDto
|
undefined
>
{
provideLinks
(
resource
:
URI
,
token
:
CancellationToken
):
Promise
<
I
LinksListDto
|
undefined
>
{
const
doc
=
this
.
_documents
.
getDocument
(
resource
);
return
asPromise
(()
=>
this
.
_provider
.
provideDocumentLinks
(
doc
,
token
)).
then
(
links
=>
{
...
...
@@ -877,9 +877,9 @@ class LinkProviderAdapter {
}
else
{
// cache links for future resolving
const
pid
=
this
.
_cache
.
add
(
links
);
const
result
:
LinksListDto
=
{
links
:
[],
id
:
pid
};
const
result
:
I
LinksListDto
=
{
links
:
[],
id
:
pid
};
for
(
let
i
=
0
;
i
<
links
.
length
;
i
++
)
{
const
dto
:
LinkDto
=
typeConvert
.
DocumentLink
.
from
(
links
[
i
]);
const
dto
:
I
LinkDto
=
typeConvert
.
DocumentLink
.
from
(
links
[
i
]);
dto
.
cacheId
=
[
pid
,
i
];
result
.
links
.
push
(
dto
);
}
...
...
@@ -888,7 +888,7 @@ class LinkProviderAdapter {
});
}
resolveLink
(
id
:
ChainedCacheId
,
token
:
CancellationToken
):
Promise
<
LinkDto
|
undefined
>
{
resolveLink
(
id
:
ChainedCacheId
,
token
:
CancellationToken
):
Promise
<
I
LinkDto
|
undefined
>
{
if
(
typeof
this
.
_provider
.
resolveDocumentLink
!==
'
function
'
)
{
return
Promise
.
resolve
(
undefined
);
}
...
...
@@ -1103,11 +1103,11 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
this
.
_logService
=
logService
;
}
private
_transformDocumentSelector
(
selector
:
vscode
.
DocumentSelector
):
Array
<
I
SerializedDocumentFilter
>
{
private
_transformDocumentSelector
(
selector
:
vscode
.
DocumentSelector
):
Array
<
I
DocumentFilterDto
>
{
return
coalesce
(
asArray
(
selector
).
map
(
sel
=>
this
.
_doTransformDocumentSelector
(
sel
)));
}
private
_doTransformDocumentSelector
(
selector
:
string
|
vscode
.
DocumentFilter
):
I
SerializedDocumentFilter
|
undefined
{
private
_doTransformDocumentSelector
(
selector
:
string
|
vscode
.
DocumentFilter
):
I
DocumentFilterDto
|
undefined
{
if
(
typeof
selector
===
'
string
'
)
{
return
{
$serialized
:
true
,
...
...
@@ -1215,11 +1215,11 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return
result
;
}
$provideCodeLenses
(
handle
:
number
,
resource
:
UriComponents
,
token
:
CancellationToken
):
Promise
<
CodeLensListDto
|
undefined
>
{
$provideCodeLenses
(
handle
:
number
,
resource
:
UriComponents
,
token
:
CancellationToken
):
Promise
<
I
CodeLensListDto
|
undefined
>
{
return
this
.
_withAdapter
(
handle
,
CodeLensAdapter
,
adapter
=>
adapter
.
provideCodeLenses
(
URI
.
revive
(
resource
),
token
),
undefined
);
}
$resolveCodeLens
(
handle
:
number
,
symbol
:
CodeLensDto
,
token
:
CancellationToken
):
Promise
<
CodeLensDto
|
undefined
>
{
$resolveCodeLens
(
handle
:
number
,
symbol
:
ICodeLensDto
,
token
:
CancellationToken
):
Promise
<
I
CodeLensDto
|
undefined
>
{
return
this
.
_withAdapter
(
handle
,
CodeLensAdapter
,
adapter
=>
adapter
.
resolveCodeLens
(
symbol
,
token
),
undefined
);
}
...
...
@@ -1314,7 +1314,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
}
$provideCodeActions
(
handle
:
number
,
resource
:
UriComponents
,
rangeOrSelection
:
IRange
|
ISelection
,
context
:
modes
.
CodeActionContext
,
token
:
CancellationToken
):
Promise
<
CodeActionListDto
|
undefined
>
{
$provideCodeActions
(
handle
:
number
,
resource
:
UriComponents
,
rangeOrSelection
:
IRange
|
ISelection
,
context
:
modes
.
CodeActionContext
,
token
:
CancellationToken
):
Promise
<
I
CodeActionListDto
|
undefined
>
{
return
this
.
_withAdapter
(
handle
,
CodeActionAdapter
,
adapter
=>
adapter
.
provideCodeActions
(
URI
.
revive
(
resource
),
rangeOrSelection
,
context
,
token
),
undefined
);
}
...
...
@@ -1362,11 +1362,11 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return
this
.
_createDisposable
(
handle
);
}
$provideWorkspaceSymbols
(
handle
:
number
,
search
:
string
,
token
:
CancellationToken
):
Promise
<
WorkspaceSymbolsDto
>
{
$provideWorkspaceSymbols
(
handle
:
number
,
search
:
string
,
token
:
CancellationToken
):
Promise
<
I
WorkspaceSymbolsDto
>
{
return
this
.
_withAdapter
(
handle
,
NavigateTypeAdapter
,
adapter
=>
adapter
.
provideWorkspaceSymbols
(
search
,
token
),
{
symbols
:
[]
});
}
$resolveWorkspaceSymbol
(
handle
:
number
,
symbol
:
WorkspaceSymbolDto
,
token
:
CancellationToken
):
Promise
<
WorkspaceSymbolDto
|
undefined
>
{
$resolveWorkspaceSymbol
(
handle
:
number
,
symbol
:
IWorkspaceSymbolDto
,
token
:
CancellationToken
):
Promise
<
I
WorkspaceSymbolDto
|
undefined
>
{
return
this
.
_withAdapter
(
handle
,
NavigateTypeAdapter
,
adapter
=>
adapter
.
resolveWorkspaceSymbol
(
symbol
,
token
),
undefined
);
}
...
...
@@ -1382,7 +1382,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return
this
.
_createDisposable
(
handle
);
}
$provideRenameEdits
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
newName
:
string
,
token
:
CancellationToken
):
Promise
<
WorkspaceEditDto
|
undefined
>
{
$provideRenameEdits
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
newName
:
string
,
token
:
CancellationToken
):
Promise
<
I
WorkspaceEditDto
|
undefined
>
{
return
this
.
_withAdapter
(
handle
,
RenameAdapter
,
adapter
=>
adapter
.
provideRenameEdits
(
URI
.
revive
(
resource
),
position
,
newName
,
token
),
undefined
);
}
...
...
@@ -1398,11 +1398,11 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return
this
.
_createDisposable
(
handle
);
}
$provideCompletionItems
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
context
:
modes
.
CompletionContext
,
token
:
CancellationToken
):
Promise
<
SuggestResultDto
|
undefined
>
{
$provideCompletionItems
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
context
:
modes
.
CompletionContext
,
token
:
CancellationToken
):
Promise
<
I
SuggestResultDto
|
undefined
>
{
return
this
.
_withAdapter
(
handle
,
SuggestAdapter
,
adapter
=>
adapter
.
provideCompletionItems
(
URI
.
revive
(
resource
),
position
,
context
,
token
),
undefined
);
}
$resolveCompletionItem
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
id
:
ChainedCacheId
,
token
:
CancellationToken
):
Promise
<
SuggestDataDto
|
undefined
>
{
$resolveCompletionItem
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
id
:
ChainedCacheId
,
token
:
CancellationToken
):
Promise
<
I
SuggestDataDto
|
undefined
>
{
return
this
.
_withAdapter
(
handle
,
SuggestAdapter
,
adapter
=>
adapter
.
resolveCompletionItem
(
URI
.
revive
(
resource
),
position
,
id
,
token
),
undefined
);
}
...
...
@@ -1413,7 +1413,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
// --- parameter hints
registerSignatureHelpProvider
(
extension
:
IExtensionDescription
,
selector
:
vscode
.
DocumentSelector
,
provider
:
vscode
.
SignatureHelpProvider
,
metadataOrTriggerChars
:
string
[]
|
vscode
.
SignatureHelpProviderMetadata
):
vscode
.
Disposable
{
const
metadata
:
IS
erializedSignatureHelpProviderMetadata
|
undefined
=
Array
.
isArray
(
metadataOrTriggerChars
)
const
metadata
:
IS
ignatureHelpProviderMetadataDto
|
undefined
=
Array
.
isArray
(
metadataOrTriggerChars
)
?
{
triggerCharacters
:
metadataOrTriggerChars
,
retriggerCharacters
:
[]
}
:
metadataOrTriggerChars
;
...
...
@@ -1422,7 +1422,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return
this
.
_createDisposable
(
handle
);
}
$provideSignatureHelp
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
context
:
SignatureHelpContextDto
,
token
:
CancellationToken
):
Promise
<
SignatureHelpDto
|
undefined
>
{
$provideSignatureHelp
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
context
:
ISignatureHelpContextDto
,
token
:
CancellationToken
):
Promise
<
I
SignatureHelpDto
|
undefined
>
{
return
this
.
_withAdapter
(
handle
,
SignatureHelpAdapter
,
adapter
=>
adapter
.
provideSignatureHelp
(
URI
.
revive
(
resource
),
position
,
context
,
token
),
undefined
);
}
...
...
@@ -1438,11 +1438,11 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return
this
.
_createDisposable
(
handle
);
}
$provideDocumentLinks
(
handle
:
number
,
resource
:
UriComponents
,
token
:
CancellationToken
):
Promise
<
LinksListDto
|
undefined
>
{
$provideDocumentLinks
(
handle
:
number
,
resource
:
UriComponents
,
token
:
CancellationToken
):
Promise
<
I
LinksListDto
|
undefined
>
{
return
this
.
_withAdapter
(
handle
,
LinkProviderAdapter
,
adapter
=>
adapter
.
provideLinks
(
URI
.
revive
(
resource
),
token
),
undefined
);
}
$resolveDocumentLink
(
handle
:
number
,
id
:
ChainedCacheId
,
token
:
CancellationToken
):
Promise
<
LinkDto
|
undefined
>
{
$resolveDocumentLink
(
handle
:
number
,
id
:
ChainedCacheId
,
token
:
CancellationToken
):
Promise
<
I
LinkDto
|
undefined
>
{
return
this
.
_withAdapter
(
handle
,
LinkProviderAdapter
,
adapter
=>
adapter
.
resolveLink
(
id
,
token
),
undefined
);
}
...
...
@@ -1504,14 +1504,14 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
// --- configuration
private
static
_serializeRegExp
(
regExp
:
RegExp
):
I
SerializedRegExp
{
private
static
_serializeRegExp
(
regExp
:
RegExp
):
I
RegExpDto
{
return
{
pattern
:
regExp
.
source
,
flags
:
regExpFlags
(
regExp
),
};
}
private
static
_serializeIndentationRule
(
indentationRule
:
vscode
.
IndentationRule
):
I
SerializedIndentationRule
{
private
static
_serializeIndentationRule
(
indentationRule
:
vscode
.
IndentationRule
):
I
IndentationRuleDto
{
return
{
decreaseIndentPattern
:
ExtHostLanguageFeatures
.
_serializeRegExp
(
indentationRule
.
decreaseIndentPattern
),
increaseIndentPattern
:
ExtHostLanguageFeatures
.
_serializeRegExp
(
indentationRule
.
increaseIndentPattern
),
...
...
@@ -1520,7 +1520,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
};
}
private
static
_serializeOnEnterRule
(
onEnterRule
:
vscode
.
OnEnterRule
):
I
SerializedOnEnterRule
{
private
static
_serializeOnEnterRule
(
onEnterRule
:
vscode
.
OnEnterRule
):
I
OnEnterRuleDto
{
return
{
beforeText
:
ExtHostLanguageFeatures
.
_serializeRegExp
(
onEnterRule
.
beforeText
),
afterText
:
onEnterRule
.
afterText
?
ExtHostLanguageFeatures
.
_serializeRegExp
(
onEnterRule
.
afterText
)
:
undefined
,
...
...
@@ -1529,7 +1529,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
};
}
private
static
_serializeOnEnterRules
(
onEnterRules
:
vscode
.
OnEnterRule
[]):
I
SerializedOnEnterRule
[]
{
private
static
_serializeOnEnterRules
(
onEnterRules
:
vscode
.
OnEnterRule
[]):
I
OnEnterRuleDto
[]
{
return
onEnterRules
.
map
(
ExtHostLanguageFeatures
.
_serializeOnEnterRule
);
}
...
...
@@ -1549,7 +1549,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
}
const
handle
=
this
.
_nextHandle
();
const
serializedConfiguration
:
I
SerializedLanguageConfiguration
=
{
const
serializedConfiguration
:
I
LanguageConfigurationDto
=
{
comments
:
configuration
.
comments
,
brackets
:
configuration
.
brackets
,
wordPattern
:
configuration
.
wordPattern
?
ExtHostLanguageFeatures
.
_serializeRegExp
(
configuration
.
wordPattern
)
:
undefined
,
...
...
src/vs/workbench/api/common/extHostSCM.ts
浏览文件 @
32da48e7
...
...
@@ -9,7 +9,7 @@ import { debounce } from 'vs/base/common/decorators';
import
{
DisposableStore
,
MutableDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
asPromise
}
from
'
vs/base/common/async
'
;
import
{
ExtHostCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
{
MainContext
,
MainThreadSCMShape
,
SCMRawResource
,
SCMRawResourceSplice
,
SCMRawResourceSplices
,
IMainContext
,
ExtHostSCMShape
,
CommandDto
}
from
'
./extHost.protocol
'
;
import
{
MainContext
,
MainThreadSCMShape
,
SCMRawResource
,
SCMRawResourceSplice
,
SCMRawResourceSplices
,
IMainContext
,
ExtHostSCMShape
,
I
CommandDto
}
from
'
./extHost.protocol
'
;
import
{
sortedDiff
}
from
'
vs/base/common/arrays
'
;
import
{
comparePaths
}
from
'
vs/base/common/comparers
'
;
import
*
as
vscode
from
'
vscode
'
;
...
...
@@ -445,7 +445,7 @@ class ExtHostSourceControl implements vscode.SourceControl {
this
.
_statusBarCommands
=
statusBarCommands
;
const
internal
=
(
statusBarCommands
||
[]).
map
(
c
=>
this
.
_commands
.
converter
.
toInternal
(
c
,
this
.
_statusBarDisposables
.
value
!
))
as
CommandDto
[];
const
internal
=
(
statusBarCommands
||
[]).
map
(
c
=>
this
.
_commands
.
converter
.
toInternal
(
c
,
this
.
_statusBarDisposables
.
value
!
))
as
I
CommandDto
[];
this
.
_proxy
.
$updateSourceControl
(
this
.
handle
,
{
statusBarCommands
:
internal
});
}
...
...
src/vs/workbench/api/common/extHostTypeConverters.ts
浏览文件 @
32da48e7
...
...
@@ -19,7 +19,7 @@ import { IRange } from 'vs/editor/common/core/range';
import
{
ISelection
}
from
'
vs/editor/common/core/selection
'
;
import
*
as
htmlContent
from
'
vs/base/common/htmlContent
'
;
import
*
as
languageSelector
from
'
vs/editor/common/modes/languageSelector
'
;
import
{
WorkspaceEditDto
,
ResourceTextEditDto
,
ResourceFileEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
IWorkspaceEditDto
,
IResourceTextEditDto
,
I
ResourceFileEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
MarkerSeverity
,
IRelatedInformation
,
IMarkerData
,
MarkerTag
}
from
'
vs/platform/markers/common/markers
'
;
import
{
ACTIVE_GROUP
,
SIDE_GROUP
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
ExtHostDocumentsAndEditors
}
from
'
vs/workbench/api/common/extHostDocumentsAndEditors
'
;
...
...
@@ -455,8 +455,8 @@ export namespace TextEdit {
}
export
namespace
WorkspaceEdit
{
export
function
from
(
value
:
vscode
.
WorkspaceEdit
,
documents
?:
ExtHostDocumentsAndEditors
):
WorkspaceEditDto
{
const
result
:
WorkspaceEditDto
=
{
export
function
from
(
value
:
vscode
.
WorkspaceEdit
,
documents
?:
ExtHostDocumentsAndEditors
):
I
WorkspaceEditDto
{
const
result
:
I
WorkspaceEditDto
=
{
edits
:
[]
};
for
(
const
entry
of
(
value
as
types
.
WorkspaceEdit
).
_allEntries
())
{
...
...
@@ -464,28 +464,28 @@ export namespace WorkspaceEdit {
if
(
Array
.
isArray
(
uriOrEdits
))
{
// text edits
const
doc
=
documents
&&
uri
?
documents
.
getDocument
(
uri
)
:
undefined
;
result
.
edits
.
push
(
<
ResourceTextEditDto
>
{
resource
:
uri
,
modelVersionId
:
doc
&&
doc
.
version
,
edits
:
uriOrEdits
.
map
(
TextEdit
.
from
)
});
result
.
edits
.
push
(
<
I
ResourceTextEditDto
>
{
resource
:
uri
,
modelVersionId
:
doc
&&
doc
.
version
,
edits
:
uriOrEdits
.
map
(
TextEdit
.
from
)
});
}
else
{
// resource edits
result
.
edits
.
push
(
<
ResourceFileEditDto
>
{
oldUri
:
uri
,
newUri
:
uriOrEdits
,
options
:
entry
[
2
]
});
result
.
edits
.
push
(
<
I
ResourceFileEditDto
>
{
oldUri
:
uri
,
newUri
:
uriOrEdits
,
options
:
entry
[
2
]
});
}
}
return
result
;
}
export
function
to
(
value
:
WorkspaceEditDto
)
{
export
function
to
(
value
:
I
WorkspaceEditDto
)
{
const
result
=
new
types
.
WorkspaceEdit
();
for
(
const
edit
of
value
.
edits
)
{
if
(
Array
.
isArray
((
<
ResourceTextEditDto
>
edit
).
edits
))
{
if
(
Array
.
isArray
((
<
I
ResourceTextEditDto
>
edit
).
edits
))
{
result
.
set
(
URI
.
revive
((
<
ResourceTextEditDto
>
edit
).
resource
),
<
types
.
TextEdit
[]
>
(
<
ResourceTextEditDto
>
edit
).
edits
.
map
(
TextEdit
.
to
)
URI
.
revive
((
<
I
ResourceTextEditDto
>
edit
).
resource
),
<
types
.
TextEdit
[]
>
(
<
I
ResourceTextEditDto
>
edit
).
edits
.
map
(
TextEdit
.
to
)
);
}
else
{
result
.
renameFile
(
URI
.
revive
((
<
ResourceFileEditDto
>
edit
).
oldUri
!
),
URI
.
revive
((
<
ResourceFileEditDto
>
edit
).
newUri
!
),
(
<
ResourceFileEditDto
>
edit
).
options
URI
.
revive
((
<
I
ResourceFileEditDto
>
edit
).
oldUri
!
),
URI
.
revive
((
<
I
ResourceFileEditDto
>
edit
).
newUri
!
),
(
<
I
ResourceFileEditDto
>
edit
).
options
);
}
}
...
...
src/vs/workbench/api/node/extHostTerminalService.ts
浏览文件 @
32da48e7
...
...
@@ -10,7 +10,7 @@ import { URI, UriComponents } from 'vs/base/common/uri';
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
*
as
terminalEnvironment
from
'
vs/workbench/contrib/terminal/common/terminalEnvironment
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
ExtHostTerminalServiceShape
,
MainContext
,
MainThreadTerminalServiceShape
,
IMainContext
,
ShellLaunchConfigDto
,
IShellDefinitionDto
,
IShellAndArgsDto
,
ITerminalDimensionsDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ExtHostTerminalServiceShape
,
MainContext
,
MainThreadTerminalServiceShape
,
IMainContext
,
I
ShellLaunchConfigDto
,
IShellDefinitionDto
,
IShellAndArgsDto
,
ITerminalDimensionsDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ExtHostConfiguration
,
ExtHostConfigProvider
}
from
'
vs/workbench/api/common/extHostConfiguration
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
EXT_HOST_CREATION_DELAY
,
IShellLaunchConfig
,
ITerminalEnvironment
,
ITerminalChildProcess
,
ITerminalDimensions
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
...
...
@@ -551,7 +551,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
this
.
_variableResolver
=
new
ExtHostVariableResolverService
(
workspaceFolders
||
[],
this
.
_extHostDocumentsAndEditors
,
configProvider
);
}
public
async
$spawnExtHostProcess
(
id
:
number
,
shellLaunchConfigDto
:
ShellLaunchConfigDto
,
activeWorkspaceRootUriComponents
:
UriComponents
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
Promise
<
void
>
{
public
async
$spawnExtHostProcess
(
id
:
number
,
shellLaunchConfigDto
:
I
ShellLaunchConfigDto
,
activeWorkspaceRootUriComponents
:
UriComponents
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
Promise
<
void
>
{
const
shellLaunchConfig
:
IShellLaunchConfig
=
{
name
:
shellLaunchConfigDto
.
name
,
executable
:
shellLaunchConfigDto
.
executable
,
...
...
src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts
浏览文件 @
32da48e7
...
...
@@ -7,7 +7,7 @@ import { URI } from 'vs/base/common/uri';
import
{
ExtHostDocuments
}
from
'
vs/workbench/api/common/extHostDocuments
'
;
import
{
ExtHostDocumentsAndEditors
}
from
'
vs/workbench/api/common/extHostDocumentsAndEditors
'
;
import
{
TextDocumentSaveReason
,
TextEdit
,
Position
,
EndOfLine
}
from
'
vs/workbench/api/common/extHostTypes
'
;
import
{
MainThreadTextEditorsShape
,
WorkspaceEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
MainThreadTextEditorsShape
,
I
WorkspaceEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ExtHostDocumentSaveParticipant
}
from
'
vs/workbench/api/common/extHostDocumentSaveParticipant
'
;
import
{
SingleProxyRPCProtocol
}
from
'
./testRPCProtocol
'
;
import
{
SaveReason
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
...
...
@@ -262,9 +262,9 @@ suite('ExtHostDocumentSaveParticipant', () => {
test
(
'
event delivery, pushEdits sync
'
,
()
=>
{
let
dto
:
WorkspaceEditDto
;
let
dto
:
I
WorkspaceEditDto
;
const
participant
=
new
ExtHostDocumentSaveParticipant
(
nullLogService
,
documents
,
new
class
extends
mock
<
MainThreadTextEditorsShape
>
()
{
$tryApplyWorkspaceEdit
(
_edits
:
WorkspaceEditDto
)
{
$tryApplyWorkspaceEdit
(
_edits
:
I
WorkspaceEditDto
)
{
dto
=
_edits
;
return
Promise
.
resolve
(
true
);
}
...
...
@@ -286,9 +286,9 @@ suite('ExtHostDocumentSaveParticipant', () => {
test
(
'
event delivery, concurrent change
'
,
()
=>
{
let
edits
:
WorkspaceEditDto
;
let
edits
:
I
WorkspaceEditDto
;
const
participant
=
new
ExtHostDocumentSaveParticipant
(
nullLogService
,
documents
,
new
class
extends
mock
<
MainThreadTextEditorsShape
>
()
{
$tryApplyWorkspaceEdit
(
_edits
:
WorkspaceEditDto
)
{
$tryApplyWorkspaceEdit
(
_edits
:
I
WorkspaceEditDto
)
{
edits
=
_edits
;
return
Promise
.
resolve
(
true
);
}
...
...
@@ -323,7 +323,7 @@ suite('ExtHostDocumentSaveParticipant', () => {
test
(
'
event delivery, two listeners -> two document states
'
,
()
=>
{
const
participant
=
new
ExtHostDocumentSaveParticipant
(
nullLogService
,
documents
,
new
class
extends
mock
<
MainThreadTextEditorsShape
>
()
{
$tryApplyWorkspaceEdit
(
dto
:
WorkspaceEditDto
)
{
$tryApplyWorkspaceEdit
(
dto
:
I
WorkspaceEditDto
)
{
for
(
const
edit
of
dto
.
edits
)
{
if
(
!
isResourceTextEdit
(
edit
))
{
...
...
src/vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts
浏览文件 @
32da48e7
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
*
as
extHostTypes
from
'
vs/workbench/api/common/extHostTypes
'
;
import
{
MainContext
,
MainThreadTextEditorsShape
,
WorkspaceEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
MainContext
,
MainThreadTextEditorsShape
,
I
WorkspaceEditDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
mock
}
from
'
vs/workbench/test/electron-browser/api/mock
'
;
import
{
ExtHostDocumentsAndEditors
}
from
'
vs/workbench/api/common/extHostDocumentsAndEditors
'
;
...
...
@@ -16,14 +16,14 @@ suite('ExtHostTextEditors.applyWorkspaceEdit', () => {
const
resource
=
URI
.
parse
(
'
foo:bar
'
);
let
editors
:
ExtHostEditors
;
let
workspaceResourceEdits
:
WorkspaceEditDto
;
let
workspaceResourceEdits
:
I
WorkspaceEditDto
;
setup
(()
=>
{
workspaceResourceEdits
=
null
!
;
let
rpcProtocol
=
new
TestRPCProtocol
();
rpcProtocol
.
set
(
MainContext
.
MainThreadTextEditors
,
new
class
extends
mock
<
MainThreadTextEditorsShape
>
()
{
$tryApplyWorkspaceEdit
(
_workspaceResourceEdits
:
WorkspaceEditDto
):
Promise
<
boolean
>
{
$tryApplyWorkspaceEdit
(
_workspaceResourceEdits
:
I
WorkspaceEditDto
):
Promise
<
boolean
>
{
workspaceResourceEdits
=
_workspaceResourceEdits
;
return
Promise
.
resolve
(
true
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录