Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
eaba0951
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,发现更多精彩内容 >>
提交
eaba0951
编写于
2月 19, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove AbstractModeWorker
上级
4cc4ccef
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
111 addition
and
99 deletion
+111
-99
src/vs/editor/common/modes/abstractMode.ts
src/vs/editor/common/modes/abstractMode.ts
+2
-3
src/vs/editor/common/modes/abstractModeWorker.ts
src/vs/editor/common/modes/abstractModeWorker.ts
+0
-35
src/vs/editor/common/modes/monarch/monarch.ts
src/vs/editor/common/modes/monarch/monarch.ts
+1
-2
src/vs/editor/common/modes/nullWorker.ts
src/vs/editor/common/modes/nullWorker.ts
+14
-5
src/vs/editor/common/worker/editorWorkerServer.ts
src/vs/editor/common/worker/editorWorkerServer.ts
+0
-2
src/vs/languages/css/common/cssWorker.ts
src/vs/languages/css/common/cssWorker.ts
+16
-9
src/vs/languages/html/common/htmlWorker.ts
src/vs/languages/html/common/htmlWorker.ts
+16
-8
src/vs/languages/javascript/common/javascriptWorker.ts
src/vs/languages/javascript/common/javascriptWorker.ts
+1
-1
src/vs/languages/json/common/jsonWorker.ts
src/vs/languages/json/common/jsonWorker.ts
+18
-9
src/vs/languages/markdown/common/markdownWorker.ts
src/vs/languages/markdown/common/markdownWorker.ts
+9
-5
src/vs/languages/php/common/php.ts
src/vs/languages/php/common/php.ts
+1
-2
src/vs/languages/plaintext/common/plaintext.ts
src/vs/languages/plaintext/common/plaintext.ts
+1
-2
src/vs/languages/typescript/common/typescriptWorker2.ts
src/vs/languages/typescript/common/typescriptWorker2.ts
+17
-9
src/vs/workbench/parts/output/common/outputWorker.ts
src/vs/workbench/parts/output/common/outputWorker.ts
+15
-7
未找到文件。
src/vs/editor/common/modes/abstractMode.ts
浏览文件 @
eaba0951
...
...
@@ -7,7 +7,6 @@
import
{
EventEmitter
}
from
'
vs/base/common/eventEmitter
'
;
import
{
NullMode
}
from
'
vs/editor/common/modes/nullMode
'
;
import
{
TextualSuggestSupport
}
from
'
vs/editor/common/modes/supports/suggestSupport
'
;
import
{
AbstractModeWorker
}
from
'
vs/editor/common/modes/abstractModeWorker
'
;
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -21,7 +20,7 @@ export function createWordRegExp(allowInWords:string = ''): RegExp {
return
NullMode
.
createWordRegExp
(
allowInWords
);
}
export
abstract
class
AbstractMode
<
W
extends
AbstractModeWorker
>
implements
Modes
.
IMode
{
export
abstract
class
AbstractMode
<
W
>
implements
Modes
.
IMode
{
_instantiationService
:
IInstantiationService
;
_threadService
:
IThreadService
;
...
...
@@ -245,7 +244,7 @@ export var isDigit:(character:string, base:number)=>boolean = (function () {
};
})();
export
class
FrankensteinMode
extends
AbstractMode
<
AbstractModeWorker
>
{
export
class
FrankensteinMode
extends
AbstractMode
<
void
>
{
public
suggestSupport
:
Modes
.
ISuggestSupport
;
...
...
src/vs/editor/common/modes/abstractModeWorker.ts
已删除
100644 → 0
浏览文件 @
4cc4ccef
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IResourceService
}
from
'
vs/editor/common/services/resourceService
'
;
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
export
abstract
class
AbstractModeWorker
{
public
resourceService
:
IResourceService
;
public
markerService
:
IMarkerService
;
private
_modeId
:
string
;
constructor
(
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
)
{
this
.
_modeId
=
modeId
;
this
.
resourceService
=
resourceService
;
this
.
markerService
=
markerService
;
}
_getModeId
():
string
{
return
this
.
_modeId
;
}
}
src/vs/editor/common/modes/monarch/monarch.ts
浏览文件 @
eaba0951
...
...
@@ -10,7 +10,6 @@
*/
import
{
AbstractMode
}
from
'
vs/editor/common/modes/abstractMode
'
;
import
{
AbstractModeWorker
}
from
'
vs/editor/common/modes/abstractModeWorker
'
;
import
{
ILexer
}
from
'
vs/editor/common/modes/monarch/monarchCommon
'
;
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
MonarchDefinition
=
require
(
'
vs/editor/common/modes/monarch/monarchDefinition
'
);
...
...
@@ -25,7 +24,7 @@ import {IEditorWorkerService} from 'vs/editor/common/services/editorWorkerServic
/**
* The MonarchMode creates a Monaco language mode given a certain language description
*/
export
class
MonarchMode
<
W
extends
AbstractModeWorker
>
extends
AbstractMode
<
W
>
{
export
class
MonarchMode
<
W
>
extends
AbstractMode
<
W
>
{
public
suggestSupport
:
Modes
.
ISuggestSupport
;
public
tokenizationSupport
:
Modes
.
ITokenizationSupport
;
...
...
src/vs/editor/common/modes/nullWorker.ts
浏览文件 @
eaba0951
...
...
@@ -4,11 +4,20 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
AbstractModeWorker
}
from
'
vs/editor/common/modes/abstractModeWorker
'
;
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IResourceService
}
from
'
vs/editor/common/services/resourceService
'
;
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
/// <summary>
/// This is a special worker that does nothing
/// </summary>
export
class
NullWorker
extends
AbstractModeWorker
{
export
class
NullWorker
{
constructor
(
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
)
{
// console.log('null worker created');
}
}
src/vs/editor/common/worker/editorWorkerServer.ts
浏览文件 @
eaba0951
...
...
@@ -5,8 +5,6 @@
'
use strict
'
;
// Require the modes worker since it is used in all workers to avoid rebundleing of the code with all worker
import
'
vs/editor/common/modes/abstractModeWorker
'
;
// include these in the editor bundle because they are widely used by many languages
import
'
vs/editor/common/languages.common
'
;
...
...
src/vs/languages/css/common/cssWorker.ts
浏览文件 @
eaba0951
...
...
@@ -9,7 +9,6 @@ import URI from 'vs/base/common/uri';
import
_severity
from
'
vs/base/common/severity
'
;
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
winjs
=
require
(
'
vs/base/common/winjs.base
'
);
import
{
AbstractModeWorker
}
from
'
vs/editor/common/modes/abstractModeWorker
'
;
import
languageService
=
require
(
'
vs/languages/css/common/services/cssLanguageService
'
);
import
languageFacts
=
require
(
'
vs/languages/css/common/services/languageFacts
'
);
import
occurrences
=
require
(
'
./services/occurrences
'
);
...
...
@@ -28,22 +27,30 @@ import {IResourceService} from 'vs/editor/common/services/resourceService';
import
{
filterSuggestions
}
from
'
vs/editor/common/modes/supports/suggestSupport
'
;
import
{
ValidationHelper
}
from
'
vs/editor/common/worker/validationHelper
'
;
export
class
CSSWorker
extends
AbstractModeWorker
{
export
class
CSSWorker
{
public
languageService
:
languageService
.
ILanguageService
;
private
resourceService
:
IResourceService
;
private
markerService
:
IMarkerService
;
private
_modeId
:
string
;
private
validationEnabled
:
boolean
;
private
lintSettings
:
lintRules
.
IConfigurationSettings
;
private
_validationHelper
:
ValidationHelper
;
constructor
(
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
)
{
constructor
(
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
)
{
super
(
modeId
,
participants
,
resourceService
,
markerService
);
this
.
_modeId
=
modeId
;
this
.
resourceService
=
resourceService
;
this
.
markerService
=
markerService
;
this
.
_validationHelper
=
new
ValidationHelper
(
this
.
resourceService
,
this
.
_
getModeId
()
,
this
.
_
modeId
,
(
toValidate
)
=>
this
.
doValidate
(
toValidate
)
);
...
...
@@ -147,7 +154,7 @@ export class CSSWorker extends AbstractModeWorker {
private
doValidate1
(
resource
:
URI
):
void
{
if
(
!
this
.
validationEnabled
)
{
this
.
markerService
.
changeOne
(
this
.
_
getModeId
()
,
resource
,
[]);
this
.
markerService
.
changeOne
(
this
.
_
modeId
,
resource
,
[]);
return
;
}
...
...
@@ -164,7 +171,7 @@ export class CSSWorker extends AbstractModeWorker {
.
filter
(
entry
=>
entry
.
getLevel
()
!==
_level
.
Level
.
Ignore
)
.
map
(
entry
=>
this
.
_createMarkerData
(
modelMirror
,
entry
));
this
.
markerService
.
changeOne
(
this
.
_
getModeId
()
,
resource
,
markerData
);
this
.
markerService
.
changeOne
(
this
.
_
modeId
,
resource
,
markerData
);
});
}
...
...
src/vs/languages/html/common/htmlWorker.ts
浏览文件 @
eaba0951
...
...
@@ -6,7 +6,6 @@
import
URI
from
'
vs/base/common/uri
'
;
import
winjs
=
require
(
'
vs/base/common/winjs.base
'
);
import
{
AbstractModeWorker
}
from
'
vs/editor/common/modes/abstractModeWorker
'
;
import
beautifyHTML
=
require
(
'
vs/languages/lib/common/beautify-html
'
);
import
htmlTags
=
require
(
'
vs/languages/html/common/htmlTags
'
);
import
network
=
require
(
'
vs/base/common/network
'
);
...
...
@@ -32,16 +31,25 @@ interface IColorRange {
value
:
string
;
}
export
class
HTMLWorker
extends
AbstractModeWorker
{
export
class
HTMLWorker
{
private
_contextService
:
IWorkspaceContextService
;
private
resourceService
:
IResourceService
;
private
markerService
:
IMarkerService
;
private
_modeId
:
string
;
private
_tagProviders
:
htmlTags
.
IHTMLTagProvider
[];
constructor
(
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
)
{
super
(
modeId
,
participants
,
resourceService
,
markerService
);
constructor
(
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
)
{
this
.
_modeId
=
modeId
;
this
.
resourceService
=
resourceService
;
this
.
markerService
=
markerService
;
this
.
_contextService
=
contextService
;
this
.
_tagProviders
=
[];
...
...
@@ -95,7 +103,7 @@ export class HTMLWorker extends AbstractModeWorker {
var
modeAtPosition
=
modelAtPosition
.
getMode
();
return
callback
(
modeAtPosition
.
getId
()
!==
this
.
_
getModeId
()
,
modelAtPosition
);
return
callback
(
modeAtPosition
.
getId
()
!==
this
.
_
modeId
,
modelAtPosition
);
}
_delegateToAllModes
<
T
>
(
resource
:
URI
,
callback
:(
models
:
EditorCommon
.
IMirrorModel
[])
=>
T
):
T
{
...
...
src/vs/languages/javascript/common/javascriptWorker.ts
浏览文件 @
eaba0951
...
...
@@ -72,7 +72,7 @@ export class JavaScriptWorker extends typeScriptWorker.TypeScriptWorker2 {
markers
.
push
(
marker
);
}
});
this
.
markerService
.
changeOne
(
`/
${
this
.
_
getModeId
()
}
/semantic`
,
resource
,
markers
);
this
.
markerService
.
changeOne
(
`/
${
this
.
_
modeId
}
/semantic`
,
resource
,
markers
);
return
result
.
hasMissingFiles
;
}
}
...
...
src/vs/languages/json/common/jsonWorker.ts
浏览文件 @
eaba0951
...
...
@@ -8,7 +8,6 @@ import URI from 'vs/base/common/uri';
import
Severity
from
'
vs/base/common/severity
'
;
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
{
AbstractModeWorker
}
from
'
vs/editor/common/modes/abstractModeWorker
'
;
import
HtmlContent
=
require
(
'
vs/base/common/htmlContent
'
);
import
Parser
=
require
(
'
./parser/jsonParser
'
);
import
JSONFormatter
=
require
(
'
vs/languages/json/common/features/jsonFormatter
'
);
...
...
@@ -69,7 +68,7 @@ export interface IJSONWorkerContribution {
collectDefaultSuggestions
(
resource
:
URI
,
result
:
ISuggestionsCollector
):
WinJS
.
Promise
;
}
export
class
JSONWorker
extends
AbstractModeWorker
implements
Modes
.
IExtraInfoSupport
{
export
class
JSONWorker
implements
Modes
.
IExtraInfoSupport
{
private
schemaService
:
SchemaService
.
IJSONSchemaService
;
private
requestService
:
IRequestService
;
...
...
@@ -77,17 +76,27 @@ export class JSONWorker extends AbstractModeWorker implements Modes.IExtraInfoSu
private
jsonIntellisense
:
JSONIntellisense
.
JSONIntellisense
;
private
contributions
:
IJSONWorkerContribution
[];
private
_validationHelper
:
ValidationHelper
;
constructor
(
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
,
@
IRequestService
requestService
:
IRequestService
,
private
resourceService
:
IResourceService
;
private
markerService
:
IMarkerService
;
private
_modeId
:
string
;
constructor
(
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
,
@
IRequestService
requestService
:
IRequestService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
)
{
@
IInstantiationService
instantiationService
:
IInstantiationService
)
{
super
(
modeId
,
participants
,
resourceService
,
markerService
);
this
.
_modeId
=
modeId
;
this
.
resourceService
=
resourceService
;
this
.
markerService
=
markerService
;
this
.
_validationHelper
=
new
ValidationHelper
(
this
.
resourceService
,
this
.
_
getModeId
()
,
this
.
_
modeId
,
(
toValidate
)
=>
this
.
doValidate
(
toValidate
)
);
...
...
@@ -252,7 +261,7 @@ export class JSONWorker extends AbstractModeWorker implements Modes.IExtraInfoSu
}
});
this
.
markerService
.
changeOne
(
this
.
_
getModeId
()
,
resource
,
markerData
);
this
.
markerService
.
changeOne
(
this
.
_
modeId
,
resource
,
markerData
);
});
}
...
...
src/vs/languages/markdown/common/markdownWorker.ts
浏览文件 @
eaba0951
...
...
@@ -5,7 +5,6 @@
'
use strict
'
;
import
WinJS
=
require
(
'
vs/base/common/winjs.base
'
);
import
{
AbstractModeWorker
}
from
'
vs/editor/common/modes/abstractModeWorker
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
Types
=
require
(
'
vs/base/common/types
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
...
...
@@ -23,7 +22,7 @@ enum Theme {
HC_BLACK
}
export
class
MarkdownWorker
extends
AbstractModeWorker
{
export
class
MarkdownWorker
{
private
static
DEFAULT_MODE
=
'
text/plain
'
;
...
...
@@ -95,15 +94,20 @@ export class MarkdownWorker extends AbstractModeWorker {
].
join
(
'
\n
'
);
private
modeService
:
IModeService
;
private
resourceService
:
IResourceService
;
private
markerService
:
IMarkerService
;
private
_modeId
:
string
;
constructor
(
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
,
@
IModeService
modeService
:
IModeService
)
{
super
(
modeId
,
participants
,
resourceService
,
markerService
);
this
.
_modeId
=
modeId
;
this
.
resourceService
=
resourceService
;
this
.
markerService
=
markerService
;
this
.
modeService
=
modeService
;
}
...
...
src/vs/languages/php/common/php.ts
浏览文件 @
eaba0951
...
...
@@ -12,7 +12,6 @@ import {AbstractState} from 'vs/editor/common/modes/abstractState';
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
AbstractModeWorker
}
from
'
vs/editor/common/modes/abstractModeWorker
'
;
import
{
RichEditSupport
}
from
'
vs/editor/common/modes/supports/richEditSupport
'
;
import
{
TokenizationSupport
,
ILeavingNestedModeData
,
ITokenizationCustomization
}
from
'
vs/editor/common/modes/supports/tokenizationSupport
'
;
import
{
TextualSuggestSupport
}
from
'
vs/editor/common/modes/supports/suggestSupport
'
;
...
...
@@ -459,7 +458,7 @@ export class PHPEnterHTMLState extends PHPState {
}
export
class
PHPMode
extends
AbstractMode
<
AbstractModeWorker
>
implements
ITokenizationCustomization
{
export
class
PHPMode
extends
AbstractMode
<
void
>
implements
ITokenizationCustomization
{
public
tokenizationSupport
:
Modes
.
ITokenizationSupport
;
public
richEditSupport
:
Modes
.
IRichEditSupport
;
...
...
src/vs/languages/plaintext/common/plaintext.ts
浏览文件 @
eaba0951
...
...
@@ -9,7 +9,6 @@ import {AbstractMode} from 'vs/editor/common/modes/abstractMode';
import
{
AbstractState
}
from
'
vs/editor/common/modes/abstractState
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
AbstractModeWorker
}
from
'
vs/editor/common/modes/abstractModeWorker
'
;
import
{
TokenizationSupport
}
from
'
vs/editor/common/modes/supports/tokenizationSupport
'
;
import
{
TextualSuggestSupport
}
from
'
vs/editor/common/modes/supports/suggestSupport
'
;
import
{
IEditorWorkerService
}
from
'
vs/editor/common/services/editorWorkerService
'
;
...
...
@@ -39,7 +38,7 @@ class State extends AbstractState {
}
}
export
class
Mode
extends
AbstractMode
<
AbstractModeWorker
>
{
export
class
Mode
extends
AbstractMode
<
void
>
{
public
suggestSupport
:
Modes
.
ISuggestSupport
;
public
tokenizationSupport
:
Modes
.
ITokenizationSupport
;
...
...
src/vs/languages/typescript/common/typescriptWorker2.ts
浏览文件 @
eaba0951
...
...
@@ -10,7 +10,6 @@ import URI from 'vs/base/common/uri';
import
lifecycle
=
require
(
'
vs/base/common/lifecycle
'
);
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
{
AbstractModeWorker
}
from
'
vs/editor/common/modes/abstractModeWorker
'
;
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
ts
=
require
(
'
vs/languages/typescript/common/lib/typescriptServices
'
);
import
Options
=
require
(
'
vs/languages/typescript/common/options
'
);
...
...
@@ -34,7 +33,7 @@ import {IMarker, IMarkerService} from 'vs/platform/markers/common/markers';
import
{
filterSuggestions
}
from
'
vs/editor/common/modes/supports/suggestSupport
'
;
import
{
ValidationHelper
}
from
'
vs/editor/common/worker/validationHelper
'
;
export
class
TypeScriptWorker2
extends
AbstractModeWorker
{
export
class
TypeScriptWorker2
{
private
_modelListener
:
{
[
resource
:
string
]:
Function
}
=
Object
.
create
(
null
);
...
...
@@ -42,15 +41,24 @@ export class TypeScriptWorker2 extends AbstractModeWorker {
protected
_options
:
Options
;
protected
_disposables
:
lifecycle
.
IDisposable
[]
=
[];
private
_validationHelper
:
ValidationHelper
;
private
resourceService
:
IResourceService
;
protected
markerService
:
IMarkerService
;
protected
_modeId
:
string
;
constructor
(
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
)
{
constructor
(
modeId
:
string
,
participants
:
Modes
.
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
)
{
super
(
modeId
,
participants
,
resourceService
,
markerService
);
this
.
_modeId
=
modeId
;
this
.
resourceService
=
resourceService
;
this
.
markerService
=
markerService
;
this
.
_validationHelper
=
new
ValidationHelper
(
this
.
resourceService
,
this
.
_
getModeId
()
,
this
.
_
modeId
,
(
toValidate
)
=>
this
.
doValidate
(
toValidate
)
);
...
...
@@ -76,7 +84,7 @@ export class TypeScriptWorker2 extends AbstractModeWorker {
return
(
/
\.(
ts|js
)
$/
.
test
(
element
.
getAssociatedResource
().
fsPath
)
||
element
.
getMode
().
getId
()
===
this
.
_
getModeId
()
element
.
getMode
().
getId
()
===
this
.
_
modeId
);
}
...
...
@@ -177,14 +185,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
.
_
getModeId
()
}
/syntactic`
,
resource
,
markers
);
this
.
markerService
.
changeOne
(
`/
${
this
.
_
modeId
}
/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
.
_
getModeId
()
}
/semantic`
,
resource
,
result
.
markers
);
this
.
markerService
.
changeOne
(
`/
${
this
.
_
modeId
}
/semantic`
,
resource
,
result
.
markers
);
return
result
.
hasMissingFiles
;
}
}
...
...
src/vs/workbench/parts/output/common/outputWorker.ts
浏览文件 @
eaba0951
...
...
@@ -7,7 +7,6 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IResourceService
}
from
'
vs/editor/common/services/resourceService
'
;
import
{
AbstractModeWorker
}
from
'
vs/editor/common/modes/abstractModeWorker
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
arrays
=
require
(
'
vs/base/common/arrays
'
);
...
...
@@ -19,14 +18,23 @@ import {IWorkspaceContextService, IWorkspace} from 'vs/platform/workspace/common
/**
* A base class of text editor worker that helps with detecting links in the text that point to files in the workspace.
*/
export
class
OutputWorker
extends
AbstractModeWorker
{
export
class
OutputWorker
{
private
_contextService
:
IWorkspaceContextService
;
private
patterns
:
RegExp
[];
constructor
(
modeId
:
string
,
participants
:
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
)
{
super
(
modeId
,
participants
,
resourceService
,
markerService
);
private
resourceService
:
IResourceService
;
private
markerService
:
IMarkerService
;
private
_modeId
:
string
;
constructor
(
modeId
:
string
,
participants
:
IWorkerParticipant
[],
@
IResourceService
resourceService
:
IResourceService
,
@
IMarkerService
markerService
:
IMarkerService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
)
{
this
.
_modeId
=
modeId
;
this
.
resourceService
=
resourceService
;
this
.
markerService
=
markerService
;
this
.
_contextService
=
contextService
;
let
workspace
=
this
.
_contextService
.
getWorkspace
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录