Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
af55c200
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
af55c200
编写于
9月 07, 2016
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
monitor -> service
上级
94acaef8
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
23 addition
and
23 deletion
+23
-23
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+2
-2
src/vs/workbench/api/node/extHost.contribution.ts
src/vs/workbench/api/node/extHost.contribution.ts
+2
-2
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+2
-2
src/vs/workbench/api/node/extHostHeapService.ts
src/vs/workbench/api/node/extHostHeapService.ts
+3
-3
src/vs/workbench/api/node/extHostLanguageFeatures.ts
src/vs/workbench/api/node/extHostLanguageFeatures.ts
+8
-8
src/vs/workbench/api/node/mainThreadHeapService.ts
src/vs/workbench/api/node/mainThreadHeapService.ts
+2
-2
src/vs/workbench/test/node/api/extHostApiCommands.test.ts
src/vs/workbench/test/node/api/extHostApiCommands.test.ts
+2
-2
src/vs/workbench/test/node/api/extHostLanguageFeatures.test.ts
...s/workbench/test/node/api/extHostLanguageFeatures.test.ts
+2
-2
未找到文件。
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
af55c200
...
...
@@ -17,7 +17,7 @@ import {ExtHostConfiguration} from 'vs/workbench/api/node/extHostConfiguration';
import
{
ExtHostDiagnostics
}
from
'
vs/workbench/api/node/extHostDiagnostics
'
;
import
{
ExtHostWorkspace
}
from
'
vs/workbench/api/node/extHostWorkspace
'
;
import
{
ExtHostQuickOpen
}
from
'
vs/workbench/api/node/extHostQuickOpen
'
;
import
{
ExtHostHeap
Monitor
}
from
'
vs/workbench/api/node/extHostHeapMonitor
'
;
import
{
ExtHostHeap
Service
}
from
'
vs/workbench/api/node/extHostHeapService
'
;
import
{
ExtHostStatusBar
}
from
'
vs/workbench/api/node/extHostStatusBar
'
;
import
{
ExtHostCommands
}
from
'
vs/workbench/api/node/extHostCommands
'
;
import
{
ExtHostOutputService
}
from
'
vs/workbench/api/node/extHostOutputService
'
;
...
...
@@ -100,7 +100,7 @@ export class ExtHostAPIImplementation {
// Addressable instances
const
col
=
new
InstanceCollection
();
const
extHostHeapMonitor
=
col
.
define
(
ExtHostContext
.
ExtHostHeap
Monitor
).
set
<
ExtHostHeapMonitor
>
(
new
ExtHostHeapMonitor
());
const
extHostHeapMonitor
=
col
.
define
(
ExtHostContext
.
ExtHostHeap
Service
).
set
<
ExtHostHeapService
>
(
new
ExtHostHeapService
());
const
extHostDocuments
=
col
.
define
(
ExtHostContext
.
ExtHostDocuments
).
set
<
ExtHostDocuments
>
(
new
ExtHostDocuments
(
threadService
));
const
extHostEditors
=
col
.
define
(
ExtHostContext
.
ExtHostEditors
).
set
<
ExtHostEditors
>
(
new
ExtHostEditors
(
threadService
,
extHostDocuments
));
const
extHostCommands
=
col
.
define
(
ExtHostContext
.
ExtHostCommands
).
set
<
ExtHostCommands
>
(
new
ExtHostCommands
(
threadService
,
extHostEditors
));
...
...
src/vs/workbench/api/node/extHost.contribution.ts
浏览文件 @
af55c200
...
...
@@ -32,7 +32,7 @@ import {MainThreadTerminalService} from './mainThreadTerminalService';
import
{
MainThreadWorkspace
}
from
'
./mainThreadWorkspace
'
;
import
{
MainProcessExtensionService
}
from
'
./mainThreadExtensionService
'
;
import
{
MainThreadFileSystemEventService
}
from
'
./mainThreadFileSystemEventService
'
;
import
{
MainThreadHeap
Monitor
}
from
'
./mainThreadHeapMonitor
'
;
import
{
MainThreadHeap
Service
}
from
'
./mainThreadHeapService
'
;
// --- other interested parties
import
{
MainProcessTextMateSyntax
}
from
'
vs/editor/node/textMate/TMSyntax
'
;
...
...
@@ -88,7 +88,7 @@ export class ExtHostContribution implements IWorkbenchContribution {
create
(
JSONValidationExtensionPoint
);
create
(
LanguageConfigurationFileHandler
);
create
(
MainThreadFileSystemEventService
);
create
(
MainThreadHeap
Monitor
);
create
(
MainThreadHeap
Service
);
}
}
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
af55c200
...
...
@@ -279,7 +279,7 @@ export namespace ObjectIdentifier {
}
}
export
abstract
class
ExtHostHeap
Monitor
Shape
{
export
abstract
class
ExtHostHeap
Service
Shape
{
$onGarbageCollection
(
ids
:
number
[]):
void
{
throw
ni
();
}
}
...
...
@@ -339,7 +339,7 @@ export const ExtHostContext = {
ExtHostDocuments
:
createExtId
<
ExtHostDocumentsShape
>
(
'
ExtHostDocuments
'
,
ExtHostDocumentsShape
),
ExtHostEditors
:
createExtId
<
ExtHostEditorsShape
>
(
'
ExtHostEditors
'
,
ExtHostEditorsShape
),
ExtHostFileSystemEventService
:
createExtId
<
ExtHostFileSystemEventServiceShape
>
(
'
ExtHostFileSystemEventService
'
,
ExtHostFileSystemEventServiceShape
),
ExtHostHeap
Monitor
:
createExtId
<
ExtHostHeapMonitorShape
>
(
'
ExtHostHeapMonitor
'
,
ExtHostHeapMonitor
Shape
),
ExtHostHeap
Service
:
createExtId
<
ExtHostHeapServiceShape
>
(
'
ExtHostHeapMonitor
'
,
ExtHostHeapService
Shape
),
ExtHostLanguageFeatures
:
createExtId
<
ExtHostLanguageFeaturesShape
>
(
'
ExtHostLanguageFeatures
'
,
ExtHostLanguageFeaturesShape
),
ExtHostQuickOpen
:
createExtId
<
ExtHostQuickOpenShape
>
(
'
ExtHostQuickOpen
'
,
ExtHostQuickOpenShape
),
ExtHostExtensionService
:
createExtId
<
ExtHostExtensionServiceShape
>
(
'
ExtHostExtensionService
'
,
ExtHostExtensionServiceShape
),
...
...
src/vs/workbench/api/node/extHostHeap
Monitor
.ts
→
src/vs/workbench/api/node/extHostHeap
Service
.ts
浏览文件 @
af55c200
...
...
@@ -4,9 +4,9 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
ExtHostHeap
Monitor
Shape
}
from
'
./extHost.protocol
'
;
import
{
ExtHostHeap
Service
Shape
}
from
'
./extHost.protocol
'
;
export
class
ExtHostHeap
Monitor
extends
ExtHostHeapMonitor
Shape
{
export
class
ExtHostHeap
Service
extends
ExtHostHeapService
Shape
{
private
static
_idPool
=
0
;
...
...
@@ -14,7 +14,7 @@ export class ExtHostHeapMonitor extends ExtHostHeapMonitorShape {
private
_callbacks
:
{
[
n
:
number
]:
Function
}
=
Object
.
create
(
null
);
keep
(
obj
:
any
,
callback
?:()
=>
any
):
number
{
const
id
=
ExtHostHeap
Monitor
.
_idPool
++
;
const
id
=
ExtHostHeap
Service
.
_idPool
++
;
this
.
_data
[
id
]
=
obj
;
if
(
typeof
callback
===
'
function
'
)
{
this
.
_callbacks
[
id
]
=
callback
;
...
...
src/vs/workbench/api/node/extHostLanguageFeatures.ts
浏览文件 @
af55c200
...
...
@@ -13,7 +13,7 @@ import * as TypeConverters from 'vs/workbench/api/node/extHostTypeConverters';
import
{
Range
,
Disposable
,
CompletionList
,
CompletionItem
}
from
'
vs/workbench/api/node/extHostTypes
'
;
import
{
IPosition
,
IRange
,
ISingleEditOperation
}
from
'
vs/editor/common/editorCommon
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
{
ExtHostHeap
Monitor
}
from
'
vs/workbench/api/node/extHostHeapMonitor
'
;
import
{
ExtHostHeap
Service
}
from
'
vs/workbench/api/node/extHostHeapService
'
;
import
{
ExtHostDocuments
}
from
'
vs/workbench/api/node/extHostDocuments
'
;
import
{
ExtHostCommands
}
from
'
vs/workbench/api/node/extHostCommands
'
;
import
{
ExtHostDiagnostics
}
from
'
vs/workbench/api/node/extHostDiagnostics
'
;
...
...
@@ -501,13 +501,13 @@ class RenameAdapter {
class
SuggestAdapter
{
private
_documents
:
ExtHostDocuments
;
private
_heap
Monitor
:
ExtHostHeapMonitor
;
private
_heap
Service
:
ExtHostHeapService
;
private
_provider
:
vscode
.
CompletionItemProvider
;
private
_disposables
:
{
[
id
:
number
]:
IDisposable
[]
}
=
[];
constructor
(
documents
:
ExtHostDocuments
,
heapMonitor
:
ExtHostHeap
Monitor
,
provider
:
vscode
.
CompletionItemProvider
)
{
constructor
(
documents
:
ExtHostDocuments
,
heapMonitor
:
ExtHostHeap
Service
,
provider
:
vscode
.
CompletionItemProvider
)
{
this
.
_documents
=
documents
;
this
.
_heap
Monitor
=
heapMonitor
;
this
.
_heap
Service
=
heapMonitor
;
this
.
_provider
=
provider
;
}
...
...
@@ -545,7 +545,7 @@ class SuggestAdapter {
const
item
=
list
.
items
[
i
];
const
disposables
:
IDisposable
[]
=
[];
const
suggestion
=
TypeConverters
.
Suggest
.
from
(
item
,
disposables
);
const
id
=
this
.
_heap
Monitor
.
keep
(
item
,
()
=>
dispose
(
this
.
_disposables
[
id
]));
const
id
=
this
.
_heap
Service
.
keep
(
item
,
()
=>
dispose
(
this
.
_disposables
[
id
]));
this
.
_disposables
[
id
]
=
disposables
;
ObjectIdentifier
.
mixin
(
suggestion
,
id
);
...
...
@@ -586,7 +586,7 @@ class SuggestAdapter {
}
const
id
=
ObjectIdentifier
.
get
(
suggestion
);
const
item
=
this
.
_heap
Monitor
.
get
<
CompletionItem
>
(
id
);
const
item
=
this
.
_heap
Service
.
get
<
CompletionItem
>
(
id
);
if
(
!
item
)
{
return
TPromise
.
as
(
suggestion
);
}
...
...
@@ -662,7 +662,7 @@ export class ExtHostLanguageFeatures extends ExtHostLanguageFeaturesShape {
private
_proxy
:
MainThreadLanguageFeaturesShape
;
private
_documents
:
ExtHostDocuments
;
private
_commands
:
ExtHostCommands
;
private
_heapMonitor
:
ExtHostHeap
Monitor
;
private
_heapMonitor
:
ExtHostHeap
Service
;
private
_diagnostics
:
ExtHostDiagnostics
;
private
_adapter
:
{
[
handle
:
number
]:
Adapter
}
=
Object
.
create
(
null
);
...
...
@@ -670,7 +670,7 @@ export class ExtHostLanguageFeatures extends ExtHostLanguageFeaturesShape {
threadService
:
IThreadService
,
documents
:
ExtHostDocuments
,
commands
:
ExtHostCommands
,
heapMonitor
:
ExtHostHeap
Monitor
,
heapMonitor
:
ExtHostHeap
Service
,
diagnostics
:
ExtHostDiagnostics
)
{
super
();
...
...
src/vs/workbench/api/node/mainThreadHeap
Monitor
.ts
→
src/vs/workbench/api/node/mainThreadHeap
Service
.ts
浏览文件 @
af55c200
...
...
@@ -10,13 +10,13 @@ import {IThreadService} from 'vs/workbench/services/thread/common/threadService'
import
{
ExtHostContext
}
from
'
./extHost.protocol
'
;
import
{
onDidGarbageCollectSignals
,
consumeSignals
}
from
'
gc-signals
'
;
export
class
MainThreadHeap
Monitor
{
export
class
MainThreadHeap
Service
{
private
_subscription
:
IDisposable
;
private
_consumeHandle
:
number
;
constructor
(
@
IThreadService
threadService
:
IThreadService
)
{
const
proxy
=
threadService
.
get
(
ExtHostContext
.
ExtHostHeap
Monitor
);
const
proxy
=
threadService
.
get
(
ExtHostContext
.
ExtHostHeap
Service
);
this
.
_subscription
=
onDidGarbageCollectSignals
(
ids
=>
{
proxy
.
$onGarbageCollection
(
ids
);
...
...
src/vs/workbench/test/node/api/extHostApiCommands.test.ts
浏览文件 @
af55c200
...
...
@@ -23,7 +23,7 @@ import {ExtHostLanguageFeatures} from 'vs/workbench/api/node/extHostLanguageFeat
import
{
MainThreadLanguageFeatures
}
from
'
vs/workbench/api/node/mainThreadLanguageFeatures
'
;
import
{
registerApiCommands
}
from
'
vs/workbench/api/node/extHostApiCommands
'
;
import
{
ExtHostCommands
}
from
'
vs/workbench/api/node/extHostCommands
'
;
import
{
ExtHostHeap
Monitor
}
from
'
vs/workbench/api/node/extHostHeapMonitor
'
;
import
{
ExtHostHeap
Service
}
from
'
vs/workbench/api/node/extHostHeapService
'
;
import
{
MainThreadCommands
}
from
'
vs/workbench/api/node/mainThreadCommands
'
;
import
{
ExtHostDocuments
}
from
'
vs/workbench/api/node/extHostDocuments
'
;
import
*
as
ExtHostTypeConverters
from
'
vs/workbench/api/node/extHostTypeConverters
'
;
...
...
@@ -109,7 +109,7 @@ suite('ExtHostLanguageFeatureCommands', function() {
const
diagnostics
=
new
ExtHostDiagnostics
(
threadService
);
threadService
.
set
(
ExtHostContext
.
ExtHostDiagnostics
,
diagnostics
);
extHost
=
new
ExtHostLanguageFeatures
(
threadService
,
extHostDocuments
,
commands
,
new
ExtHostHeap
Monitor
(),
diagnostics
);
extHost
=
new
ExtHostLanguageFeatures
(
threadService
,
extHostDocuments
,
commands
,
new
ExtHostHeap
Service
(),
diagnostics
);
threadService
.
set
(
ExtHostContext
.
ExtHostLanguageFeatures
,
extHost
);
mainThread
=
threadService
.
setTestInstance
(
MainContext
.
MainThreadLanguageFeatures
,
instantiationService
.
createInstance
(
MainThreadLanguageFeatures
));
...
...
src/vs/workbench/test/node/api/extHostLanguageFeatures.test.ts
浏览文件 @
af55c200
...
...
@@ -39,7 +39,7 @@ import {getLinks} from 'vs/editor/contrib/links/common/links';
import
{
asWinJsPromise
}
from
'
vs/base/common/async
'
;
import
{
MainContext
,
ExtHostContext
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
import
{
ExtHostDiagnostics
}
from
'
vs/workbench/api/node/extHostDiagnostics
'
;
import
{
ExtHostHeap
Monitor
}
from
'
vs/workbench/api/node/extHostHeapMonitor
'
;
import
{
ExtHostHeap
Service
}
from
'
vs/workbench/api/node/extHostHeapService
'
;
const
defaultSelector
=
{
scheme
:
'
far
'
};
const
model
:
EditorCommon
.
IModel
=
EditorModel
.
createFromString
(
...
...
@@ -98,7 +98,7 @@ suite('ExtHostLanguageFeatures', function() {
const
diagnostics
=
new
ExtHostDiagnostics
(
threadService
);
threadService
.
set
(
ExtHostContext
.
ExtHostDiagnostics
,
diagnostics
);
extHost
=
new
ExtHostLanguageFeatures
(
threadService
,
extHostDocuments
,
commands
,
new
ExtHostHeap
Monitor
(),
diagnostics
);
extHost
=
new
ExtHostLanguageFeatures
(
threadService
,
extHostDocuments
,
commands
,
new
ExtHostHeap
Service
(),
diagnostics
);
threadService
.
set
(
ExtHostContext
.
ExtHostLanguageFeatures
,
extHost
);
mainThread
=
<
MainThreadLanguageFeatures
>
threadService
.
setTestInstance
(
MainContext
.
MainThreadLanguageFeatures
,
instantiationService
.
createInstance
(
MainThreadLanguageFeatures
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录