Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
4cc4ccef
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
4cc4ccef
编写于
2月 19, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Simplify AbstractModeWorker
上级
53d62465
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
52 addition
and
55 deletion
+52
-55
src/vs/editor/common/modes/abstractMode.ts
src/vs/editor/common/modes/abstractMode.ts
+3
-3
src/vs/editor/common/modes/abstractModeWorker.ts
src/vs/editor/common/modes/abstractModeWorker.ts
+5
-5
src/vs/languages/css/common/css.ts
src/vs/languages/css/common/css.ts
+1
-1
src/vs/languages/css/common/cssWorker.ts
src/vs/languages/css/common/cssWorker.ts
+6
-6
src/vs/languages/css/test/common/css-worker.test.ts
src/vs/languages/css/test/common/css-worker.test.ts
+2
-2
src/vs/languages/html/common/html.ts
src/vs/languages/html/common/html.ts
+1
-1
src/vs/languages/html/common/htmlWorker.ts
src/vs/languages/html/common/htmlWorker.ts
+3
-3
src/vs/languages/html/test/common/html-worker.test.ts
src/vs/languages/html/test/common/html-worker.test.ts
+1
-1
src/vs/languages/javascript/common/javascript.ts
src/vs/languages/javascript/common/javascript.ts
+1
-1
src/vs/languages/javascript/common/javascriptWorker.ts
src/vs/languages/javascript/common/javascriptWorker.ts
+3
-3
src/vs/languages/json/common/json.ts
src/vs/languages/json/common/json.ts
+1
-1
src/vs/languages/json/common/jsonWorker.ts
src/vs/languages/json/common/jsonWorker.ts
+4
-7
src/vs/languages/json/test/common/jsonworker.test.ts
src/vs/languages/json/test/common/jsonworker.test.ts
+1
-1
src/vs/languages/less/common/less.ts
src/vs/languages/less/common/less.ts
+1
-1
src/vs/languages/less/test/common/intellisense.test.ts
src/vs/languages/less/test/common/intellisense.test.ts
+1
-1
src/vs/languages/markdown/common/markdown.ts
src/vs/languages/markdown/common/markdown.ts
+1
-1
src/vs/languages/markdown/common/markdownWorker.ts
src/vs/languages/markdown/common/markdownWorker.ts
+2
-2
src/vs/languages/razor/common/razor.ts
src/vs/languages/razor/common/razor.ts
+1
-1
src/vs/languages/sass/common/sass.ts
src/vs/languages/sass/common/sass.ts
+1
-1
src/vs/languages/sass/test/common/sass-worker.test.ts
src/vs/languages/sass/test/common/sass-worker.test.ts
+1
-1
src/vs/languages/typescript/common/typescriptMode.ts
src/vs/languages/typescript/common/typescriptMode.ts
+1
-1
src/vs/languages/typescript/common/typescriptWorker2.ts
src/vs/languages/typescript/common/typescriptWorker2.ts
+6
-6
src/vs/workbench/parts/output/common/outputMode.ts
src/vs/workbench/parts/output/common/outputMode.ts
+2
-2
src/vs/workbench/parts/output/common/outputWorker.ts
src/vs/workbench/parts/output/common/outputWorker.ts
+3
-3
未找到文件。
src/vs/editor/common/modes/abstractMode.ts
浏览文件 @
4cc4ccef
...
...
@@ -58,7 +58,7 @@ export abstract class AbstractMode<W extends AbstractModeWorker> implements Mode
private
_getOrCreateWorker
():
TPromise
<
W
>
{
if
(
!
this
.
_workerPiecePromise
)
{
var
workerDescriptor
:
AsyncDescriptor2
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
W
>
=
this
.
_getWorkerDescriptor
();
var
workerDescriptor
:
AsyncDescriptor2
<
string
,
Modes
.
IWorkerParticipant
[],
W
>
=
this
.
_getWorkerDescriptor
();
// First, load the code of the worker (without instantiating it)
this
.
_workerPiecePromise
=
AbstractMode
.
_loadModule
(
workerDescriptor
.
moduleName
).
then
(()
=>
{
// Then, load & instantiate all the participants
...
...
@@ -67,7 +67,7 @@ export abstract class AbstractMode<W extends AbstractModeWorker> implements Mode
return
this
.
_instantiationService
.
createInstance
(
participant
);
}));
}).
then
((
participants
:
Modes
.
IWorkerParticipant
[])
=>
{
return
this
.
_instantiationService
.
createInstance
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
W
>
(
workerDescriptor
,
this
,
participants
);
return
this
.
_instantiationService
.
createInstance
<
string
,
Modes
.
IWorkerParticipant
[],
W
>
(
workerDescriptor
,
this
.
getId
()
,
participants
);
});
}
...
...
@@ -82,7 +82,7 @@ export abstract class AbstractMode<W extends AbstractModeWorker> implements Mode
});
}
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
W
>
{
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
string
,
Modes
.
IWorkerParticipant
[],
W
>
{
return
createAsyncDescriptor2
(
'
vs/editor/common/modes/nullWorker
'
,
'
NullWorker
'
);
}
...
...
src/vs/editor/common/modes/abstractModeWorker.ts
浏览文件 @
4cc4ccef
...
...
@@ -13,22 +13,22 @@ export abstract class AbstractModeWorker {
public
resourceService
:
IResourceService
;
public
markerService
:
IMarkerService
;
private
_mode
:
Modes
.
IMode
;
private
_mode
Id
:
string
;
constructor
(
mode
:
Modes
.
IMode
,
mode
Id
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
)
{
this
.
_mode
=
mode
;
this
.
_mode
Id
=
modeId
;
this
.
resourceService
=
resourceService
;
this
.
markerService
=
markerService
;
}
_getMode
():
Modes
.
IMode
{
return
this
.
_mode
;
_getMode
Id
():
string
{
return
this
.
_mode
Id
;
}
}
...
...
src/vs/languages/css/common/css.ts
浏览文件 @
4cc4ccef
...
...
@@ -366,7 +366,7 @@ export class CSSMode extends AbstractMode<cssWorker.CSSWorker> {
}
}
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
cssWorker
.
CSSWorker
>
{
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
string
,
Modes
.
IWorkerParticipant
[],
cssWorker
.
CSSWorker
>
{
return
createAsyncDescriptor2
(
'
vs/languages/css/common/cssWorker
'
,
'
CSSWorker
'
);
}
...
...
src/vs/languages/css/common/cssWorker.ts
浏览文件 @
4cc4ccef
...
...
@@ -36,18 +36,18 @@ export class CSSWorker extends AbstractModeWorker {
private
lintSettings
:
lintRules
.
IConfigurationSettings
;
private
_validationHelper
:
ValidationHelper
;
constructor
(
mode
:
Modes
.
IMode
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
constructor
(
mode
Id
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
)
{
super
(
mode
,
participants
,
resourceService
,
markerService
);
super
(
mode
Id
,
participants
,
resourceService
,
markerService
);
this
.
_validationHelper
=
new
ValidationHelper
(
this
.
resourceService
,
this
.
_getMode
().
get
Id
(),
this
.
_getModeId
(),
(
toValidate
)
=>
this
.
doValidate
(
toValidate
)
);
this
.
languageService
=
this
.
createLanguageService
(
resourceService
,
mode
.
getId
()
);
this
.
languageService
=
this
.
createLanguageService
(
resourceService
,
mode
Id
);
this
.
lintSettings
=
{};
this
.
validationEnabled
=
true
;
}
...
...
@@ -147,7 +147,7 @@ export class CSSWorker extends AbstractModeWorker {
private
doValidate1
(
resource
:
URI
):
void
{
if
(
!
this
.
validationEnabled
)
{
this
.
markerService
.
changeOne
(
this
.
_getMode
().
get
Id
(),
resource
,
[]);
this
.
markerService
.
changeOne
(
this
.
_getModeId
(),
resource
,
[]);
return
;
}
...
...
@@ -164,7 +164,7 @@ export class CSSWorker extends AbstractModeWorker {
.
filter
(
entry
=>
entry
.
getLevel
()
!==
_level
.
Level
.
Ignore
)
.
map
(
entry
=>
this
.
_createMarkerData
(
modelMirror
,
entry
));
this
.
markerService
.
changeOne
(
this
.
_getMode
().
get
Id
(),
resource
,
markerData
);
this
.
markerService
.
changeOne
(
this
.
_getModeId
(),
resource
,
markerData
);
});
}
...
...
src/vs/languages/css/test/common/css-worker.test.ts
浏览文件 @
4cc4ccef
...
...
@@ -40,7 +40,7 @@ suite('Validation - CSS', () => {
resourceService
:
resourceService
,
markerService
:
markerService
});
var
worker
=
new
cssWorker
.
CSSWorker
(
modesUtil
.
createMockMode
(
'
mock.mode.id
'
)
,
[],
services
.
resourceService
,
services
.
markerService
);
var
worker
=
new
cssWorker
.
CSSWorker
(
'
mock.mode.id
'
,
[],
services
.
resourceService
,
services
.
markerService
);
worker
.
doValidate
([
url
]);
var
markers
=
markerService
.
read
({
resource
:
url
});
...
...
@@ -62,7 +62,7 @@ suite('Validation - CSS', () => {
markerService
:
markerService
});
var
worker
=
new
cssWorker
.
CSSWorker
(
modesUtil
.
createMockMode
(
'
mock.mode.id
'
)
,
[],
services
.
resourceService
,
services
.
markerService
);
var
worker
=
new
cssWorker
.
CSSWorker
(
'
mock.mode.id
'
,
[],
services
.
resourceService
,
services
.
markerService
);
worker
.
doValidate
([
url
]);
var
markers
=
markerService
.
read
({
resource
:
url
});
...
...
src/vs/languages/html/common/html.ts
浏览文件 @
4cc4ccef
...
...
@@ -464,7 +464,7 @@ export class HTMLMode<W extends htmlWorker.HTMLWorker> extends AbstractMode<W> i
return
null
;
}
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
htmlWorker
.
HTMLWorker
>
{
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
string
,
Modes
.
IWorkerParticipant
[],
htmlWorker
.
HTMLWorker
>
{
return
createAsyncDescriptor2
(
'
vs/languages/html/common/htmlWorker
'
,
'
HTMLWorker
'
);
}
...
...
src/vs/languages/html/common/htmlWorker.ts
浏览文件 @
4cc4ccef
...
...
@@ -38,10 +38,10 @@ export class HTMLWorker extends AbstractModeWorker {
private
_tagProviders
:
htmlTags
.
IHTMLTagProvider
[];
constructor
(
mode
:
Modes
.
IMode
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
constructor
(
mode
Id
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
)
{
super
(
mode
,
participants
,
resourceService
,
markerService
);
super
(
mode
Id
,
participants
,
resourceService
,
markerService
);
this
.
_contextService
=
contextService
;
this
.
_tagProviders
=
[];
...
...
@@ -95,7 +95,7 @@ export class HTMLWorker extends AbstractModeWorker {
var
modeAtPosition
=
modelAtPosition
.
getMode
();
return
callback
(
modeAtPosition
.
getId
()
!==
this
.
_getMode
().
get
Id
(),
modelAtPosition
);
return
callback
(
modeAtPosition
.
getId
()
!==
this
.
_getModeId
(),
modelAtPosition
);
}
_delegateToAllModes
<
T
>
(
resource
:
URI
,
callback
:(
models
:
EditorCommon
.
IMirrorModel
[])
=>
T
):
T
{
...
...
src/vs/languages/html/test/common/html-worker.test.ts
浏览文件 @
4cc4ccef
...
...
@@ -40,7 +40,7 @@ suite('HTML - worker', () => {
markerService
:
markerService
});
var
worker
=
new
htmlWorker
.
HTMLWorker
(
mode
,
[],
services
.
resourceService
,
services
.
markerService
,
services
.
contextService
);
var
worker
=
new
htmlWorker
.
HTMLWorker
(
mode
.
getId
()
,
[],
services
.
resourceService
,
services
.
markerService
,
services
.
contextService
);
return
{
worker
:
worker
,
model
:
model
};
};
...
...
src/vs/languages/javascript/common/javascript.ts
浏览文件 @
4cc4ccef
...
...
@@ -143,7 +143,7 @@ export class JSMode extends typescriptMode.TypeScriptMode<javascriptWorker.JavaS
return
model
.
getMode
()
===
this
||
/
\.(
d
\.
ts|js
)
$/
.
test
(
model
.
getAssociatedResource
().
fsPath
);
}
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
javascriptWorker
.
JavaScriptWorker
>
{
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
string
,
Modes
.
IWorkerParticipant
[],
javascriptWorker
.
JavaScriptWorker
>
{
return
createAsyncDescriptor2
(
'
vs/languages/javascript/common/javascriptWorker
'
,
'
JavaScriptWorker
'
);
}
...
...
src/vs/languages/javascript/common/javascriptWorker.ts
浏览文件 @
4cc4ccef
...
...
@@ -30,10 +30,10 @@ export class JavaScriptWorker extends typeScriptWorker.TypeScriptWorker2 {
private
_fancyRewriters
:
rewriter
.
ISyntaxRewriter
[];
constructor
(
mode
:
Modes
.
IMode
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
constructor
(
mode
Id
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
)
{
super
(
mode
,
participants
,
resourceService
,
markerService
);
super
(
mode
Id
,
participants
,
resourceService
,
markerService
);
// since we colorize the shebang we should also always handle it
this
.
_projectService
.
defaultRewriter
=
[
new
ShebangRewriter
()];
...
...
@@ -72,7 +72,7 @@ export class JavaScriptWorker extends typeScriptWorker.TypeScriptWorker2 {
markers
.
push
(
marker
);
}
});
this
.
markerService
.
changeOne
(
`/
${
this
.
_getMode
().
get
Id
()
}
/semantic`
,
resource
,
markers
);
this
.
markerService
.
changeOne
(
`/
${
this
.
_getModeId
()
}
/semantic`
,
resource
,
markers
);
return
result
.
hasMissingFiles
;
}
}
...
...
src/vs/languages/json/common/json.ts
浏览文件 @
4cc4ccef
...
...
@@ -127,7 +127,7 @@ export class JSONMode extends AbstractMode<jsonWorker.JSONWorker> implements Mod
this
.
_worker
((
w
)
=>
w
.
setSchemaContributions
(
data
));
}
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
jsonWorker
.
JSONWorker
>
{
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
string
,
Modes
.
IWorkerParticipant
[],
jsonWorker
.
JSONWorker
>
{
return
createAsyncDescriptor2
(
'
vs/languages/json/common/jsonWorker
'
,
'
JSONWorker
'
);
}
...
...
src/vs/languages/json/common/jsonWorker.ts
浏览文件 @
4cc4ccef
...
...
@@ -17,7 +17,6 @@ import JSONSchema = require('vs/base/common/jsonSchema');
import
JSONIntellisense
=
require
(
'
./jsonIntellisense
'
);
import
WinJS
=
require
(
'
vs/base/common/winjs.base
'
);
import
Strings
=
require
(
'
vs/base/common/strings
'
);
import
{
JSONMode
}
from
'
./json
'
;
import
ProjectJSONContribution
=
require
(
'
./contributions/projectJSONContribution
'
);
import
PackageJSONContribution
=
require
(
'
./contributions/packageJSONContribution
'
);
import
BowerJSONContribution
=
require
(
'
./contributions/bowerJSONContribution
'
);
...
...
@@ -76,24 +75,22 @@ export class JSONWorker extends AbstractModeWorker implements Modes.IExtraInfoSu
private
requestService
:
IRequestService
;
private
contextService
:
IWorkspaceContextService
;
private
jsonIntellisense
:
JSONIntellisense
.
JSONIntellisense
;
private
jsonMode
:
JSONMode
;
private
contributions
:
IJSONWorkerContribution
[];
private
_validationHelper
:
ValidationHelper
;
constructor
(
mode
:
Modes
.
IMode
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
constructor
(
mode
Id
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
,
@
IRequestService
requestService
:
IRequestService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
)
{
super
(
mode
,
participants
,
resourceService
,
markerService
);
super
(
mode
Id
,
participants
,
resourceService
,
markerService
);
this
.
_validationHelper
=
new
ValidationHelper
(
this
.
resourceService
,
this
.
_getMode
().
get
Id
(),
this
.
_getModeId
(),
(
toValidate
)
=>
this
.
doValidate
(
toValidate
)
);
this
.
jsonMode
=
<
JSONMode
>
mode
;
this
.
requestService
=
requestService
;
this
.
contextService
=
contextService
;
this
.
schemaService
=
instantiationService
.
createInstance
(
SchemaService
.
JSONSchemaService
);
...
...
@@ -255,7 +252,7 @@ export class JSONWorker extends AbstractModeWorker implements Modes.IExtraInfoSu
}
});
this
.
markerService
.
changeOne
(
this
.
_getMode
().
get
Id
(),
resource
,
markerData
);
this
.
markerService
.
changeOne
(
this
.
_getModeId
(),
resource
,
markerData
);
});
}
...
...
src/vs/languages/json/test/common/jsonworker.test.ts
浏览文件 @
4cc4ccef
...
...
@@ -41,7 +41,7 @@ suite('JSON - Worker', () => {
var
_instantiationService
=
instantiationService
.
create
({
resourceService
:
resourceModelMock
});
var
worker
=
_instantiationService
.
createInstance
(
jsonworker
.
JSONWorker
,
mm
.
getMode
(),
[]);
var
worker
=
_instantiationService
.
createInstance
(
jsonworker
.
JSONWorker
,
mm
.
getMode
()
.
getId
()
,
[]);
return
{
worker
:
worker
,
model
:
mm
};
};
...
...
src/vs/languages/less/common/less.ts
浏览文件 @
4cc4ccef
...
...
@@ -227,7 +227,7 @@ export class LESSMode extends Monarch.MonarchMode<lessWorker.LessWorker> impleme
}
}
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
lessWorker
.
LessWorker
>
{
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
string
,
Modes
.
IWorkerParticipant
[],
lessWorker
.
LessWorker
>
{
return
createAsyncDescriptor2
(
'
vs/languages/less/common/lessWorker
'
,
'
LessWorker
'
);
}
...
...
src/vs/languages/less/test/common/intellisense.test.ts
浏览文件 @
4cc4ccef
...
...
@@ -29,7 +29,7 @@ suite('LESS - Intellisense', () => {
resourceService
:
resourceService
,
});
var
worker
=
new
lessWorker
.
LessWorker
(
modesUtil
.
createMockMode
(
'
mock.mode.id
'
)
,
[],
services
.
resourceService
,
services
.
markerService
);
var
worker
=
new
lessWorker
.
LessWorker
(
'
mock.mode.id
'
,
[],
services
.
resourceService
,
services
.
markerService
);
var
position
:
EditorCommon
.
IPosition
;
if
(
stringBefore
===
null
)
{
position
=
{
column
:
1
,
lineNumber
:
1
};
...
...
src/vs/languages/markdown/common/markdown.ts
浏览文件 @
4cc4ccef
...
...
@@ -244,7 +244,7 @@ export class MarkdownMode extends Monarch.MonarchMode<MarkdownWorker.MarkdownWor
return
this
.
_worker
((
w
)
=>
w
.
getEmitOutput
(
resource
,
absoluteWorkerResourcesPath
));
}
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
MarkdownWorker
.
MarkdownWorker
>
{
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
string
,
Modes
.
IWorkerParticipant
[],
MarkdownWorker
.
MarkdownWorker
>
{
return
createAsyncDescriptor2
(
'
vs/languages/markdown/common/markdownWorker
'
,
'
MarkdownWorker
'
);
}
}
src/vs/languages/markdown/common/markdownWorker.ts
浏览文件 @
4cc4ccef
...
...
@@ -97,12 +97,12 @@ export class MarkdownWorker extends AbstractModeWorker {
private
modeService
:
IModeService
;
constructor
(
mode
:
Modes
.
IMode
,
participants
:
Modes
.
IWorkerParticipant
[],
mode
Id
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
,
@
IModeService
modeService
:
IModeService
)
{
super
(
mode
,
participants
,
resourceService
,
markerService
);
super
(
mode
Id
,
participants
,
resourceService
,
markerService
);
this
.
modeService
=
modeService
;
}
...
...
src/vs/languages/razor/common/razor.ts
浏览文件 @
4cc4ccef
...
...
@@ -110,7 +110,7 @@ export class RAZORMode extends htmlMode.HTMLMode<RAZORWorker> {
});
}
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
RAZORWorker
>
{
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
string
,
Modes
.
IWorkerParticipant
[],
RAZORWorker
>
{
return
createAsyncDescriptor2
(
'
vs/languages/razor/common/razorWorker
'
,
'
RAZORWorker
'
);
}
...
...
src/vs/languages/sass/common/sass.ts
浏览文件 @
4cc4ccef
...
...
@@ -329,7 +329,7 @@ export class SASSMode extends Monarch.MonarchMode<sassWorker.SassWorker> impleme
}
}
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
sassWorker
.
SassWorker
>
{
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
string
,
Modes
.
IWorkerParticipant
[],
sassWorker
.
SassWorker
>
{
return
createAsyncDescriptor2
(
'
vs/languages/sass/common/sassWorker
'
,
'
SassWorker
'
);
}
...
...
src/vs/languages/sass/test/common/sass-worker.test.ts
浏览文件 @
4cc4ccef
...
...
@@ -26,7 +26,7 @@ suite('SASS - Worker', () => {
resourceService
:
resourceService
,
});
var
worker
=
new
sassWorker
.
SassWorker
(
modesUtil
.
createMockMode
(
'
mock.mode.id
'
)
,
[],
services
.
resourceService
,
services
.
markerService
);
var
worker
=
new
sassWorker
.
SassWorker
(
'
mock.mode.id
'
,
[],
services
.
resourceService
,
services
.
markerService
);
return
{
worker
:
worker
,
model
:
model
};
};
...
...
src/vs/languages/typescript/common/typescriptMode.ts
浏览文件 @
4cc4ccef
...
...
@@ -395,7 +395,7 @@ export class TypeScriptMode<W extends typescriptWorker.TypeScriptWorker2> extend
// ---- worker talk
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
Modes
.
IMode
,
Modes
.
IWorkerParticipant
[],
typescriptWorker
.
TypeScriptWorker2
>
{
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
string
,
Modes
.
IWorkerParticipant
[],
typescriptWorker
.
TypeScriptWorker2
>
{
return
createAsyncDescriptor2
(
'
vs/languages/typescript/common/typescriptWorker2
'
,
'
TypeScriptWorker2
'
);
}
...
...
src/vs/languages/typescript/common/typescriptWorker2.ts
浏览文件 @
4cc4ccef
...
...
@@ -43,14 +43,14 @@ export class TypeScriptWorker2 extends AbstractModeWorker {
protected
_disposables
:
lifecycle
.
IDisposable
[]
=
[];
private
_validationHelper
:
ValidationHelper
;
constructor
(
mode
:
Modes
.
IMode
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
constructor
(
mode
Id
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
)
{
super
(
mode
,
participants
,
resourceService
,
markerService
);
super
(
mode
Id
,
participants
,
resourceService
,
markerService
);
this
.
_validationHelper
=
new
ValidationHelper
(
this
.
resourceService
,
this
.
_getMode
().
get
Id
(),
this
.
_getModeId
(),
(
toValidate
)
=>
this
.
doValidate
(
toValidate
)
);
...
...
@@ -76,7 +76,7 @@ export class TypeScriptWorker2 extends AbstractModeWorker {
return
(
/
\.(
ts|js
)
$/
.
test
(
element
.
getAssociatedResource
().
fsPath
)
||
element
.
getMode
()
===
this
.
_getMode
()
element
.
getMode
()
.
getId
()
===
this
.
_getModeId
()
);
}
...
...
@@ -177,14 +177,14 @@ export class TypeScriptWorker2 extends AbstractModeWorker {
markers
.
push
.
apply
(
markers
,
diagnostics
.
getSyntacticDiagnostics
(
project
.
languageService
,
resource
,
project
.
host
.
getCompilationSettings
(),
this
.
_options
,
this
.
resourceService
.
get
(
resource
).
getMode
().
getId
()
===
'
javascript
'
));
markers
.
push
.
apply
(
markers
,
diagnostics
.
getExtraDiagnostics
(
project
.
languageService
,
resource
,
this
.
_options
));
this
.
markerService
.
changeOne
(
`/
${
this
.
_getMode
().
get
Id
()
}
/syntactic`
,
resource
,
markers
);
this
.
markerService
.
changeOne
(
`/
${
this
.
_getModeId
()
}
/syntactic`
,
resource
,
markers
);
}
public
doValidateSemantics
(
resource
:
URI
):
boolean
{
var
project
=
this
.
_projectService
.
getProject
(
resource
);
var
result
=
diagnostics
.
getSemanticDiagnostics
(
project
.
languageService
,
resource
,
this
.
_options
);
if
(
result
)
{
this
.
markerService
.
changeOne
(
`/
${
this
.
_getMode
().
get
Id
()
}
/semantic`
,
resource
,
result
.
markers
);
this
.
markerService
.
changeOne
(
`/
${
this
.
_getModeId
()
}
/semantic`
,
resource
,
result
.
markers
);
return
result
.
hasMissingFiles
;
}
}
...
...
src/vs/workbench/parts/output/common/outputMode.ts
浏览文件 @
4cc4ccef
...
...
@@ -7,7 +7,7 @@
import
{
MonarchMode
}
from
'
vs/editor/common/modes/monarch/monarch
'
;
import
types
=
require
(
'
vs/editor/common/modes/monarch/monarchTypes
'
);
import
{
compile
}
from
'
vs/editor/common/modes/monarch/monarchCompile
'
;
import
{
IModeDescriptor
,
I
Mode
,
I
WorkerParticipant
}
from
'
vs/editor/common/modes
'
;
import
{
IModeDescriptor
,
IWorkerParticipant
}
from
'
vs/editor/common/modes
'
;
import
{
AsyncDescriptor2
,
createAsyncDescriptor2
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
...
...
@@ -61,7 +61,7 @@ export class OutputMode extends MonarchMode<OutputWorker> {
this
.
linkSupport
=
this
;
}
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
IMode
,
IWorkerParticipant
[],
OutputWorker
>
{
protected
_getWorkerDescriptor
():
AsyncDescriptor2
<
string
,
IWorkerParticipant
[],
OutputWorker
>
{
return
createAsyncDescriptor2
(
'
vs/workbench/parts/output/common/outputWorker
'
,
'
OutputWorker
'
);
}
...
...
src/vs/workbench/parts/output/common/outputWorker.ts
浏览文件 @
4cc4ccef
...
...
@@ -12,7 +12,7 @@ import URI from 'vs/base/common/uri';
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
arrays
=
require
(
'
vs/base/common/arrays
'
);
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
{
ILink
,
I
Mode
,
I
WorkerParticipant
}
from
'
vs/editor/common/modes
'
;
import
{
ILink
,
IWorkerParticipant
}
from
'
vs/editor/common/modes
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
IWorkspaceContextService
,
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
...
...
@@ -23,9 +23,9 @@ export class OutputWorker extends AbstractModeWorker {
private
_contextService
:
IWorkspaceContextService
;
private
patterns
:
RegExp
[];
constructor
(
mode
:
IMode
,
participants
:
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
constructor
(
mode
Id
:
string
,
participants
:
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
)
{
super
(
mode
,
participants
,
resourceService
,
markerService
);
super
(
mode
Id
,
participants
,
resourceService
,
markerService
);
this
.
_contextService
=
contextService
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录