Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e2e8c2a3
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,发现更多精彩内容 >>
提交
e2e8c2a3
编写于
2月 05, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tslint
上级
202a726e
变更
35
显示空白变更内容
内联
并排
Showing
35 changed file
with
184 addition
and
150 deletion
+184
-150
src/vs/base/browser/browser.ts
src/vs/base/browser/browser.ts
+1
-1
src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts
src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts
+6
-6
src/vs/base/browser/ui/scrollbar/domNodeScrollable.ts
src/vs/base/browser/ui/scrollbar/domNodeScrollable.ts
+1
-1
src/vs/base/browser/ui/scrollbar/scrollableElement.ts
src/vs/base/browser/ui/scrollbar/scrollableElement.ts
+1
-1
src/vs/base/browser/ui/scrollbar/scrollableElementImpl.ts
src/vs/base/browser/ui/scrollbar/scrollableElementImpl.ts
+0
-4
src/vs/base/browser/ui/timer/timer.ts
src/vs/base/browser/ui/timer/timer.ts
+1
-1
src/vs/editor/common/modes/monarch/monarchCommon.ts
src/vs/editor/common/modes/monarch/monarchCommon.ts
+31
-11
src/vs/editor/common/modes/monarch/monarchCompile.ts
src/vs/editor/common/modes/monarch/monarchCompile.ts
+73
-49
src/vs/editor/common/modes/monarch/monarchLexer.ts
src/vs/editor/common/modes/monarch/monarchLexer.ts
+25
-9
src/vs/editor/common/services/modelServiceImpl.ts
src/vs/editor/common/services/modelServiceImpl.ts
+1
-1
src/vs/editor/contrib/comment/common/lineCommentCommand.ts
src/vs/editor/contrib/comment/common/lineCommentCommand.ts
+1
-1
src/vs/languages/handlebars/common/handlebars.ts
src/vs/languages/handlebars/common/handlebars.ts
+0
-1
src/vs/languages/lib/common/wireProtocol.ts
src/vs/languages/lib/common/wireProtocol.ts
+1
-1
src/vs/languages/php/common/php.ts
src/vs/languages/php/common/php.ts
+9
-11
src/vs/languages/plaintext/common/plaintext.ts
src/vs/languages/plaintext/common/plaintext.ts
+0
-1
src/vs/languages/razor/common/csharpTokenization.ts
src/vs/languages/razor/common/csharpTokenization.ts
+2
-4
src/vs/languages/razor/common/razor.ts
src/vs/languages/razor/common/razor.ts
+1
-2
src/vs/languages/razor/common/razorWorker.ts
src/vs/languages/razor/common/razorWorker.ts
+0
-2
src/vs/languages/vsxml/common/vsxml.ts
src/vs/languages/vsxml/common/vsxml.ts
+0
-1
src/vs/platform/keybinding/common/keybindingResolver.ts
src/vs/platform/keybinding/common/keybindingResolver.ts
+2
-2
src/vs/platform/keybinding/common/keybindingService.ts
src/vs/platform/keybinding/common/keybindingService.ts
+4
-2
src/vs/platform/keybinding/common/keybindingsRegistry.ts
src/vs/platform/keybinding/common/keybindingsRegistry.ts
+1
-1
src/vs/platform/keybinding/test/common/mockKeybindingService.ts
.../platform/keybinding/test/common/mockKeybindingService.ts
+1
-1
src/vs/platform/plugins/common/abstractPluginService.ts
src/vs/platform/plugins/common/abstractPluginService.ts
+2
-5
src/vs/platform/plugins/common/ipcRemoteCom.ts
src/vs/platform/plugins/common/ipcRemoteCom.ts
+2
-2
src/vs/platform/plugins/common/nativePluginService.ts
src/vs/platform/plugins/common/nativePluginService.ts
+6
-6
src/vs/platform/plugins/common/plugins.ts
src/vs/platform/plugins/common/plugins.ts
+1
-1
src/vs/platform/plugins/common/pluginsRegistry.ts
src/vs/platform/plugins/common/pluginsRegistry.ts
+2
-3
src/vs/platform/plugins/node/pluginVersionValidator.ts
src/vs/platform/plugins/node/pluginVersionValidator.ts
+1
-1
src/vs/platform/thread/common/abstractThreadService.ts
src/vs/platform/thread/common/abstractThreadService.ts
+2
-8
src/vs/platform/thread/common/mainThreadService.ts
src/vs/platform/thread/common/mainThreadService.ts
+0
-1
src/vs/platform/thread/common/pluginHostThreadService.ts
src/vs/platform/thread/common/pluginHostThreadService.ts
+0
-1
src/vs/platform/thread/common/thread.ts
src/vs/platform/thread/common/thread.ts
+4
-4
src/vs/platform/thread/common/threadService.ts
src/vs/platform/thread/common/threadService.ts
+2
-3
src/vs/platform/thread/common/workerThreadService.ts
src/vs/platform/thread/common/workerThreadService.ts
+0
-1
未找到文件。
src/vs/base/browser/browser.ts
浏览文件 @
e2e8c2a3
...
@@ -75,7 +75,7 @@ let _disablePushState = false;
...
@@ -75,7 +75,7 @@ let _disablePushState = false;
*/
*/
export
function
canPushState
()
{
export
function
canPushState
()
{
return
(
!
_disablePushState
&&
globals
.
history
&&
globals
.
history
.
pushState
);
return
(
!
_disablePushState
&&
globals
.
history
&&
globals
.
history
.
pushState
);
}
;
}
/**
/**
* Helpful when we detect that pushing state does not work for some reason (e.g. FF prevents pushState for security reasons in some cases)
* Helpful when we detect that pushing state does not work for some reason (e.g. FF prevents pushState for security reasons in some cases)
...
...
src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts
浏览文件 @
e2e8c2a3
...
@@ -63,21 +63,21 @@ export class HighlightedLabel implements IDisposable {
...
@@ -63,21 +63,21 @@ export class HighlightedLabel implements IDisposable {
continue
;
continue
;
}
}
if
(
pos
<
highlight
.
start
)
{
if
(
pos
<
highlight
.
start
)
{
htmlContent
.
push
(
'
<span>
'
)
htmlContent
.
push
(
'
<span>
'
)
;
htmlContent
.
push
(
expandOcticons
(
escape
(
this
.
text
.
substring
(
pos
,
highlight
.
start
))));
htmlContent
.
push
(
expandOcticons
(
escape
(
this
.
text
.
substring
(
pos
,
highlight
.
start
))));
htmlContent
.
push
(
'
</span>
'
)
htmlContent
.
push
(
'
</span>
'
)
;
pos
=
highlight
.
end
;
pos
=
highlight
.
end
;
}
}
htmlContent
.
push
(
'
<span class="highlight">
'
)
htmlContent
.
push
(
'
<span class="highlight">
'
)
;
htmlContent
.
push
(
expandOcticons
(
escape
(
this
.
text
.
substring
(
highlight
.
start
,
highlight
.
end
))));
htmlContent
.
push
(
expandOcticons
(
escape
(
this
.
text
.
substring
(
highlight
.
start
,
highlight
.
end
))));
htmlContent
.
push
(
'
</span>
'
)
htmlContent
.
push
(
'
</span>
'
)
;
pos
=
highlight
.
end
;
pos
=
highlight
.
end
;
}
}
if
(
pos
<
this
.
text
.
length
)
{
if
(
pos
<
this
.
text
.
length
)
{
htmlContent
.
push
(
'
<span>
'
)
htmlContent
.
push
(
'
<span>
'
)
;
htmlContent
.
push
(
expandOcticons
(
escape
(
this
.
text
.
substring
(
pos
))));
htmlContent
.
push
(
expandOcticons
(
escape
(
this
.
text
.
substring
(
pos
))));
htmlContent
.
push
(
'
</span>
'
)
htmlContent
.
push
(
'
</span>
'
)
;
}
}
this
.
domNode
.
innerHTML
=
htmlContent
.
join
(
''
);
this
.
domNode
.
innerHTML
=
htmlContent
.
join
(
''
);
...
...
src/vs/base/browser/ui/scrollbar/domNodeScrollable.ts
浏览文件 @
e2e8c2a3
...
@@ -8,7 +8,7 @@ import * as DomUtils from 'vs/base/browser/dom';
...
@@ -8,7 +8,7 @@ import * as DomUtils from 'vs/base/browser/dom';
import
{
Gesture
}
from
'
vs/base/browser/touch
'
;
import
{
Gesture
}
from
'
vs/base/browser/touch
'
;
import
{
Disposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IScrollable
}
from
'
vs/base/common/scrollable
'
;
import
{
IScrollable
}
from
'
vs/base/common/scrollable
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
export
class
DomNodeScrollable
extends
Disposable
implements
IScrollable
{
export
class
DomNodeScrollable
extends
Disposable
implements
IScrollable
{
...
...
src/vs/base/browser/ui/scrollbar/scrollableElement.ts
浏览文件 @
e2e8c2a3
...
@@ -208,7 +208,7 @@ export enum Visibility {
...
@@ -208,7 +208,7 @@ export enum Visibility {
Auto
,
Auto
,
Hidden
,
Hidden
,
Visible
Visible
}
;
}
export
function
visibilityFromString
(
visibility
:
string
):
Visibility
{
export
function
visibilityFromString
(
visibility
:
string
):
Visibility
{
switch
(
visibility
)
{
switch
(
visibility
)
{
...
...
src/vs/base/browser/ui/scrollbar/scrollableElementImpl.ts
浏览文件 @
e2e8c2a3
...
@@ -130,10 +130,6 @@ export class ScrollableElement extends Widget implements IScrollableElement {
...
@@ -130,10 +130,6 @@ export class ScrollableElement extends Widget implements IScrollableElement {
};
};
}
}
private
_getVerticalSliderDomNode
():
HTMLElement
{
return
this
.
_verticalScrollbar
.
slider
;
}
public
delegateVerticalScrollbarMouseDown
(
browserEvent
:
MouseEvent
):
void
{
public
delegateVerticalScrollbarMouseDown
(
browserEvent
:
MouseEvent
):
void
{
this
.
_verticalScrollbar
.
delegateMouseDown
(
browserEvent
);
this
.
_verticalScrollbar
.
delegateMouseDown
(
browserEvent
);
}
}
...
...
src/vs/base/browser/ui/timer/timer.ts
浏览文件 @
e2e8c2a3
...
@@ -251,7 +251,7 @@ export class TimeKeeperRenderer {
...
@@ -251,7 +251,7 @@ export class TimeKeeperRenderer {
}
}
private
_render
():
void
{
private
_render
():
void
{
let
allEvents
=
this
.
timeKeeper
.
getCollectedEvents
(),
didSomething
=
false
;
;
let
allEvents
=
this
.
timeKeeper
.
getCollectedEvents
(),
didSomething
=
false
;
for
(
let
i
=
this
.
lastEventIndex
;
i
<
allEvents
.
length
;
i
++
)
{
for
(
let
i
=
this
.
lastEventIndex
;
i
<
allEvents
.
length
;
i
++
)
{
let
ev
=
allEvents
[
i
];
let
ev
=
allEvents
[
i
];
...
...
src/vs/editor/common/modes/monarch/monarchCommon.ts
浏览文件 @
e2e8c2a3
...
@@ -157,15 +157,25 @@ export function substituteMatches(lexer: ILexerMin, str: string, id: string, mat
...
@@ -157,15 +157,25 @@ export function substituteMatches(lexer: ILexerMin, str: string, id: string, mat
var
re
=
/
\$((\$)
|
(
#
)
|
(\d\d?)
|
[
sS
](\d\d?)
|@
(\w
+
))
/g
;
var
re
=
/
\$((\$)
|
(
#
)
|
(\d\d?)
|
[
sS
](\d\d?)
|@
(\w
+
))
/g
;
var
stateMatches
:
string
[]
=
null
;
var
stateMatches
:
string
[]
=
null
;
return
str
.
replace
(
re
,
function
(
full
,
sub
?,
dollar
?,
hash
?,
n
?,
s
?,
attr
?,
ofs
?,
total
?)
{
return
str
.
replace
(
re
,
function
(
full
,
sub
?,
dollar
?,
hash
?,
n
?,
s
?,
attr
?,
ofs
?,
total
?)
{
if
(
!
empty
(
dollar
))
return
'
$
'
;
// $$
if
(
!
empty
(
dollar
))
{
if
(
!
empty
(
hash
))
return
fixCase
(
lexer
,
id
);
// default $#
return
'
$
'
;
// $$
if
(
!
empty
(
n
)
&&
n
<
matches
.
length
)
return
fixCase
(
lexer
,
matches
[
n
]);
// $n
}
if
(
!
empty
(
attr
)
&&
lexer
&&
typeof
(
lexer
[
attr
])
===
'
string
'
)
return
lexer
[
attr
];
//@attribute
if
(
!
empty
(
hash
))
{
return
fixCase
(
lexer
,
id
);
// default $#
}
if
(
!
empty
(
n
)
&&
n
<
matches
.
length
)
{
return
fixCase
(
lexer
,
matches
[
n
]);
// $n
}
if
(
!
empty
(
attr
)
&&
lexer
&&
typeof
(
lexer
[
attr
])
===
'
string
'
)
{
return
lexer
[
attr
];
//@attribute
}
if
(
stateMatches
===
null
)
{
// split state on demand
if
(
stateMatches
===
null
)
{
// split state on demand
stateMatches
=
state
.
split
(
'
.
'
);
stateMatches
=
state
.
split
(
'
.
'
);
stateMatches
.
unshift
(
state
);
stateMatches
.
unshift
(
state
);
}
}
if
(
!
empty
(
s
)
&&
s
<
stateMatches
.
length
)
return
fixCase
(
lexer
,
stateMatches
[
s
]);
//$Sn
if
(
!
empty
(
s
)
&&
s
<
stateMatches
.
length
)
{
return
fixCase
(
lexer
,
stateMatches
[
s
]);
//$Sn
}
return
''
;
return
''
;
});
});
}
}
...
@@ -176,11 +186,16 @@ export function substituteMatches(lexer: ILexerMin, str: string, id: string, mat
...
@@ -176,11 +186,16 @@ export function substituteMatches(lexer: ILexerMin, str: string, id: string, mat
export
function
findRules
(
lexer
:
ILexer
,
state
:
string
):
IRule
[]
{
export
function
findRules
(
lexer
:
ILexer
,
state
:
string
):
IRule
[]
{
while
(
state
&&
state
.
length
>
0
)
{
while
(
state
&&
state
.
length
>
0
)
{
var
rules
=
lexer
.
tokenizer
[
state
];
var
rules
=
lexer
.
tokenizer
[
state
];
if
(
rules
)
return
rules
;
if
(
rules
)
{
return
rules
;
}
var
idx
=
state
.
lastIndexOf
(
'
.
'
);
var
idx
=
state
.
lastIndexOf
(
'
.
'
);
if
(
idx
<
0
)
state
=
null
;
// no further parent
if
(
idx
<
0
)
{
else
state
=
state
.
substr
(
0
,
idx
);
state
=
null
;
// no further parent
}
else
{
state
=
state
.
substr
(
0
,
idx
);
}
}
}
return
null
;
return
null
;
}
}
...
@@ -193,11 +208,16 @@ export function findRules(lexer: ILexer, state: string): IRule[] {
...
@@ -193,11 +208,16 @@ export function findRules(lexer: ILexer, state: string): IRule[] {
export
function
stateExists
(
lexer
:
ILexerMin
,
state
:
string
):
boolean
{
export
function
stateExists
(
lexer
:
ILexerMin
,
state
:
string
):
boolean
{
while
(
state
&&
state
.
length
>
0
)
{
while
(
state
&&
state
.
length
>
0
)
{
var
exist
=
lexer
.
stateNames
[
state
];
var
exist
=
lexer
.
stateNames
[
state
];
if
(
exist
)
return
true
;
if
(
exist
)
{
return
true
;
}
var
idx
=
state
.
lastIndexOf
(
'
.
'
);
var
idx
=
state
.
lastIndexOf
(
'
.
'
);
if
(
idx
<
0
)
state
=
null
;
// no further parent
if
(
idx
<
0
)
{
else
state
=
state
.
substr
(
0
,
idx
);
state
=
null
;
// no further parent
}
else
{
state
=
state
.
substr
(
0
,
idx
);
}
}
}
return
false
;
return
false
;
}
}
src/vs/editor/common/modes/monarch/monarchCompile.ts
浏览文件 @
e2e8c2a3
...
@@ -24,49 +24,44 @@ import Objects = require('vs/base/common/objects');
...
@@ -24,49 +24,44 @@ import Objects = require('vs/base/common/objects');
*/
*/
function
isArrayOf
(
elemType
:
(
x
:
any
)
=>
boolean
,
obj
:
any
):
boolean
{
function
isArrayOf
(
elemType
:
(
x
:
any
)
=>
boolean
,
obj
:
any
):
boolean
{
if
(
!
obj
)
return
false
;
if
(
!
obj
)
{
if
(
!
(
Array
.
isArray
(
obj
)))
return
false
;
return
false
;
}
if
(
!
(
Array
.
isArray
(
obj
)))
{
return
false
;
}
var
idx
:
any
;
var
idx
:
any
;
for
(
idx
in
obj
)
{
for
(
idx
in
obj
)
{
if
(
obj
.
hasOwnProperty
(
idx
))
{
if
(
obj
.
hasOwnProperty
(
idx
))
{
if
(
!
(
elemType
(
obj
[
idx
])))
return
false
;
if
(
!
(
elemType
(
obj
[
idx
])))
{
return
false
;
}
}
}
}
}
return
true
;
return
true
;
}
}
function
bool
(
prop
:
any
,
def
?:
boolean
,
onerr
?:
()
=>
void
):
boolean
{
function
bool
(
prop
:
any
,
def
?:
boolean
,
onerr
?:
()
=>
void
):
boolean
{
if
(
typeof
(
prop
)
===
'
boolean
'
)
return
prop
;
if
(
typeof
(
prop
)
===
'
boolean
'
)
{
if
(
onerr
&&
(
prop
||
def
===
undefined
))
onerr
();
// type is wrong, or there is no default
return
prop
;
}
if
(
onerr
&&
(
prop
||
def
===
undefined
))
{
onerr
();
// type is wrong, or there is no default
}
return
(
def
===
undefined
?
null
:
def
);
return
(
def
===
undefined
?
null
:
def
);
}
}
function
string
(
prop
:
any
,
def
?:
string
,
onerr
?:
()
=>
void
):
string
{
function
string
(
prop
:
any
,
def
?:
string
,
onerr
?:
()
=>
void
):
string
{
if
(
typeof
(
prop
)
===
'
string
'
)
return
prop
;
if
(
typeof
(
prop
)
===
'
string
'
)
{
if
(
onerr
&&
(
prop
||
def
===
undefined
))
onerr
();
// type is wrong, or there is no default
return
prop
;
return
(
def
===
undefined
?
null
:
def
);
}
if
(
onerr
&&
(
prop
||
def
===
undefined
))
{
}
onerr
();
// type is wrong, or there is no default
}
function
regExString
(
prop
:
any
,
def
?:
string
,
onerr
?:
()
=>
void
):
string
{
// for now just a string
return
string
(
prop
,
def
,
onerr
);
}
function
number
(
prop
:
any
,
def
?:
number
,
onerr
?:
()
=>
void
):
number
{
if
(
typeof
(
prop
)
===
'
number
'
)
return
prop
;
if
(
onerr
&&
(
prop
||
def
===
undefined
))
onerr
();
// type is wrong, or there is no default
return
(
def
===
undefined
?
null
:
def
);
return
(
def
===
undefined
?
null
:
def
);
}
function
stringArray
(
prop
:
any
,
def
?:
string
[],
onerr
?:
()
=>
void
):
string
[]
{
if
(
isArrayOf
(
function
(
elem
)
{
return
(
typeof
(
elem
)
===
'
string
'
);
},
prop
))
return
prop
.
slice
(
0
);
if
(
typeof
(
prop
)
===
'
string
'
)
return
[
prop
];
if
(
onerr
&&
(
prop
||
def
===
undefined
))
onerr
();
// type is wrong, or there is no default
return
(
def
===
undefined
?
null
:
def
);
}
}
// Lexer helpers
// Lexer helpers
/**
/**
...
@@ -74,7 +69,9 @@ function stringArray(prop: any, def?: string[], onerr?: () => void ): string[] {
...
@@ -74,7 +69,9 @@ function stringArray(prop: any, def?: string[], onerr?: () => void ): string[] {
* Also replaces @\w+ or sequences with the content of the specified attribute
* Also replaces @\w+ or sequences with the content of the specified attribute
*/
*/
function
compileRegExp
(
lexer
:
MonarchCommonTypes
.
ILexerMin
,
str
:
string
):
RegExp
{
function
compileRegExp
(
lexer
:
MonarchCommonTypes
.
ILexerMin
,
str
:
string
):
RegExp
{
if
(
typeof
(
str
)
!==
'
string
'
)
return
null
;
if
(
typeof
(
str
)
!==
'
string
'
)
{
return
null
;
}
var
n
=
0
;
var
n
=
0
;
while
(
str
.
indexOf
(
'
@
'
)
>=
0
&&
n
<
5
)
{
// at most 5 expansions
while
(
str
.
indexOf
(
'
@
'
)
>=
0
&&
n
<
5
)
{
// at most 5 expansions
...
@@ -83,13 +80,14 @@ function compileRegExp(lexer: MonarchCommonTypes.ILexerMin, str: string): RegExp
...
@@ -83,13 +80,14 @@ function compileRegExp(lexer: MonarchCommonTypes.ILexerMin, str: string): RegExp
var
sub
=
''
;
var
sub
=
''
;
if
(
typeof
(
lexer
[
attr
])
===
'
string
'
)
{
if
(
typeof
(
lexer
[
attr
])
===
'
string
'
)
{
sub
=
lexer
[
attr
];
sub
=
lexer
[
attr
];
}
}
else
if
(
lexer
[
attr
]
&&
lexer
[
attr
]
instanceof
RegExp
)
{
else
if
(
lexer
[
attr
]
&&
lexer
[
attr
]
instanceof
RegExp
)
{
sub
=
lexer
[
attr
].
source
;
sub
=
lexer
[
attr
].
source
;
}
else
{
if
(
lexer
[
attr
]
===
undefined
)
{
MonarchCommonTypes
.
throwError
(
lexer
,
'
language definition does not contain attribute
\'
'
+
attr
+
'
\'
, used at:
'
+
str
);
}
else
{
MonarchCommonTypes
.
throwError
(
lexer
,
'
attribute reference
\'
'
+
attr
+
'
\'
must be a string, used at:
'
+
str
);
}
}
else
{
if
(
lexer
[
attr
]
===
undefined
)
MonarchCommonTypes
.
throwError
(
lexer
,
'
language definition does not contain attribute
\'
'
+
attr
+
'
\'
, used at:
'
+
str
);
else
MonarchCommonTypes
.
throwError
(
lexer
,
'
attribute reference
\'
'
+
attr
+
'
\'
must be a string, used at:
'
+
str
);
}
}
return
(
MonarchCommonTypes
.
empty
(
sub
)
?
''
:
'
(?:
'
+
sub
+
'
)
'
);
return
(
MonarchCommonTypes
.
empty
(
sub
)
?
''
:
'
(?:
'
+
sub
+
'
)
'
);
});
});
...
@@ -104,13 +102,19 @@ function compileRegExp(lexer: MonarchCommonTypes.ILexerMin, str: string): RegExp
...
@@ -104,13 +102,19 @@ function compileRegExp(lexer: MonarchCommonTypes.ILexerMin, str: string): RegExp
*
*
*/
*/
function
selectScrutinee
(
id
:
string
,
matches
:
string
[],
state
:
string
,
num
:
number
):
string
{
function
selectScrutinee
(
id
:
string
,
matches
:
string
[],
state
:
string
,
num
:
number
):
string
{
if
(
num
<
0
)
return
id
;
if
(
num
<
0
)
{
if
(
num
<
matches
.
length
)
return
matches
[
num
];
return
id
;
}
if
(
num
<
matches
.
length
)
{
return
matches
[
num
];
}
if
(
num
>=
100
)
{
if
(
num
>=
100
)
{
num
=
num
-
100
;
num
=
num
-
100
;
var
parts
=
state
.
split
(
'
.
'
);
var
parts
=
state
.
split
(
'
.
'
);
parts
.
unshift
(
state
);
parts
.
unshift
(
state
);
if
(
num
<
parts
.
length
)
return
parts
[
num
];
if
(
num
<
parts
.
length
)
{
return
parts
[
num
];
}
}
}
return
null
;
return
null
;
}
}
...
@@ -123,7 +127,9 @@ function createGuard(lexer: MonarchCommonTypes.ILexerMin, ruleName: string, tkey
...
@@ -123,7 +127,9 @@ function createGuard(lexer: MonarchCommonTypes.ILexerMin, ruleName: string, tkey
if
(
matches
)
{
if
(
matches
)
{
if
(
matches
[
3
])
{
// if digits
if
(
matches
[
3
])
{
// if digits
scrut
=
parseInt
(
matches
[
3
]);
scrut
=
parseInt
(
matches
[
3
]);
if
(
matches
[
2
])
scrut
=
scrut
+
100
;
// if [sS] present
if
(
matches
[
2
])
{
scrut
=
scrut
+
100
;
// if [sS] present
}
}
}
oppat
=
matches
[
4
];
oppat
=
matches
[
4
];
}
}
...
@@ -236,9 +242,11 @@ function compileAction(lexer: MonarchCommonTypes.ILexerMin, ruleName: string, ac
...
@@ -236,9 +242,11 @@ function compileAction(lexer: MonarchCommonTypes.ILexerMin, ruleName: string, ac
newAction
.
tokenSubst
=
true
;
newAction
.
tokenSubst
=
true
;
}
}
if
(
typeof
(
action
.
bracket
)
===
'
string
'
)
{
if
(
typeof
(
action
.
bracket
)
===
'
string
'
)
{
if
(
action
.
bracket
===
'
@open
'
)
newAction
.
bracket
=
Modes
.
Bracket
.
Open
;
if
(
action
.
bracket
===
'
@open
'
)
{
else
if
(
action
.
bracket
===
'
@close
'
)
newAction
.
bracket
=
Modes
.
Bracket
.
Close
;
newAction
.
bracket
=
Modes
.
Bracket
.
Open
;
else
{
}
else
if
(
action
.
bracket
===
'
@close
'
)
{
newAction
.
bracket
=
Modes
.
Bracket
.
Close
;
}
else
{
MonarchCommonTypes
.
throwError
(
lexer
,
'
a
\'
bracket
\'
attribute must be either
\'
@open
\'
or
\'
@close
\'
, in rule:
'
+
ruleName
);
MonarchCommonTypes
.
throwError
(
lexer
,
'
a
\'
bracket
\'
attribute must be either
\'
@open
\'
or
\'
@close
\'
, in rule:
'
+
ruleName
);
}
}
}
}
...
@@ -249,7 +257,9 @@ function compileAction(lexer: MonarchCommonTypes.ILexerMin, ruleName: string, ac
...
@@ -249,7 +257,9 @@ function compileAction(lexer: MonarchCommonTypes.ILexerMin, ruleName: string, ac
else
{
else
{
var
next
:
string
=
action
.
next
;
var
next
:
string
=
action
.
next
;
if
(
!
/^
(
@pop|@push|@popall
)
$/
.
test
(
next
))
{
if
(
!
/^
(
@pop|@push|@popall
)
$/
.
test
(
next
))
{
if
(
next
[
0
]
===
'
@
'
)
next
=
next
.
substr
(
1
);
// peel off starting @ sign
if
(
next
[
0
]
===
'
@
'
)
{
next
=
next
.
substr
(
1
);
// peel off starting @ sign
}
if
(
next
.
indexOf
(
'
$
'
)
<
0
)
{
// no dollar substitution, we can check if the state exists
if
(
next
.
indexOf
(
'
$
'
)
<
0
)
{
// no dollar substitution, we can check if the state exists
if
(
!
MonarchCommonTypes
.
stateExists
(
lexer
,
MonarchCommonTypes
.
substituteMatches
(
lexer
,
next
,
''
,
[],
''
)))
{
if
(
!
MonarchCommonTypes
.
stateExists
(
lexer
,
MonarchCommonTypes
.
substituteMatches
(
lexer
,
next
,
''
,
[],
''
)))
{
MonarchCommonTypes
.
throwError
(
lexer
,
'
the next state
\'
'
+
action
.
next
+
'
\'
is not defined in rule:
'
+
ruleName
);
MonarchCommonTypes
.
throwError
(
lexer
,
'
the next state
\'
'
+
action
.
next
+
'
\'
is not defined in rule:
'
+
ruleName
);
...
@@ -259,9 +269,15 @@ function compileAction(lexer: MonarchCommonTypes.ILexerMin, ruleName: string, ac
...
@@ -259,9 +269,15 @@ function compileAction(lexer: MonarchCommonTypes.ILexerMin, ruleName: string, ac
newAction
.
next
=
next
;
newAction
.
next
=
next
;
}
}
}
}
if
(
typeof
(
action
.
goBack
)
===
'
number
'
)
newAction
.
goBack
=
action
.
goBack
;
if
(
typeof
(
action
.
goBack
)
===
'
number
'
)
{
if
(
typeof
(
action
.
switchTo
)
===
'
string
'
)
newAction
.
switchTo
=
action
.
switchTo
;
newAction
.
goBack
=
action
.
goBack
;
if
(
typeof
(
action
.
log
)
===
'
string
'
)
newAction
.
log
=
action
.
log
;
}
if
(
typeof
(
action
.
switchTo
)
===
'
string
'
)
{
newAction
.
switchTo
=
action
.
switchTo
;
}
if
(
typeof
(
action
.
log
)
===
'
string
'
)
{
newAction
.
log
=
action
.
log
;
}
if
(
typeof
(
action
.
nextEmbedded
)
===
'
string
'
)
{
if
(
typeof
(
action
.
nextEmbedded
)
===
'
string
'
)
{
newAction
.
nextEmbedded
=
action
.
nextEmbedded
;
newAction
.
nextEmbedded
=
action
.
nextEmbedded
;
lexer
.
usesEmbedded
=
true
;
lexer
.
usesEmbedded
=
true
;
...
@@ -349,7 +365,7 @@ class Rule implements MonarchCommonTypes.IRule {
...
@@ -349,7 +365,7 @@ class Rule implements MonarchCommonTypes.IRule {
sregex
=
(
<
RegExp
>
re
).
source
;
sregex
=
(
<
RegExp
>
re
).
source
;
}
}
else
{
else
{
MonarchCommonTypes
.
throwError
(
lexer
,
'
rules must start with a match string or regular expression:
'
+
this
.
name
)
MonarchCommonTypes
.
throwError
(
lexer
,
'
rules must start with a match string or regular expression:
'
+
this
.
name
)
;
}
}
this
.
matchOnlyAtLineStart
=
(
sregex
.
length
>
0
&&
sregex
[
0
]
===
'
^
'
);
this
.
matchOnlyAtLineStart
=
(
sregex
.
length
>
0
&&
sregex
[
0
]
===
'
^
'
);
...
@@ -470,7 +486,9 @@ export function compile(json: MonarchTypes.ILanguage): MonarchCommonTypes.ILexer
...
@@ -470,7 +486,9 @@ export function compile(json: MonarchTypes.ILanguage): MonarchCommonTypes.ILexer
if
(
typeof
(
include
)
!==
'
string
'
)
{
if
(
typeof
(
include
)
!==
'
string
'
)
{
MonarchCommonTypes
.
throwError
(
lexer
,
'
an
\'
include
\'
attribute must be a string at:
'
+
state
);
MonarchCommonTypes
.
throwError
(
lexer
,
'
an
\'
include
\'
attribute must be a string at:
'
+
state
);
}
}
if
(
include
[
0
]
===
'
@
'
)
include
=
include
.
substr
(
1
);
// peel off starting @
if
(
include
[
0
]
===
'
@
'
)
{
include
=
include
.
substr
(
1
);
// peel off starting @
}
if
(
!
json
.
tokenizer
[
include
])
{
if
(
!
json
.
tokenizer
[
include
])
{
MonarchCommonTypes
.
throwError
(
lexer
,
'
include target
\'
'
+
include
+
'
\'
is not defined at:
'
+
state
);
MonarchCommonTypes
.
throwError
(
lexer
,
'
include target
\'
'
+
include
+
'
\'
is not defined at:
'
+
state
);
}
}
...
@@ -504,8 +522,12 @@ export function compile(json: MonarchTypes.ILanguage): MonarchCommonTypes.ILexer
...
@@ -504,8 +522,12 @@ export function compile(json: MonarchTypes.ILanguage): MonarchCommonTypes.ILexer
if
(
!
rule
.
regex
)
{
if
(
!
rule
.
regex
)
{
MonarchCommonTypes
.
throwError
(
lexer
,
'
a rule must either be an array, or an object with a
\'
regex
\'
or
\'
include
\'
field at:
'
+
state
);
MonarchCommonTypes
.
throwError
(
lexer
,
'
a rule must either be an array, or an object with a
\'
regex
\'
or
\'
include
\'
field at:
'
+
state
);
}
}
if
(
rule
.
name
)
newrule
.
name
=
string
(
rule
.
name
);
if
(
rule
.
name
)
{
if
(
rule
.
matchOnlyAtStart
)
newrule
.
matchOnlyAtLineStart
=
bool
(
rule
.
matchOnlyAtLineStart
);
newrule
.
name
=
string
(
rule
.
name
);
}
if
(
rule
.
matchOnlyAtStart
)
{
newrule
.
matchOnlyAtLineStart
=
bool
(
rule
.
matchOnlyAtLineStart
);
}
newrule
.
setRegex
(
lexerMin
,
rule
.
regex
);
newrule
.
setRegex
(
lexerMin
,
rule
.
regex
);
newrule
.
setAction
(
lexerMin
,
rule
.
action
);
newrule
.
setAction
(
lexerMin
,
rule
.
action
);
}
}
...
@@ -525,7 +547,9 @@ export function compile(json: MonarchTypes.ILanguage): MonarchCommonTypes.ILexer
...
@@ -525,7 +547,9 @@ export function compile(json: MonarchTypes.ILanguage): MonarchCommonTypes.ILexer
var
key
:
string
;
var
key
:
string
;
for
(
key
in
json
.
tokenizer
)
{
for
(
key
in
json
.
tokenizer
)
{
if
(
json
.
tokenizer
.
hasOwnProperty
(
key
))
{
if
(
json
.
tokenizer
.
hasOwnProperty
(
key
))
{
if
(
!
lexer
.
start
)
lexer
.
start
=
key
;
if
(
!
lexer
.
start
)
{
lexer
.
start
=
key
;
}
var
rules
=
json
.
tokenizer
[
key
];
var
rules
=
json
.
tokenizer
[
key
];
lexer
.
tokenizer
[
key
]
=
new
Array
();
lexer
.
tokenizer
[
key
]
=
new
Array
();
...
...
src/vs/editor/common/modes/monarch/monarchLexer.ts
浏览文件 @
e2e8c2a3
...
@@ -69,7 +69,9 @@ export class MonarchLexer extends AbstractState {
...
@@ -69,7 +69,9 @@ export class MonarchLexer extends AbstractState {
if
(
!
super
.
equals
(
other
))
{
if
(
!
super
.
equals
(
other
))
{
return
false
;
return
false
;
}
}
if
(
!
(
other
instanceof
MonarchLexer
))
return
false
;
if
(
!
(
other
instanceof
MonarchLexer
))
{
return
false
;
}
var
otherm
:
MonarchLexer
=
<
MonarchLexer
>
other
;
var
otherm
:
MonarchLexer
=
<
MonarchLexer
>
other
;
if
((
this
.
stack
.
length
!==
otherm
.
stack
.
length
)
||
(
this
.
lexer
.
name
!==
otherm
.
lexer
.
name
)
||
if
((
this
.
stack
.
length
!==
otherm
.
stack
.
length
)
||
(
this
.
lexer
.
name
!==
otherm
.
lexer
.
name
)
||
(
this
.
embeddedMode
!==
otherm
.
embeddedMode
))
{
(
this
.
embeddedMode
!==
otherm
.
embeddedMode
))
{
...
@@ -78,7 +80,9 @@ export class MonarchLexer extends AbstractState {
...
@@ -78,7 +80,9 @@ export class MonarchLexer extends AbstractState {
var
idx
:
string
;
var
idx
:
string
;
for
(
idx
in
this
.
stack
)
{
for
(
idx
in
this
.
stack
)
{
if
(
this
.
stack
.
hasOwnProperty
(
idx
))
{
if
(
this
.
stack
.
hasOwnProperty
(
idx
))
{
if
(
this
.
stack
[
idx
]
!==
otherm
.
stack
[
idx
])
return
false
;
if
(
this
.
stack
[
idx
]
!==
otherm
.
stack
[
idx
])
{
return
false
;
}
}
}
}
}
return
true
;
return
true
;
...
@@ -132,7 +136,9 @@ export class MonarchLexer extends AbstractState {
...
@@ -132,7 +136,9 @@ export class MonarchLexer extends AbstractState {
// get the rules for this state
// get the rules for this state
var
rules
=
this
.
lexer
.
tokenizer
[
state
];
var
rules
=
this
.
lexer
.
tokenizer
[
state
];
if
(
!
rules
)
rules
=
MonarchCommonTypes
.
findRules
(
this
.
lexer
,
state
);
// do parent matching
if
(
!
rules
)
{
rules
=
MonarchCommonTypes
.
findRules
(
this
.
lexer
,
state
);
// do parent matching
}
if
(
!
rules
)
{
if
(
!
rules
)
{
MonarchCommonTypes
.
throwError
(
this
.
lexer
,
'
tokenizer state is not defined:
'
+
state
);
MonarchCommonTypes
.
throwError
(
this
.
lexer
,
'
tokenizer state is not defined:
'
+
state
);
...
@@ -228,7 +234,9 @@ export class MonarchLexer extends AbstractState {
...
@@ -228,7 +234,9 @@ export class MonarchLexer extends AbstractState {
}
}
if
(
action
.
switchTo
&&
typeof
action
.
switchTo
===
'
string
'
)
{
if
(
action
.
switchTo
&&
typeof
action
.
switchTo
===
'
string
'
)
{
var
nextState
=
MonarchCommonTypes
.
substituteMatches
(
this
.
lexer
,
action
.
switchTo
,
matched
,
matches
,
state
);
// switch state without a push...
var
nextState
=
MonarchCommonTypes
.
substituteMatches
(
this
.
lexer
,
action
.
switchTo
,
matched
,
matches
,
state
);
// switch state without a push...
if
(
nextState
[
0
]
===
'
@
'
)
nextState
=
nextState
.
substr
(
1
);
// peel off starting '@'
if
(
nextState
[
0
]
===
'
@
'
)
{
nextState
=
nextState
.
substr
(
1
);
// peel off starting '@'
}
if
(
!
MonarchCommonTypes
.
findRules
(
this
.
lexer
,
nextState
))
{
if
(
!
MonarchCommonTypes
.
findRules
(
this
.
lexer
,
nextState
))
{
MonarchCommonTypes
.
throwError
(
this
.
lexer
,
'
trying to switch to a state
\'
'
+
nextState
+
'
\'
that is undefined in rule:
'
+
rule
.
name
);
MonarchCommonTypes
.
throwError
(
this
.
lexer
,
'
trying to switch to a state
\'
'
+
nextState
+
'
\'
that is undefined in rule:
'
+
rule
.
name
);
}
}
...
@@ -261,11 +269,15 @@ export class MonarchLexer extends AbstractState {
...
@@ -261,11 +269,15 @@ export class MonarchLexer extends AbstractState {
}
}
}
}
else
if
(
action
.
next
===
'
@popall
'
)
{
else
if
(
action
.
next
===
'
@popall
'
)
{
if
(
this
.
stack
.
length
>
1
)
this
.
stack
=
[
this
.
stack
[
this
.
stack
.
length
-
1
]];
if
(
this
.
stack
.
length
>
1
)
{
this
.
stack
=
[
this
.
stack
[
this
.
stack
.
length
-
1
]];
}
}
}
else
{
else
{
var
nextState
=
MonarchCommonTypes
.
substituteMatches
(
this
.
lexer
,
action
.
next
,
matched
,
matches
,
state
);
var
nextState
=
MonarchCommonTypes
.
substituteMatches
(
this
.
lexer
,
action
.
next
,
matched
,
matches
,
state
);
if
(
nextState
[
0
]
===
'
@
'
)
nextState
=
nextState
.
substr
(
1
);
// peel off starting '@'
if
(
nextState
[
0
]
===
'
@
'
)
{
nextState
=
nextState
.
substr
(
1
);
// peel off starting '@'
}
if
(
!
MonarchCommonTypes
.
findRules
(
this
.
lexer
,
nextState
))
{
if
(
!
MonarchCommonTypes
.
findRules
(
this
.
lexer
,
nextState
))
{
MonarchCommonTypes
.
throwError
(
this
.
lexer
,
'
trying to set a next state
\'
'
+
nextState
+
'
\'
that is undefined in rule:
'
+
rule
.
name
);
MonarchCommonTypes
.
throwError
(
this
.
lexer
,
'
trying to set a next state
\'
'
+
nextState
+
'
\'
that is undefined in rule:
'
+
rule
.
name
);
...
@@ -357,14 +369,16 @@ export class MonarchLexer extends AbstractState {
...
@@ -357,14 +369,16 @@ export class MonarchLexer extends AbstractState {
* Searches for a bracket in the 'brackets' attribute that matches the input.
* Searches for a bracket in the 'brackets' attribute that matches the input.
*/
*/
function
findBracket
(
lexer
:
MonarchCommonTypes
.
ILexer
,
matched
:
string
)
{
function
findBracket
(
lexer
:
MonarchCommonTypes
.
ILexer
,
matched
:
string
)
{
if
(
!
matched
)
return
null
;
if
(
!
matched
)
{
return
null
;
}
matched
=
MonarchCommonTypes
.
fixCase
(
lexer
,
matched
);
matched
=
MonarchCommonTypes
.
fixCase
(
lexer
,
matched
);
var
brackets
=
lexer
.
brackets
;
var
brackets
=
lexer
.
brackets
;
for
(
var
i
=
0
;
i
<
brackets
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
brackets
.
length
;
i
++
)
{
var
bracket
=
brackets
[
i
];
var
bracket
=
brackets
[
i
];
if
(
bracket
.
open
===
matched
)
{
if
(
bracket
.
open
===
matched
)
{
return
{
token
:
bracket
.
token
,
bracketType
:
Modes
.
Bracket
.
Open
}
return
{
token
:
bracket
.
token
,
bracketType
:
Modes
.
Bracket
.
Open
}
;
}
}
else
if
(
bracket
.
close
===
matched
)
{
else
if
(
bracket
.
close
===
matched
)
{
return
{
token
:
bracket
.
token
,
bracketType
:
Modes
.
Bracket
.
Close
};
return
{
token
:
bracket
.
token
,
bracketType
:
Modes
.
Bracket
.
Close
};
...
@@ -420,7 +434,9 @@ export function createTokenizationSupport(modeService:IModeService, mode:Modes.I
...
@@ -420,7 +434,9 @@ export function createTokenizationSupport(modeService:IModeService, mode:Modes.I
while
(
!
stream
.
eos
()
&&
mstate
.
embeddedMode
)
{
while
(
!
stream
.
eos
()
&&
mstate
.
embeddedMode
)
{
mstate
.
tokenize
(
stream
,
true
);
// allow no consumption for @rematch
mstate
.
tokenize
(
stream
,
true
);
// allow no consumption for @rematch
}
}
if
(
mstate
.
embeddedMode
)
return
null
;
// don't leave yet
if
(
mstate
.
embeddedMode
)
{
return
null
;
// don't leave yet
}
var
end
=
stream
.
pos
();
var
end
=
stream
.
pos
();
return
{
return
{
...
...
src/vs/editor/common/services/modelServiceImpl.ts
浏览文件 @
e2e8c2a3
...
@@ -13,7 +13,7 @@ import EditorCommon = require('vs/editor/common/editorCommon');
...
@@ -13,7 +13,7 @@ import EditorCommon = require('vs/editor/common/editorCommon');
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
{
IResourceService
}
from
'
vs/editor/common/services/resourceService
'
;
import
{
IResourceService
}
from
'
vs/editor/common/services/resourceService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
Remotable
,
IThreadService
,
ThreadAffinity
,
IThreadSynchronizableObject
}
from
'
vs/platform/thread/common/thread
'
;
import
{
Remotable
,
IThreadService
,
ThreadAffinity
}
from
'
vs/platform/thread/common/thread
'
;
import
{
IHTMLContentElement
}
from
'
vs/base/common/htmlContent
'
;
import
{
IHTMLContentElement
}
from
'
vs/base/common/htmlContent
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
...
...
src/vs/editor/contrib/comment/common/lineCommentCommand.ts
浏览文件 @
e2e8c2a3
...
@@ -23,7 +23,7 @@ export interface ILinePreflightData {
...
@@ -23,7 +23,7 @@ export interface ILinePreflightData {
commentStr
:
string
;
commentStr
:
string
;
commentStrOffset
:
number
;
commentStrOffset
:
number
;
commentStrLength
:
number
;
commentStrLength
:
number
;
}
;
}
export
interface
IPreflightData
{
export
interface
IPreflightData
{
supported
:
boolean
;
supported
:
boolean
;
...
...
src/vs/languages/handlebars/common/handlebars.ts
浏览文件 @
e2e8c2a3
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
'
use strict
'
;
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
supports
=
require
(
'
vs/editor/common/modes/supports
'
);
import
supports
=
require
(
'
vs/editor/common/modes/supports
'
);
import
htmlMode
=
require
(
'
vs/languages/html/common/html
'
);
import
htmlMode
=
require
(
'
vs/languages/html/common/html
'
);
...
...
src/vs/languages/lib/common/wireProtocol.ts
浏览文件 @
e2e8c2a3
...
@@ -190,7 +190,7 @@ export class Writer<T> {
...
@@ -190,7 +190,7 @@ export class Writer<T> {
'
\r\n\r\n
'
,
'
\r\n\r\n
'
,
json
,
json
,
'
\r\n
'
'
\r\n
'
]
]
;
this
.
writable
.
write
(
buffer
.
join
(
''
),
'
utf8
'
);
this
.
writable
.
write
(
buffer
.
join
(
''
),
'
utf8
'
);
}
}
}
}
\ No newline at end of file
src/vs/languages/php/common/php.ts
浏览文件 @
e2e8c2a3
...
@@ -5,17 +5,11 @@
...
@@ -5,17 +5,11 @@
'
use strict
'
;
'
use strict
'
;
import
WinJS
=
require
(
'
vs/base/common/winjs.base
'
);
import
WinJS
=
require
(
'
vs/base/common/winjs.base
'
);
import
Network
=
require
(
'
vs/base/common/network
'
);
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
supports
=
require
(
'
vs/editor/common/modes/supports
'
);
import
supports
=
require
(
'
vs/editor/common/modes/supports
'
);
import
platform
=
require
(
'
vs/platform/platform
'
);
import
Arrays
=
require
(
'
vs/base/common/arrays
'
);
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
{
AbstractMode
,
isDigit
,
createWordRegExp
}
from
'
vs/editor/common/modes/abstractMode
'
;
import
{
AbstractMode
,
isDigit
,
createWordRegExp
}
from
'
vs/editor/common/modes/abstractMode
'
;
import
{
AbstractState
}
from
'
vs/editor/common/modes/abstractState
'
;
import
{
AbstractState
}
from
'
vs/editor/common/modes/abstractState
'
;
import
{
OneWorkerAttr
}
from
'
vs/platform/thread/common/threadService
'
;
import
{
AsyncDescriptor2
,
createAsyncDescriptor2
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
OnEnterSupport
}
from
'
vs/editor/common/modes/supports/onEnter
'
;
import
{
OnEnterSupport
}
from
'
vs/editor/common/modes/supports/onEnter
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
@@ -54,10 +48,10 @@ var brackets = (function() {
...
@@ -54,10 +48,10 @@ var brackets = (function() {
return
!!
MAP
[
text
];
return
!!
MAP
[
text
];
},
},
tokenTypeFromString
:
(
text
:
string
):
string
=>
{
tokenTypeFromString
:
(
text
:
string
):
string
=>
{
return
MAP
[
text
].
tokenType
return
MAP
[
text
].
tokenType
;
},
},
bracketTypeFromString
:
(
text
:
string
):
Modes
.
Bracket
=>
{
bracketTypeFromString
:
(
text
:
string
):
Modes
.
Bracket
=>
{
return
MAP
[
text
].
bracketType
return
MAP
[
text
].
bracketType
;
}
}
};
};
})();
})();
...
@@ -273,9 +267,13 @@ export class PHPNumber extends PHPState {
...
@@ -273,9 +267,13 @@ export class PHPNumber extends PHPState {
}
}
}
}
var
tokenType
=
'
number
'
;
var
tokenType
=
'
number
'
;
if
(
base
===
16
)
tokenType
+=
'
.hex
'
;
if
(
base
===
16
)
{
else
if
(
base
===
8
)
tokenType
+=
'
.octal
'
;
tokenType
+=
'
.hex
'
;
else
if
(
base
===
2
)
tokenType
+=
'
.binary
'
;
}
else
if
(
base
===
8
)
{
tokenType
+=
'
.octal
'
;
}
else
if
(
base
===
2
)
{
tokenType
+=
'
.binary
'
;
}
return
{
type
:
tokenType
+
'
.php
'
,
nextState
:
this
.
parent
};
return
{
type
:
tokenType
+
'
.php
'
,
nextState
:
this
.
parent
};
}
}
}
}
...
...
src/vs/languages/plaintext/common/plaintext.ts
浏览文件 @
e2e8c2a3
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
'
use strict
'
;
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
supports
=
require
(
'
vs/editor/common/modes/supports
'
);
import
supports
=
require
(
'
vs/editor/common/modes/supports
'
);
import
{
AbstractMode
}
from
'
vs/editor/common/modes/abstractMode
'
;
import
{
AbstractMode
}
from
'
vs/editor/common/modes/abstractMode
'
;
...
...
src/vs/languages/razor/common/csharpTokenization.ts
浏览文件 @
e2e8c2a3
...
@@ -5,9 +5,7 @@
...
@@ -5,9 +5,7 @@
'
use strict
'
;
'
use strict
'
;
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
modesExtensions
=
require
(
'
vs/editor/common/modes/modesRegistry
'
);
import
htmlMode
=
require
(
'
vs/languages/html/common/html
'
);
import
htmlMode
=
require
(
'
vs/languages/html/common/html
'
);
import
VSXML
=
require
(
'
vs/languages/vsxml/common/vsxml
'
);
import
VSXML
=
require
(
'
vs/languages/vsxml/common/vsxml
'
);
import
{
AbstractState
}
from
'
vs/editor/common/modes/abstractState
'
;
import
{
AbstractState
}
from
'
vs/editor/common/modes/abstractState
'
;
...
@@ -53,10 +51,10 @@ var brackets = (function() {
...
@@ -53,10 +51,10 @@ var brackets = (function() {
return
!!
MAP
[
text
];
return
!!
MAP
[
text
];
},
},
tokenTypeFromString
:
(
text
:
string
):
string
=>
{
tokenTypeFromString
:
(
text
:
string
):
string
=>
{
return
MAP
[
text
].
tokenType
return
MAP
[
text
].
tokenType
;
},
},
bracketTypeFromString
:
(
text
:
string
):
Modes
.
Bracket
=>
{
bracketTypeFromString
:
(
text
:
string
):
Modes
.
Bracket
=>
{
return
MAP
[
text
].
bracketType
return
MAP
[
text
].
bracketType
;
}
}
};
};
})();
})();
...
...
src/vs/languages/razor/common/razor.ts
浏览文件 @
e2e8c2a3
...
@@ -4,12 +4,11 @@
...
@@ -4,12 +4,11 @@
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
'
use strict
'
;
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
supports
=
require
(
'
vs/editor/common/modes/supports
'
);
import
supports
=
require
(
'
vs/editor/common/modes/supports
'
);
import
htmlMode
=
require
(
'
vs/languages/html/common/html
'
);
import
htmlMode
=
require
(
'
vs/languages/html/common/html
'
);
import
csharpTokenization
=
require
(
'
vs/languages/razor/common/csharpTokenization
'
);
import
csharpTokenization
=
require
(
'
vs/languages/razor/common/csharpTokenization
'
);
import
{
AbstractMode
,
createWordRegExp
}
from
'
vs/editor/common/modes/abstractMode
'
;
import
{
createWordRegExp
}
from
'
vs/editor/common/modes/abstractMode
'
;
import
{
AsyncDescriptor2
,
createAsyncDescriptor2
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
AsyncDescriptor2
,
createAsyncDescriptor2
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
OnEnterSupport
}
from
'
vs/editor/common/modes/supports/onEnter
'
;
import
{
OnEnterSupport
}
from
'
vs/editor/common/modes/supports/onEnter
'
;
import
razorTokenTypes
=
require
(
'
vs/languages/razor/common/razorTokenTypes
'
);
import
razorTokenTypes
=
require
(
'
vs/languages/razor/common/razorTokenTypes
'
);
...
...
src/vs/languages/razor/common/razorWorker.ts
浏览文件 @
e2e8c2a3
...
@@ -4,8 +4,6 @@
...
@@ -4,8 +4,6 @@
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
import
htmlWorker
=
require
(
'
vs/languages/html/common/htmlWorker
'
);
import
htmlWorker
=
require
(
'
vs/languages/html/common/htmlWorker
'
);
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
htmlTags
=
require
(
'
vs/languages/html/common/htmlTags
'
);
import
htmlTags
=
require
(
'
vs/languages/html/common/htmlTags
'
);
export
function
getRazorTagProvider
()
:
htmlTags
.
IHTMLTagProvider
{
export
function
getRazorTagProvider
()
:
htmlTags
.
IHTMLTagProvider
{
...
...
src/vs/languages/vsxml/common/vsxml.ts
浏览文件 @
e2e8c2a3
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
{
AbstractState
}
from
'
vs/editor/common/modes/abstractState
'
;
import
{
AbstractState
}
from
'
vs/editor/common/modes/abstractState
'
;
import
vsxmlTokenTypes
=
require
(
'
vs/languages/vsxml/common/vsxmlTokenTypes
'
);
import
vsxmlTokenTypes
=
require
(
'
vs/languages/vsxml/common/vsxmlTokenTypes
'
);
...
...
src/vs/platform/keybinding/common/keybindingResolver.ts
浏览文件 @
e2e8c2a3
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
import
*
as
defaultPlatform
from
'
vs/base/common/platform
'
;
import
*
as
defaultPlatform
from
'
vs/base/common/platform
'
;
import
{
IKeybindingItem
,
KbExpr
,
IUserFriendlyKeybinding
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
IKeybindingItem
,
KbExpr
,
IUserFriendlyKeybinding
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
KeyMod
,
KeyCode
,
BinaryKeybindings
,
Keybinding
,
ISimplifiedPlatform
}
from
'
vs/base/common/keyCodes
'
;
import
{
BinaryKeybindings
,
Keybinding
,
ISimplifiedPlatform
}
from
'
vs/base/common/keyCodes
'
;
export
interface
IResolveResult
{
export
interface
IResolveResult
{
enterChord
:
number
;
enterChord
:
number
;
...
@@ -197,7 +197,7 @@ export class KeybindingResolver {
...
@@ -197,7 +197,7 @@ export class KeybindingResolver {
}
}
public
lookupKeybinding
(
commandId
:
string
):
Keybinding
[]
{
public
lookupKeybinding
(
commandId
:
string
):
Keybinding
[]
{
let
rawPossibleTriggers
=
this
.
_lookupMap
[
commandId
]
let
rawPossibleTriggers
=
this
.
_lookupMap
[
commandId
]
;
if
(
!
rawPossibleTriggers
)
{
if
(
!
rawPossibleTriggers
)
{
return
[];
return
[];
}
}
...
...
src/vs/platform/keybinding/common/keybindingService.ts
浏览文件 @
e2e8c2a3
...
@@ -76,6 +76,7 @@ export class KbEqualsExpression implements KbExpr {
...
@@ -76,6 +76,7 @@ export class KbEqualsExpression implements KbExpr {
}
}
public
evaluate
(
context
:
any
):
boolean
{
public
evaluate
(
context
:
any
):
boolean
{
// Intentional ==
return
(
context
[
this
.
key
]
==
this
.
value
);
return
(
context
[
this
.
key
]
==
this
.
value
);
}
}
...
@@ -110,6 +111,7 @@ export class KbNotEqualsExpression implements KbExpr {
...
@@ -110,6 +111,7 @@ export class KbNotEqualsExpression implements KbExpr {
}
}
public
evaluate
(
context
:
any
):
boolean
{
public
evaluate
(
context
:
any
):
boolean
{
// Intentional !=
return
(
context
[
this
.
key
]
!=
this
.
value
);
return
(
context
[
this
.
key
]
!=
this
.
value
);
}
}
...
@@ -275,7 +277,7 @@ export let KbExpr = {
...
@@ -275,7 +277,7 @@ export let KbExpr = {
return
serializedValue
;
return
serializedValue
;
}
}
}
}
;
export
interface
IKeybindingItem
{
export
interface
IKeybindingItem
{
keybinding
:
number
;
keybinding
:
number
;
...
@@ -297,7 +299,7 @@ export interface ICommandHandlerDescription {
...
@@ -297,7 +299,7 @@ export interface ICommandHandlerDescription {
}
}
export
interface
ICommandsMap
{
export
interface
ICommandsMap
{
[
id
:
string
]:
ICommandHandler
[
id
:
string
]:
ICommandHandler
;
}
}
export
interface
IKeybindingContextKey
<
T
>
{
export
interface
IKeybindingContextKey
<
T
>
{
...
...
src/vs/platform/keybinding/common/keybindingsRegistry.ts
浏览文件 @
e2e8c2a3
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
TypeConstraint
,
validateConstraints
}
from
'
vs/base/common/types
'
;
import
{
TypeConstraint
,
validateConstraints
}
from
'
vs/base/common/types
'
;
import
{
ICommandHandler
,
ICommandHandlerDescription
,
ICommandsMap
,
IKeybindingItem
,
IKeybindings
,
KbExpr
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
ICommandHandler
,
ICommandHandlerDescription
,
ICommandsMap
,
IKeybindingItem
,
IKeybindings
,
KbExpr
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
Key
Mod
,
Key
Code
,
BinaryKeybindings
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyCode
,
BinaryKeybindings
}
from
'
vs/base/common/keyCodes
'
;
import
Platform
=
require
(
'
vs/base/common/platform
'
);
import
Platform
=
require
(
'
vs/base/common/platform
'
);
export
interface
ICommandRule
extends
IKeybindings
{
export
interface
ICommandRule
extends
IKeybindings
{
...
...
src/vs/platform/keybinding/test/common/mockKeybindingService.ts
浏览文件 @
e2e8c2a3
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
'
use strict
'
;
import
{
IKeybindingService
,
IKeybindingContextKey
,
IKeybindingItem
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
IKeybindingService
,
IKeybindingContextKey
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
Keybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
Keybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
IHTMLContentElement
}
from
'
vs/base/common/htmlContent
'
;
import
{
IHTMLContentElement
}
from
'
vs/base/common/htmlContent
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
...
...
src/vs/platform/plugins/common/abstractPluginService.ts
浏览文件 @
e2e8c2a3
...
@@ -5,16 +5,13 @@
...
@@ -5,16 +5,13 @@
'
use strict
'
;
'
use strict
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
nls
=
require
(
'
vs/nls
'
);
import
{
IPluginDescription
,
IPluginService
,
IMessage
,
I
PointListener
,
I
ActivationEventListener
,
IPluginStatus
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
IPluginDescription
,
IPluginService
,
IMessage
,
IActivationEventListener
,
IPluginStatus
}
from
'
vs/platform/plugins/common/plugins
'
;
import
WinJS
=
require
(
'
vs/base/common/winjs.base
'
);
import
WinJS
=
require
(
'
vs/base/common/winjs.base
'
);
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
Errors
=
require
(
'
vs/base/common/errors
'
);
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
PluginsRegistry
}
from
'
vs/platform/plugins/common/pluginsRegistry
'
;
import
{
PluginsRegistry
}
from
'
vs/platform/plugins/common/pluginsRegistry
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
Severity
from
'
vs/base/common/severity
'
;
var
hasOwnProperty
=
Object
.
hasOwnProperty
;
var
hasOwnProperty
=
Object
.
hasOwnProperty
;
var
global
=
this
;
export
interface
IPluginContext
{
export
interface
IPluginContext
{
subscriptions
:
IDisposable
[];
subscriptions
:
IDisposable
[];
...
@@ -33,7 +30,7 @@ export abstract class ActivatedPlugin {
...
@@ -33,7 +30,7 @@ export abstract class ActivatedPlugin {
activationFailed
:
boolean
;
activationFailed
:
boolean
;
constructor
(
activationFailed
:
boolean
)
{
constructor
(
activationFailed
:
boolean
)
{
this
.
activationFailed
=
activationFailed
this
.
activationFailed
=
activationFailed
;
}
}
}
}
...
...
src/vs/platform/plugins/common/ipcRemoteCom.ts
浏览文件 @
e2e8c2a3
...
@@ -51,7 +51,7 @@ function createRPC(serializeAndSend:(obj:any)=>void): IRPCFunc {
...
@@ -51,7 +51,7 @@ function createRPC(serializeAndSend:(obj:any)=>void): IRPCFunc {
return
r
;
return
r
;
};
};
}
;
}
export
interface
IPluginsIPC
extends
remote
.
IRemoteCom
{
export
interface
IPluginsIPC
extends
remote
.
IRemoteCom
{
handle
(
msg
:
string
):
void
;
handle
(
msg
:
string
):
void
;
...
@@ -145,5 +145,5 @@ export function create(send: (obj: string) => void): IPluginsIPC {
...
@@ -145,5 +145,5 @@ export function create(send: (obj: string) => void): IPluginsIPC {
}
}
return
r
;
return
r
;
}
;
}
src/vs/platform/plugins/common/nativePluginService.ts
浏览文件 @
e2e8c2a3
...
@@ -15,7 +15,7 @@ import {IMessageService} from 'vs/platform/message/common/message';
...
@@ -15,7 +15,7 @@ import {IMessageService} from 'vs/platform/message/common/message';
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
PluginHostStorage
}
from
'
vs/platform/storage/common/remotable.storage
'
;
import
{
PluginHostStorage
}
from
'
vs/platform/storage/common/remotable.storage
'
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
{
IWorkspaceContextService
,
IConfiguration
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
disposeAll
}
from
'
vs/base/common/lifecycle
'
;
import
{
disposeAll
}
from
'
vs/base/common/lifecycle
'
;
var
hasOwnProperty
=
Object
.
hasOwnProperty
;
var
hasOwnProperty
=
Object
.
hasOwnProperty
;
...
@@ -25,8 +25,8 @@ class PluginMemento implements IPluginMemento {
...
@@ -25,8 +25,8 @@ class PluginMemento implements IPluginMemento {
private
_shared
:
boolean
;
private
_shared
:
boolean
;
private
_storage
:
PluginHostStorage
;
private
_storage
:
PluginHostStorage
;
private
_init
:
WinJS
.
TPromise
<
PluginMemento
>
private
_init
:
WinJS
.
TPromise
<
PluginMemento
>
;
private
_value
:
{
[
n
:
string
]:
any
;}
private
_value
:
{
[
n
:
string
]:
any
;}
;
constructor
(
id
:
string
,
global
:
boolean
,
storage
:
PluginHostStorage
)
{
constructor
(
id
:
string
,
global
:
boolean
,
storage
:
PluginHostStorage
)
{
this
.
_id
=
id
;
this
.
_id
=
id
;
...
@@ -44,7 +44,7 @@ class PluginMemento implements IPluginMemento {
...
@@ -44,7 +44,7 @@ class PluginMemento implements IPluginMemento {
}
}
get
<
T
>
(
key
:
string
,
defaultValue
:
T
):
T
{
get
<
T
>
(
key
:
string
,
defaultValue
:
T
):
T
{
let
value
=
this
.
_value
[
key
]
let
value
=
this
.
_value
[
key
]
;
if
(
typeof
value
===
'
undefined
'
)
{
if
(
typeof
value
===
'
undefined
'
)
{
value
=
defaultValue
;
value
=
defaultValue
;
}
}
...
@@ -320,7 +320,7 @@ export class PluginHostPluginService extends AbstractPluginService<ExtHostPlugin
...
@@ -320,7 +320,7 @@ export class PluginHostPluginService extends AbstractPluginService<ExtHostPlugin
// clean up subscriptions
// clean up subscriptions
try
{
try
{
disposeAll
(
plugin
.
subscriptions
)
disposeAll
(
plugin
.
subscriptions
)
;
}
catch
(
err
)
{
}
catch
(
err
)
{
// TODO: Do something with err if this is not the shutdown case
// TODO: Do something with err if this is not the shutdown case
}
}
...
@@ -355,7 +355,7 @@ export class PluginHostPluginService extends AbstractPluginService<ExtHostPlugin
...
@@ -355,7 +355,7 @@ export class PluginHostPluginService extends AbstractPluginService<ExtHostPlugin
globalState
,
globalState
,
workspaceState
,
workspaceState
,
subscriptions
:
[],
subscriptions
:
[],
get
extensionPath
()
{
return
pluginDescription
.
extensionFolderPath
},
get
extensionPath
()
{
return
pluginDescription
.
extensionFolderPath
;
},
asAbsolutePath
:
(
relativePath
:
string
)
=>
{
return
paths
.
normalize
(
paths
.
join
(
pluginDescription
.
extensionFolderPath
,
relativePath
),
true
);
}
asAbsolutePath
:
(
relativePath
:
string
)
=>
{
return
paths
.
normalize
(
paths
.
join
(
pluginDescription
.
extensionFolderPath
,
relativePath
),
true
);
}
});
});
});
});
...
...
src/vs/platform/plugins/common/plugins.ts
浏览文件 @
e2e8c2a3
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
'
use strict
'
;
import
{
createDecorator
,
ServiceIdentifier
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
createDecorator
,
ServiceIdentifier
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
Severity
from
'
vs/base/common/severity
'
;
...
...
src/vs/platform/plugins/common/pluginsRegistry.ts
浏览文件 @
e2e8c2a3
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
import
{
IPluginDescription
,
IPointListener
,
IActivationEventListener
,
IMessage
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
IPluginDescription
,
IPointListener
,
IActivationEventListener
,
IMessage
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
Errors
=
require
(
'
vs/base/common/errors
'
);
import
Errors
=
require
(
'
vs/base/common/errors
'
);
import
env
=
require
(
'
vs/base/common/flags
'
);
import
*
as
JSONContributionRegistry
from
'
vs/platform/jsonschemas/common/jsonContributionRegistry
'
;
import
*
as
JSONContributionRegistry
from
'
vs/platform/jsonschemas/common/jsonContributionRegistry
'
;
import
{
IJSONSchema
}
from
'
vs/base/common/jsonSchema
'
;
import
{
IJSONSchema
}
from
'
vs/base/common/jsonSchema
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
nls
=
require
(
'
vs/nls
'
);
...
@@ -289,7 +288,7 @@ class PluginsRegistryImpl implements IPluginsRegistry {
...
@@ -289,7 +288,7 @@ class PluginsRegistryImpl implements IPluginsRegistry {
private
_pluginsArr
:
IPluginDescription
[];
private
_pluginsArr
:
IPluginDescription
[];
private
_activationMap
:
{[
activationEvent
:
string
]:
IPluginDescription
[];};
private
_activationMap
:
{[
activationEvent
:
string
]:
IPluginDescription
[];};
private
_pointListeners
:
IPointListenerEntry
[];
private
_pointListeners
:
IPointListenerEntry
[];
private
_oneTimeActivationEventListeners
:
{
[
activationEvent
:
string
]:
IActivationEventListener
[];
}
private
_oneTimeActivationEventListeners
:
{
[
activationEvent
:
string
]:
IActivationEventListener
[];
}
;
private
_extensionPoints
:
{
[
extPoint
:
string
]:
ExtensionPoint
<
any
>
;
};
private
_extensionPoints
:
{
[
extPoint
:
string
]:
ExtensionPoint
<
any
>
;
};
constructor
()
{
constructor
()
{
...
@@ -526,7 +525,7 @@ var schema : IJSONSchema = {
...
@@ -526,7 +525,7 @@ var schema : IJSONSchema = {
type
:
'
boolean
'
type
:
'
boolean
'
}
}
}
}
}
}
;
schemaRegistry
.
registerSchema
(
schemaId
,
schema
);
schemaRegistry
.
registerSchema
(
schemaId
,
schema
);
schemaRegistry
.
addSchemaFileAssociation
(
'
/package.json
'
,
schemaId
);
schemaRegistry
.
addSchemaFileAssociation
(
'
/package.json
'
,
schemaId
);
\ No newline at end of file
src/vs/platform/plugins/node/pluginVersionValidator.ts
浏览文件 @
e2e8c2a3
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
'
use strict
'
;
'
use strict
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
nls
=
require
(
'
vs/nls
'
);
import
{
IPluginDescription
,
IPointListener
,
IActivationEventListener
,
IMessage
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
IPluginDescription
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
isValidPluginDescription
as
baseIsValidPluginDescription
}
from
'
vs/platform/plugins/common/pluginsRegistry
'
;
import
{
isValidPluginDescription
as
baseIsValidPluginDescription
}
from
'
vs/platform/plugins/common/pluginsRegistry
'
;
import
*
as
semver
from
'
semver
'
;
import
*
as
semver
from
'
semver
'
;
...
...
src/vs/platform/thread/common/abstractThreadService.ts
浏览文件 @
e2e8c2a3
...
@@ -6,11 +6,10 @@
...
@@ -6,11 +6,10 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
remote
=
require
(
'
vs/base/common/remote
'
);
import
remote
=
require
(
'
vs/base/common/remote
'
);
import
Types
=
require
(
'
vs/base/common/types
'
);
import
{
ThreadAffinity
,
Remotable
,
IThreadSynchronizableObject
,
IDynamicProxy
}
from
'
vs/platform/thread/common/thread
'
;
import
{
IThreadServiceStatusListener
,
ThreadAffinity
,
Remotable
,
IRemotableCtorMap
,
IThreadSynchronizableObject
,
IDynamicProxy
}
from
'
vs/platform/thread/common/thread
'
;
import
{
THREAD_SERVICE_PROPERTY_NAME
}
from
'
vs/platform/thread/common/threadService
'
;
import
{
THREAD_SERVICE_PROPERTY_NAME
}
from
'
vs/platform/thread/common/threadService
'
;
import
instantiation
=
require
(
'
vs/platform/instantiation/common/instantiation
'
);
import
instantiation
=
require
(
'
vs/platform/instantiation/common/instantiation
'
);
import
{
SyncDescriptor
,
SyncDescriptor
0
,
createSyncDescriptor
,
AsyncDescriptor0
,
AsyncDescriptor1
,
AsyncDescriptor2
,
AsyncDescriptor3
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
SyncDescriptor0
,
createSyncDescriptor
,
AsyncDescriptor0
,
AsyncDescriptor1
,
AsyncDescriptor2
,
AsyncDescriptor3
}
from
'
vs/platform/instantiation/common/descriptors
'
;
export
interface
IThreadServiceData
{
export
interface
IThreadServiceData
{
[
id
:
string
]:
any
;
[
id
:
string
]:
any
;
...
@@ -37,11 +36,6 @@ class DynamicProxy<T> implements IDynamicProxy<T> {
...
@@ -37,11 +36,6 @@ class DynamicProxy<T> implements IDynamicProxy<T> {
export
abstract
class
AbstractThreadService
implements
remote
.
IManyHandler
{
export
abstract
class
AbstractThreadService
implements
remote
.
IManyHandler
{
private
static
_LAST_DYNAMIC_PROXY_ID
:
number
=
0
;
private
static
generateDynamicProxyId
():
string
{
return
String
(
++
this
.
_LAST_DYNAMIC_PROXY_ID
);
}
public
isInMainThread
:
boolean
;
public
isInMainThread
:
boolean
;
protected
_instantiationService
:
instantiation
.
IInstantiationService
;
protected
_instantiationService
:
instantiation
.
IInstantiationService
;
...
...
src/vs/platform/thread/common/mainThreadService.ts
浏览文件 @
e2e8c2a3
...
@@ -11,7 +11,6 @@ import Env = require('vs/base/common/flags');
...
@@ -11,7 +11,6 @@ import Env = require('vs/base/common/flags');
import
Platform
=
require
(
'
vs/base/common/platform
'
);
import
Platform
=
require
(
'
vs/base/common/platform
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
Timer
=
require
(
'
vs/base/common/timer
'
);
import
Timer
=
require
(
'
vs/base/common/timer
'
);
import
{
IPluginDescription
}
from
'
vs/platform/plugins/common/plugins
'
;
import
remote
=
require
(
'
vs/base/common/remote
'
);
import
remote
=
require
(
'
vs/base/common/remote
'
);
import
{
readThreadSynchronizableObjects
}
from
'
vs/platform/thread/common/threadService
'
;
import
{
readThreadSynchronizableObjects
}
from
'
vs/platform/thread/common/threadService
'
;
import
{
SyncDescriptor0
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
SyncDescriptor0
}
from
'
vs/platform/instantiation/common/descriptors
'
;
...
...
src/vs/platform/thread/common/pluginHostThreadService.ts
浏览文件 @
e2e8c2a3
...
@@ -9,7 +9,6 @@ import remote = require('vs/base/common/remote');
...
@@ -9,7 +9,6 @@ import remote = require('vs/base/common/remote');
import
descriptors
=
require
(
'
vs/platform/instantiation/common/descriptors
'
);
import
descriptors
=
require
(
'
vs/platform/instantiation/common/descriptors
'
);
import
abstractThreadService
=
require
(
'
./abstractThreadService
'
);
import
abstractThreadService
=
require
(
'
./abstractThreadService
'
);
import
threadService
=
require
(
'
./threadService
'
);
import
{
readThreadSynchronizableObjects
}
from
'
vs/platform/thread/common/threadService
'
;
import
{
readThreadSynchronizableObjects
}
from
'
vs/platform/thread/common/threadService
'
;
import
{
IThreadService
,
IThreadSynchronizableObject
,
ThreadAffinity
,
IThreadServiceStatusListener
}
from
'
vs/platform/thread/common/thread
'
;
import
{
IThreadService
,
IThreadSynchronizableObject
,
ThreadAffinity
,
IThreadServiceStatusListener
}
from
'
vs/platform/thread/common/thread
'
;
...
...
src/vs/platform/thread/common/thread.ts
浏览文件 @
e2e8c2a3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
'
use strict
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
descriptors
=
require
(
'
vs/platform/instantiation/common/descriptors
'
);
import
descriptors
=
require
(
'
vs/platform/instantiation/common/descriptors
'
);
...
@@ -81,7 +81,7 @@ export class Remotable {
...
@@ -81,7 +81,7 @@ export class Remotable {
Remotable
.
_ensureUnique
(
identifier
);
Remotable
.
_ensureUnique
(
identifier
);
Remotable
.
Registry
.
MainContext
[
identifier
]
=
target
;
Remotable
.
Registry
.
MainContext
[
identifier
]
=
target
;
target
[
Remotable
.
PROP_NAME
]
=
identifier
;
target
[
Remotable
.
PROP_NAME
]
=
identifier
;
}
}
;
}
}
public
static
PluginHostContext
(
identifier
:
string
)
{
public
static
PluginHostContext
(
identifier
:
string
)
{
...
@@ -89,7 +89,7 @@ export class Remotable {
...
@@ -89,7 +89,7 @@ export class Remotable {
Remotable
.
_ensureUnique
(
identifier
);
Remotable
.
_ensureUnique
(
identifier
);
Remotable
.
Registry
.
PluginHostContext
[
identifier
]
=
target
;
Remotable
.
Registry
.
PluginHostContext
[
identifier
]
=
target
;
target
[
Remotable
.
PROP_NAME
]
=
identifier
;
target
[
Remotable
.
PROP_NAME
]
=
identifier
;
}
}
;
}
}
public
static
WorkerContext
(
identifier
:
string
,
whichWorker
:
ThreadAffinity
)
{
public
static
WorkerContext
(
identifier
:
string
,
whichWorker
:
ThreadAffinity
)
{
...
@@ -100,7 +100,7 @@ export class Remotable {
...
@@ -100,7 +100,7 @@ export class Remotable {
affinity
:
whichWorker
affinity
:
whichWorker
};
};
target
[
Remotable
.
PROP_NAME
]
=
identifier
;
target
[
Remotable
.
PROP_NAME
]
=
identifier
;
}
}
;
}
}
private
static
_ensureUnique
(
identifier
:
string
):
void
{
private
static
_ensureUnique
(
identifier
:
string
):
void
{
...
...
src/vs/platform/thread/common/threadService.ts
浏览文件 @
e2e8c2a3
...
@@ -2,10 +2,9 @@
...
@@ -2,10 +2,9 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
'
use strict
'
;
import
Platform
=
require
(
'
vs/platform/platform
'
);
import
Platform
=
require
(
'
vs/platform/platform
'
);
import
types
=
require
(
'
vs/base/common/types
'
);
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
thread
=
require
(
'
./thread
'
);
import
thread
=
require
(
'
./thread
'
);
...
@@ -109,7 +108,7 @@ export var Extensions = {
...
@@ -109,7 +108,7 @@ export var Extensions = {
SynchronizableObjects
:
'
SynchronizableObjects
'
SynchronizableObjects
:
'
SynchronizableObjects
'
};
};
Platform
.
Registry
.
add
(
Extensions
.
SynchronizableObjects
,
new
SynchronizableObjectsRegistry
())
Platform
.
Registry
.
add
(
Extensions
.
SynchronizableObjects
,
new
SynchronizableObjectsRegistry
())
;
export
function
registerThreadSynchronizableObject
(
obj
:
thread
.
IThreadSynchronizableObject
<
any
>
):
void
{
export
function
registerThreadSynchronizableObject
(
obj
:
thread
.
IThreadSynchronizableObject
<
any
>
):
void
{
var
registry
=
<
SynchronizableObjectsRegistry
>
Platform
.
Registry
.
as
(
Extensions
.
SynchronizableObjects
);
var
registry
=
<
SynchronizableObjectsRegistry
>
Platform
.
Registry
.
as
(
Extensions
.
SynchronizableObjects
);
...
...
src/vs/platform/thread/common/workerThreadService.ts
浏览文件 @
e2e8c2a3
...
@@ -8,7 +8,6 @@ import {TPromise} from 'vs/base/common/winjs.base';
...
@@ -8,7 +8,6 @@ import {TPromise} from 'vs/base/common/winjs.base';
import
{
readThreadSynchronizableObjects
}
from
'
./threadService
'
;
import
{
readThreadSynchronizableObjects
}
from
'
./threadService
'
;
import
abstractThreadService
=
require
(
'
vs/platform/thread/common/abstractThreadService
'
);
import
abstractThreadService
=
require
(
'
vs/platform/thread/common/abstractThreadService
'
);
import
remote
=
require
(
'
vs/base/common/remote
'
);
import
remote
=
require
(
'
vs/base/common/remote
'
);
import
types
=
require
(
'
vs/base/common/types
'
);
import
{
SyncDescriptor0
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
SyncDescriptor0
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
IThreadService
,
IThreadServiceStatusListener
,
IThreadSynchronizableObject
,
ThreadAffinity
}
from
'
vs/platform/thread/common/thread
'
;
import
{
IThreadService
,
IThreadServiceStatusListener
,
IThreadSynchronizableObject
,
ThreadAffinity
}
from
'
vs/platform/thread/common/thread
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录