Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f6e57602
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f6e57602
编写于
11月 24, 2015
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix whitespace
上级
b232ee55
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
182 addition
and
182 deletion
+182
-182
src/vs/base/browser/globalMouseMoveMonitor.ts
src/vs/base/browser/globalMouseMoveMonitor.ts
+10
-10
src/vs/base/browser/idleMonitor.ts
src/vs/base/browser/idleMonitor.ts
+25
-25
src/vs/base/browser/iframe.ts
src/vs/base/browser/iframe.ts
+10
-10
src/vs/base/common/collections.ts
src/vs/base/common/collections.ts
+10
-10
src/vs/base/common/graph.ts
src/vs/base/common/graph.ts
+13
-13
src/vs/base/common/injector.ts
src/vs/base/common/injector.ts
+19
-19
src/vs/base/common/remote.ts
src/vs/base/common/remote.ts
+12
-12
src/vs/base/common/worker/workerProtocol.ts
src/vs/base/common/worker/workerProtocol.ts
+6
-6
src/vs/editor/common/services/modeServiceImpl.ts
src/vs/editor/common/services/modeServiceImpl.ts
+1
-1
src/vs/editor/common/viewModel/prefixSumComputer.ts
src/vs/editor/common/viewModel/prefixSumComputer.ts
+21
-21
src/vs/editor/contrib/hover/browser/hover.css
src/vs/editor/contrib/hover/browser/hover.css
+2
-2
src/vs/languages/css/common/parser/cssErrors.ts
src/vs/languages/css/common/parser/cssErrors.ts
+1
-1
src/vs/languages/css/common/parser/cssSymbols.ts
src/vs/languages/css/common/parser/cssSymbols.ts
+34
-34
src/vs/languages/css/common/services/browsers.js
src/vs/languages/css/common/services/browsers.js
+1
-1
src/vs/languages/typescript/common/typescript.ts
src/vs/languages/typescript/common/typescript.ts
+2
-2
src/vs/platform/plugins/common/ipcRemoteCom.ts
src/vs/platform/plugins/common/ipcRemoteCom.ts
+12
-12
src/vs/workbench/parts/output/browser/outputActions.ts
src/vs/workbench/parts/output/browser/outputActions.ts
+1
-1
src/vs/workbench/parts/telemetry/test/node/appInsightsTelemetryAppender.test.ts
.../telemetry/test/node/appInsightsTelemetryAppender.test.ts
+1
-1
src/vs/workbench/services/files/test/node/fileService.test.ts
...vs/workbench/services/files/test/node/fileService.test.ts
+1
-1
未找到文件。
src/vs/base/browser/globalMouseMoveMonitor.ts
浏览文件 @
f6e57602
...
...
@@ -38,45 +38,45 @@ export function standardMouseMoveMerger(lastEvent:IStandardMouseMoveEventData, c
}
export
class
GlobalMouseMoveMonitor
<
R
>
implements
Lifecycle
.
IDisposable
{
private
hooks
:
Lifecycle
.
IDisposable
[];
private
mouseMoveEventMerger
:
IEventMerger
<
R
>
;
private
mouseMoveCallback
:
IMouseMoveCallback
<
R
>
;
private
onStopCallback
:
IOnStopCallback
;
constructor
()
{
this
.
hooks
=
[];
this
.
mouseMoveEventMerger
=
null
;
this
.
mouseMoveCallback
=
null
;
this
.
onStopCallback
=
null
;
}
public
dispose
():
void
{
this
.
stopMonitoring
(
false
);
}
public
stopMonitoring
(
invokeStopCallback
:
boolean
):
void
{
if
(
!
this
.
isMonitoring
())
{
// Not monitoring
return
;
}
// Unhook
this
.
hooks
=
Lifecycle
.
disposeAll
(
this
.
hooks
);
this
.
mouseMoveEventMerger
=
null
;
this
.
mouseMoveCallback
=
null
;
var
onStopCallback
=
this
.
onStopCallback
;
this
.
onStopCallback
=
null
;
if
(
invokeStopCallback
)
{
onStopCallback
();
}
}
public
isMonitoring
()
{
return
this
.
hooks
.
length
>
0
;
}
public
startMonitoring
(
mouseMoveEventMerger
:
IEventMerger
<
R
>
,
mouseMoveCallback
:
IMouseMoveCallback
<
R
>
,
...
...
@@ -89,7 +89,7 @@ export class GlobalMouseMoveMonitor<R> implements Lifecycle.IDisposable {
this
.
mouseMoveEventMerger
=
mouseMoveEventMerger
;
this
.
mouseMoveCallback
=
mouseMoveCallback
;
this
.
onStopCallback
=
onStopCallback
;
var
windowChain
=
IframeUtils
.
getSameOriginWindowChain
();
for
(
var
i
=
0
;
i
<
windowChain
.
length
;
i
++
)
{
this
.
hooks
.
push
(
DomUtils
.
addDisposableThrottledListener
(
windowChain
[
i
].
window
.
document
,
'
mousemove
'
,
...
...
@@ -98,7 +98,7 @@ export class GlobalMouseMoveMonitor<R> implements Lifecycle.IDisposable {
));
this
.
hooks
.
push
(
DomUtils
.
addDisposableListener
(
windowChain
[
i
].
window
.
document
,
'
mouseup
'
,
(
e
:
MouseEvent
)
=>
this
.
stopMonitoring
(
true
)));
}
if
(
IframeUtils
.
hasDifferentOriginAncestor
())
{
var
lastSameOriginAncestor
=
windowChain
[
windowChain
.
length
-
1
];
// We might miss a mouse up if it happens outside the iframe
...
...
src/vs/base/browser/idleMonitor.ts
浏览文件 @
f6e57602
...
...
@@ -17,7 +17,7 @@ export enum UserStatus {
export
var
DEFAULT_IDLE_TIME
=
60
*
60
*
1000
;
// 60 minutes
export
class
IdleMonitor
{
private
toDispose
:
Lifecycle
.
IDisposable
[];
private
lastActiveTime
:
number
;
private
idleCheckTimeout
:
number
;
...
...
@@ -25,41 +25,41 @@ export class IdleMonitor {
private
eventEmitter
:
EventEmitter
.
EventEmitter
;
private
instance
:
ReferenceCountedIdleMonitor
;
private
idleTime
:
number
;
constructor
(
idleTime
:
number
=
DEFAULT_IDLE_TIME
)
{
this
.
instance
=
ReferenceCountedIdleMonitor
.
INSTANCE
;
this
.
instance
.
increment
();
this
.
status
=
null
;
this
.
idleCheckTimeout
=
-
1
;
this
.
lastActiveTime
=
-
1
;
this
.
idleTime
=
idleTime
;
this
.
toDispose
=
[];
this
.
eventEmitter
=
new
EventEmitter
.
EventEmitter
();
this
.
toDispose
.
push
(
this
.
eventEmitter
);
this
.
toDispose
.
push
({
dispose
:
this
.
instance
.
addListener
(()
=>
this
.
onUserActive
())});
this
.
onUserActive
();
}
public
addOneTimeActiveListener
(
callback
:()
=>
void
):
Lifecycle
.
IDisposable
{
return
this
.
eventEmitter
.
addOneTimeDisposableListener
(
'
onActive
'
,
callback
);
}
public
addOneTimeIdleListener
(
callback
:()
=>
void
):
Lifecycle
.
IDisposable
{
return
this
.
eventEmitter
.
addOneTimeDisposableListener
(
'
onIdle
'
,
callback
);
}
public
getStatus
():
UserStatus
{
return
this
.
status
;
}
public
dispose
():
void
{
this
.
cancelIdleCheck
();
this
.
toDispose
=
Lifecycle
.
disposeAll
(
this
.
toDispose
);
this
.
instance
.
decrement
();
}
private
onUserActive
():
void
{
this
.
lastActiveTime
=
(
new
Date
()).
getTime
();
if
(
this
.
status
!==
UserStatus
.
Active
)
{
...
...
@@ -68,14 +68,14 @@ export class IdleMonitor {
this
.
eventEmitter
.
emit
(
'
onActive
'
);
}
}
private
onUserIdle
():
void
{
if
(
this
.
status
!==
UserStatus
.
Idle
)
{
this
.
status
=
UserStatus
.
Idle
;
this
.
eventEmitter
.
emit
(
'
onIdle
'
);
}
}
private
scheduleIdleCheck
():
void
{
if
(
this
.
idleCheckTimeout
===
-
1
)
{
var
minimumTimeWhenUserCanBecomeIdle
=
this
.
lastActiveTime
+
this
.
idleTime
;
...
...
@@ -85,14 +85,14 @@ export class IdleMonitor {
},
minimumTimeWhenUserCanBecomeIdle
-
(
new
Date
()).
getTime
());
}
}
private
cancelIdleCheck
():
void
{
if
(
this
.
idleCheckTimeout
!==
-
1
)
{
clearTimeout
(
this
.
idleCheckTimeout
);
this
.
idleCheckTimeout
=
-
1
;
}
}
private
checkIfUserIsIdle
():
void
{
var
actualIdleTime
=
(
new
Date
()).
getTime
()
-
this
.
lastActiveTime
;
if
(
actualIdleTime
>=
this
.
idleTime
)
{
...
...
@@ -104,20 +104,20 @@ export class IdleMonitor {
}
class
ReferenceCountedObject
{
private
referenceCount
:
number
;
constructor
()
{
this
.
referenceCount
=
0
;
}
public
increment
():
void
{
if
(
this
.
referenceCount
===
0
)
{
this
.
construct
();
}
this
.
referenceCount
++
;
}
public
decrement
():
void
{
if
(
this
.
referenceCount
>
0
)
{
this
.
referenceCount
--
;
...
...
@@ -126,23 +126,23 @@ class ReferenceCountedObject {
}
}
}
public
construct
():
void
{
throw
new
Error
(
'
Implement me
'
);
}
public
dispose
():
void
{
throw
new
Error
(
'
Implement me
'
);
}
}
class
ReferenceCountedIdleMonitor
extends
ReferenceCountedObject
{
public
static
INSTANCE
:
ReferenceCountedIdleMonitor
=
new
ReferenceCountedIdleMonitor
();
private
toDispose
:
Lifecycle
.
IDisposable
[];
private
eventEmitter
:
EventEmitter
.
EventEmitter
;
public
construct
():
void
{
this
.
toDispose
=
[];
this
.
eventEmitter
=
new
EventEmitter
.
EventEmitter
();
...
...
@@ -151,15 +151,15 @@ class ReferenceCountedIdleMonitor extends ReferenceCountedObject {
this
.
toDispose
.
push
(
DomUtils
.
addDisposableListener
(
BrowserService
.
getService
().
document
,
'
keydown
'
,
()
=>
this
.
onUserActive
()));
this
.
onUserActive
();
}
public
dispose
():
void
{
this
.
toDispose
=
Lifecycle
.
disposeAll
(
this
.
toDispose
);
}
private
onUserActive
():
void
{
this
.
eventEmitter
.
emit
(
'
onActive
'
);
}
public
addListener
(
callback
:()
=>
void
):
EventEmitter
.
ListenerUnbind
{
return
this
.
eventEmitter
.
addListener
(
'
onActive
'
,
callback
);
}
...
...
src/vs/base/browser/iframe.ts
浏览文件 @
f6e57602
...
...
@@ -25,7 +25,7 @@ function getParentWindowIfSameOrigin(w:Window): Window {
if
(
!
w
.
parent
||
w
.
parent
===
w
)
{
return
null
;
}
// Cannot really tell if we have access to the parent window unless we try to access something in it
try
{
var
location
=
w
.
location
;
...
...
@@ -38,7 +38,7 @@ function getParentWindowIfSameOrigin(w:Window): Window {
hasDifferentOriginAncestorFlag
=
true
;
return
null
;
}
return
w
.
parent
;
}
...
...
@@ -97,34 +97,34 @@ export function hasDifferentOriginAncestor(): boolean {
* Returns the position of `childWindow` relative to `ancestorWindow`
*/
export
function
getPositionOfChildWindowRelativeToAncestorWindow
(
childWindow
:
Window
,
ancestorWindow
:
any
)
{
if
(
!
ancestorWindow
||
childWindow
===
ancestorWindow
)
{
return
{
top
:
0
,
left
:
0
};
}
var
top
=
0
,
left
=
0
;
var
windowChain
=
getSameOriginWindowChain
();
for
(
var
i
=
0
;
i
<
windowChain
.
length
;
i
++
)
{
var
windowChainEl
=
windowChain
[
i
];
if
(
windowChainEl
.
window
===
ancestorWindow
)
{
break
;
}
if
(
!
windowChainEl
.
iframeElement
)
{
break
;
}
var
boundingRect
=
windowChainEl
.
iframeElement
.
getBoundingClientRect
();
top
+=
boundingRect
.
top
;
left
+=
boundingRect
.
left
;
}
return
{
top
:
top
,
left
:
left
...
...
src/vs/base/common/collections.ts
浏览文件 @
f6e57602
...
...
@@ -94,7 +94,7 @@ export function contains<T>(from:any, what:any):boolean {
export
function
keys
<
T
>
(
from
:
IStringDictionary
<
T
>
):
IIterable
<
string
>
;
export
function
keys
<
T
>
(
from
:
INumberDictionary
<
T
>
):
IIterable
<
number
>
;
export
function
keys
<
T
>
(
from
:
any
):
IIterable
<
any
>
{
return
{
every
:
function
(
callback
:(
element
:
any
)
=>
boolean
):
boolean
{
for
(
var
key
in
from
)
{
...
...
@@ -174,7 +174,7 @@ export function groupBy<T>(data: T[], groupFn: (element: T) => string): IStringD
* compatible with the JavaScript array.
*/
export
interface
IIterable
<
E
>
{
/**
* Iterates over every element in the array
* as long as the callback does not return some
...
...
@@ -273,33 +273,33 @@ interface ICacheRow<T> {
* removes the older elements as new ones are inserted.
*/
export
class
LimitedSizeCache
<
T
>
{
private
cache
:
{
[
id
:
string
]:
ICacheRow
<
T
>
};
private
order
:
string
[];
constructor
(
private
size
:
number
)
{
this
.
cache
=
Object
.
create
(
null
);
this
.
order
=
[];
}
public
get
(
id
:
string
):
T
{
var
result
=
this
.
cache
[
id
];
return
result
&&
result
.
element
;
}
public
put
(
id
:
string
,
element
:
T
,
onRemove
:
()
=>
void
):
void
{
var
existing
=
this
.
cache
[
id
];
var
row
:
ICacheRow
<
T
>
=
{
element
:
element
,
onRemove
:
onRemove
};
this
.
cache
[
id
]
=
row
;
if
(
!
existing
)
{
this
.
order
.
push
(
id
);
}
this
.
swipe
();
}
private
swipe
():
void
{
while
(
this
.
order
.
length
>
this
.
size
)
{
var
id
=
this
.
order
.
shift
();
...
...
src/vs/base/common/graph.ts
浏览文件 @
f6e57602
...
...
@@ -22,13 +22,13 @@ export function newNode<T>(data:T):Node<T> {
}
export
class
Graph
<
T
>
{
private
_nodes
:{[
key
:
string
]:
Node
<
T
>
}
=
Object
.
create
(
null
);
constructor
(
private
_hashFn
:(
element
:
T
)
=>
string
)
{
// empty
}
public
roots
():
Node
<
T
>
[]
{
var
ret
:
Node
<
T
>
[]
=
[];
collections
.
forEach
(
this
.
_nodes
,
entry
=>
{
...
...
@@ -38,7 +38,7 @@ export class Graph<T> {
});
return
ret
;
}
public
traverse
(
start
:
T
,
inwards
:
boolean
,
callback
:(
data
:
T
)
=>
void
):
void
{
var
startNode
=
this
.
lookup
(
start
);
if
(
!
startNode
)
{
...
...
@@ -46,7 +46,7 @@ export class Graph<T> {
}
this
.
_traverse
(
startNode
,
inwards
,
{},
callback
);
}
private
_traverse
(
node
:
Node
<
T
>
,
inwards
:
boolean
,
seen
:{[
key
:
string
]:
boolean
},
callback
:(
data
:
T
)
=>
void
):
void
{
var
key
=
this
.
_hashFn
(
node
.
data
);
if
(
collections
.
contains
(
seen
,
key
))
{
...
...
@@ -57,15 +57,15 @@ export class Graph<T> {
var
nodes
=
inwards
?
node
.
outgoing
:
node
.
incoming
;
collections
.
forEach
(
nodes
,
(
entry
)
=>
this
.
_traverse
(
entry
.
value
,
inwards
,
seen
,
callback
));
}
public
insertEdge
(
from
:
T
,
to
:
T
):
void
{
var
fromNode
=
this
.
lookupOrInsertNode
(
from
),
toNode
=
this
.
lookupOrInsertNode
(
to
);
fromNode
.
outgoing
[
this
.
_hashFn
(
to
)]
=
toNode
;
toNode
.
incoming
[
this
.
_hashFn
(
from
)]
=
fromNode
;
}
public
removeNode
(
data
:
T
):
void
{
var
key
=
this
.
_hashFn
(
data
);
delete
this
.
_nodes
[
key
];
...
...
@@ -74,23 +74,23 @@ export class Graph<T> {
delete
entry
.
value
.
incoming
[
key
];
});
}
public
lookupOrInsertNode
(
data
:
T
):
Node
<
T
>
{
var
key
=
this
.
_hashFn
(
data
),
node
=
collections
.
lookup
(
this
.
_nodes
,
key
);
if
(
!
node
)
{
node
=
newNode
(
data
);
this
.
_nodes
[
key
]
=
node
;
}
return
node
;
}
public
lookup
(
data
:
T
):
Node
<
T
>
{
return
collections
.
lookup
(
this
.
_nodes
,
this
.
_hashFn
(
data
));
}
public
get
length
():
number
{
return
Object
.
keys
(
this
.
_nodes
).
length
;
}
...
...
src/vs/base/common/injector.ts
浏览文件 @
f6e57602
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
Assert
=
require
(
'
vs/base/common/assert
'
);
import
Types
=
require
(
'
vs/base/common/types
'
);
...
...
@@ -11,32 +11,32 @@ var inject = 'inject';
var
injectLen
=
inject
.
length
;
export
class
Container
{
private
map
:{[
name
:
string
]:
any
;};
private
parent
:
Container
;
constructor
()
{
this
.
map
=
{};
this
.
parent
=
null
;
}
public
setParent
(
parent
:
Container
):
void
{
this
.
parent
=
parent
;
}
public
registerService
(
target
:
string
,
service
:
any
):
any
{
Assert
.
ok
(
!
Types
.
isUndefinedOrNull
(
target
));
Assert
.
ok
(
!
Types
.
isUndefinedOrNull
(
service
));
this
.
map
[
target
.
toLowerCase
()]
=
service
;
return
service
;
}
// injects the denoted services to the target
public
injectTo
(
target
:
any
):
boolean
{
Assert
.
ok
(
!
Types
.
isUndefinedOrNull
(
target
));
// Support arrays
var
didInjectAtLeastOnce
=
false
;
if
(
Types
.
isArray
(
target
))
{
...
...
@@ -45,48 +45,48 @@ export class Container {
});
return
didInjectAtLeastOnce
;
}
// inject services one by one
for
(
var
key
in
target
)
{
if
(
key
.
indexOf
(
inject
)
!==
0
)
{
continue
;
}
var
element
=
target
[
key
];
if
(
!
Types
.
isFunction
(
element
))
{
continue
;
}
key
=
key
.
substring
(
injectLen
).
toLowerCase
();
var
service
=
this
.
findService
(
key
,
target
);
if
(
Types
.
isUndefinedOrNull
(
service
))
{
continue
;
}
// call inject function
element
.
apply
(
target
,
[
service
]);
didInjectAtLeastOnce
=
true
;
}
return
didInjectAtLeastOnce
;
}
public
createChild
():
Container
{
var
childContainer
=
new
Container
();
childContainer
.
setParent
(
this
);
return
childContainer
;
}
public
findService
(
key
:
string
,
target
:
any
=
null
):
any
{
var
result
=
this
.
map
[
key
];
if
((
Types
.
isUndefinedOrNull
(
result
)
||
target
===
result
)
&&
this
.
parent
!==
null
)
{
result
=
this
.
parent
.
findService
(
key
,
target
);
}
return
result
;
}
public
dispose
():
void
{
this
.
map
=
null
;
this
.
parent
=
null
;
...
...
src/vs/base/common/remote.ts
浏览文件 @
f6e57602
...
...
@@ -51,63 +51,63 @@ export interface ISerializedProxy {
}
export
class
ProxiesMarshallingContribution
implements
marshalling
.
IMarshallingContribution
{
private
_remoteCom
:
IProxyHelper
;
constructor
(
remoteCom
:
IProxyHelper
)
{
this
.
_remoteCom
=
remoteCom
;
}
public
canSerialize
(
obj
:
any
):
boolean
{
return
(
typeof
obj
.
$__CREATE__PROXY__REQUEST
===
'
string
'
);
}
public
serialize
(
obj
:
any
,
serialize
:(
obj
:
any
)
=>
any
):
ISerializedProxy
{
var
desc
:
IObjDescriptor
=
{
methods
:
[],
props
:
<
any
>
{}
};
var
keys
=
Object
.
keys
(
obj
);
for
(
var
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
var
key
=
keys
[
i
];
if
(
typeof
obj
[
key
]
===
'
function
'
)
{
desc
.
methods
.
push
(
key
);
}
else
{
desc
.
props
[
key
]
=
serialize
(
obj
[
key
]);
}
}
return
{
$isProxyDescriptor
:
true
,
proxyId
:
obj
.
$__CREATE__PROXY__REQUEST
,
desc
:
desc
};
}
public
canDeserialize
(
obj
:
ISerializedProxy
):
boolean
{
return
obj
.
$isProxyDescriptor
===
true
;
}
public
deserialize
(
obj
:
ISerializedProxy
,
deserialize
:(
obj
:
any
)
=>
any
):
any
{
// this is an object
var
result
:
any
=
{
$__IS_REMOTE_OBJ
:
true
};
var
methods
=
obj
.
desc
.
methods
;
for
(
var
i
=
0
;
i
<
methods
.
length
;
i
++
)
{
result
[
methods
[
i
]]
=
createMethodProxy
(
this
.
_remoteCom
,
obj
.
proxyId
,
methods
[
i
]);
}
var
props
=
obj
.
desc
.
props
;
for
(
var
prop
in
props
)
{
if
(
hasOwnProperty
.
call
(
props
,
prop
))
{
result
[
prop
]
=
deserialize
(
props
[
prop
]);
}
}
return
result
;
}
}
\ No newline at end of file
src/vs/base/common/worker/workerProtocol.ts
浏览文件 @
f6e57602
...
...
@@ -77,15 +77,15 @@ export interface IRequester {
}
export
class
RemoteCom
implements
remote
.
IRemoteCom
{
private
_requester
:
IRequester
;
private
_bigHandler
:
remote
.
IManyHandler
;
constructor
(
requester
:
IRequester
)
{
this
.
_requester
=
requester
;
this
.
_bigHandler
=
null
;
}
public
callOnRemote
(
proxyId
:
string
,
path
:
string
,
args
:
any
[]):
winjs
.
Promise
{
return
this
.
_requester
.
request
(
'
_proxyObj
'
,
{
proxyId
:
proxyId
,
...
...
@@ -93,18 +93,18 @@ export class RemoteCom implements remote.IRemoteCom {
args
:
args
});
}
public
registerBigHandler
(
handler
:
remote
.
IManyHandler
):
void
{
this
.
_bigHandler
=
handler
;
}
public
handleMessage
(
msg
:
{
proxyId
:
string
;
path
:
string
;
args
:
any
[];
}):
winjs
.
Promise
{
if
(
!
this
.
_bigHandler
)
{
throw
new
Error
(
'
got message before big handler attached!
'
);
}
return
this
.
_invokeHandler
(
msg
.
proxyId
,
msg
.
path
,
msg
.
args
);
}
private
_invokeHandler
(
rpcId
:
string
,
method
:
string
,
args
:
any
[]):
winjs
.
Promise
{
try
{
return
winjs
.
TPromise
.
as
(
this
.
_bigHandler
.
handle
(
rpcId
,
method
,
args
));
...
...
src/vs/editor/common/services/modeServiceImpl.ts
浏览文件 @
f6e57602
...
...
@@ -190,7 +190,7 @@ export class ModeServiceImpl implements IModeService {
var
c
,
e
;
var
promise
=
new
TPromise
((
cc
,
ee
,
pp
)
=>
{
c
=
cc
;
e
=
ee
;
});
this
.
_activationPromises
[
modeId
]
=
promise
;
this
.
_createMode
(
modeId
).
then
((
mode
)
=>
{
this
.
_instantiatedModes
[
modeId
]
=
mode
;
delete
this
.
_activationPromises
[
modeId
];
...
...
src/vs/editor/common/viewModel/prefixSumComputer.ts
浏览文件 @
f6e57602
...
...
@@ -10,22 +10,22 @@ export interface IPrefixSumIndexOfResult {
}
export
class
PrefixSumComputer
{
/**
* values[i] is the value at index i
*/
private
values
:
number
[];
/**
* prefixSum[i] = SUM(heights[j]), 0 <= j <= i
*/
private
prefixSum
:
number
[];
/**
* prefixSum[i], 0 <= i <= prefixSumValidIndex can be trusted
*/
private
prefixSumValidIndex
:
number
;
constructor
(
values
:
number
[])
{
this
.
values
=
values
;
this
.
prefixSum
=
[];
...
...
@@ -34,11 +34,11 @@ export class PrefixSumComputer {
}
this
.
prefixSumValidIndex
=
-
1
;
}
public
getCount
():
number
{
return
this
.
values
.
length
;
}
public
insertValue
(
insertIndex
:
number
,
value
:
number
):
void
{
this
.
values
.
splice
(
insertIndex
,
0
,
value
);
this
.
prefixSum
.
splice
(
insertIndex
,
0
,
0
);
...
...
@@ -46,20 +46,20 @@ export class PrefixSumComputer {
this
.
prefixSumValidIndex
=
insertIndex
-
1
;
}
}
public
insertValues
(
insertIndex
:
number
,
values
:
number
[]):
void
{
if
(
values
.
length
===
0
)
{
return
;
}
this
.
values
=
this
.
values
.
slice
(
0
,
insertIndex
).
concat
(
values
).
concat
(
this
.
values
.
slice
(
insertIndex
));
this
.
prefixSum
=
this
.
prefixSum
.
slice
(
0
,
insertIndex
).
concat
(
PrefixSumComputer
.
_zeroArray
(
values
.
length
)).
concat
(
this
.
prefixSum
.
slice
(
insertIndex
));
if
(
insertIndex
-
1
<
this
.
prefixSumValidIndex
)
{
this
.
prefixSumValidIndex
=
insertIndex
-
1
;
}
}
private
static
_zeroArray
(
count
:
number
):
number
[]
{
var
r
:
number
[]
=
new
Array
<
number
>
(
count
);
for
(
var
i
=
0
;
i
<
count
;
i
++
)
{
...
...
@@ -67,7 +67,7 @@ export class PrefixSumComputer {
}
return
r
;
}
public
changeValue
(
index
:
number
,
value
:
number
):
void
{
if
(
this
.
values
[
index
]
===
value
)
{
return
;
...
...
@@ -77,7 +77,7 @@ export class PrefixSumComputer {
this
.
prefixSumValidIndex
=
index
-
1
;
}
}
public
removeValues
(
startIndex
:
number
,
cnt
:
number
):
void
{
this
.
values
.
splice
(
startIndex
,
cnt
);
this
.
prefixSum
.
splice
(
startIndex
,
cnt
);
...
...
@@ -85,14 +85,14 @@ export class PrefixSumComputer {
this
.
prefixSumValidIndex
=
startIndex
-
1
;
}
}
public
getTotalValue
():
number
{
if
(
this
.
values
.
length
===
0
)
{
return
0
;
}
return
this
.
getAccumulatedValue
(
this
.
values
.
length
-
1
);
}
public
getAccumulatedValue
(
index
:
number
):
number
{
if
(
index
<
0
)
{
return
0
;
...
...
@@ -100,37 +100,37 @@ export class PrefixSumComputer {
if
(
index
<=
this
.
prefixSumValidIndex
)
{
return
this
.
prefixSum
[
index
];
}
var
startIndex
=
this
.
prefixSumValidIndex
+
1
;
if
(
startIndex
===
0
)
{
this
.
prefixSum
[
0
]
=
this
.
values
[
0
];
startIndex
++
;
}
if
(
index
>=
this
.
values
.
length
)
{
index
=
this
.
values
.
length
-
1
;
}
for
(
var
i
=
startIndex
;
i
<=
index
;
i
++
)
{
this
.
prefixSum
[
i
]
=
this
.
prefixSum
[
i
-
1
]
+
this
.
values
[
i
];
}
this
.
prefixSumValidIndex
=
Math
.
max
(
this
.
prefixSumValidIndex
,
index
);
return
this
.
prefixSum
[
index
];
}
public
getIndexOf
(
accumulatedValue
:
number
,
result
:
IPrefixSumIndexOfResult
):
void
{
var
low
=
0
,
high
=
this
.
values
.
length
-
1
,
mid
:
number
,
midStart
:
number
,
midStop
:
number
;
while
(
low
<=
high
)
{
mid
=
low
+
(
(
high
-
low
)
/
2
)
|
0
;
midStop
=
this
.
getAccumulatedValue
(
mid
);
midStart
=
midStop
-
this
.
values
[
mid
];
if
(
accumulatedValue
<
midStart
)
{
high
=
mid
-
1
;
}
else
if
(
accumulatedValue
>=
midStop
)
{
...
...
src/vs/editor/contrib/hover/browser/hover.css
浏览文件 @
f6e57602
...
...
@@ -18,14 +18,14 @@
-ms-animation-name
:
fadeIn
;
animation-duration
:
0.15s
;
animation-name
:
fadeIn
;
-webkit-user-select
:
text
;
-ms-user-select
:
text
;
-khtml-user-select
:
text
;
-moz-user-select
:
text
;
-o-user-select
:
text
;
user-select
:
text
;
overflow
:
hidden
;
}
...
...
src/vs/languages/css/common/parser/cssErrors.ts
浏览文件 @
f6e57602
...
...
@@ -10,7 +10,7 @@ import nodes = require('./cssNodes');
export
class
CSSIssueType
implements
nodes
.
IRule
{
id
:
string
;
message
:
string
;
public
constructor
(
id
:
string
,
message
:
string
)
{
this
.
id
=
id
;
this
.
message
=
message
;
...
...
src/vs/languages/css/common/parser/cssSymbols.ts
浏览文件 @
f6e57602
...
...
@@ -8,40 +8,40 @@ import nodes = require('./cssNodes');
import
arrays
=
require
(
'
vs/base/common/arrays
'
);
export
class
Scope
{
public
parent
:
Scope
;
public
children
:
Scope
[];
public
offset
:
number
;
public
length
:
number
;
private
symbols
:
Symbol
[];
constructor
(
offset
:
number
,
length
:
number
)
{
this
.
offset
=
offset
;
this
.
length
=
length
;
this
.
symbols
=
[];
this
.
parent
=
null
;
this
.
children
=
[];
}
public
addChild
(
scope
:
Scope
):
void
{
this
.
children
.
push
(
scope
);
scope
.
setParent
(
this
);
}
public
setParent
(
scope
:
Scope
):
void
{
this
.
parent
=
scope
;
}
public
findScope
(
offset
:
number
,
length
:
number
=
0
):
Scope
{
if
(
this
.
offset
<=
offset
&&
this
.
offset
+
this
.
length
>
offset
+
length
||
this
.
offset
===
offset
&&
this
.
length
===
length
)
{
return
this
.
findInScope
(
offset
,
length
);
}
return
null
;
}
private
findInScope
(
offset
:
number
,
length
:
number
=
0
):
Scope
{
// find the first scope child that has an offset larger than offset + length
var
end
=
offset
+
length
;
...
...
@@ -50,18 +50,18 @@ export class Scope {
// all scopes have offsets larger than our end
return
this
;
}
var
res
=
this
.
children
[
idx
-
1
];
if
(
res
.
offset
<=
offset
&&
res
.
offset
+
res
.
length
>=
offset
+
length
)
{
return
res
.
findInScope
(
offset
,
length
);
}
return
this
;
}
public
addSymbol
(
symbol
:
Symbol
):
void
{
this
.
symbols
.
push
(
symbol
);
}
public
getSymbol
(
name
:
string
,
type
:
nodes
.
ReferenceType
):
Symbol
{
for
(
var
index
=
0
;
index
<
this
.
symbols
.
length
;
index
++
)
{
var
symbol
=
this
.
symbols
[
index
];
...
...
@@ -71,14 +71,14 @@ export class Scope {
}
return
null
;
}
public
getSymbols
():
Symbol
[]
{
return
this
.
symbols
;
}
}
export
class
GlobalScope
extends
Scope
{
constructor
()
{
super
(
0
,
Number
.
MAX_VALUE
);
}
...
...
@@ -87,11 +87,11 @@ export class GlobalScope extends Scope {
export
class
Symbol
{
public
name
:
string
;
public
type
:
nodes
.
ReferenceType
;
public
node
:
nodes
.
Node
;
constructor
(
name
:
string
,
node
:
nodes
.
Node
,
type
:
nodes
.
ReferenceType
)
{
this
.
name
=
name
;
this
.
node
=
node
;
...
...
@@ -102,18 +102,18 @@ export class Symbol {
export
class
ScopeBuilder
implements
nodes
.
IVisitor
{
public
scope
:
Scope
;
constructor
(
scope
:
Scope
)
{
this
.
scope
=
scope
;
}
private
addSymbol
(
node
:
nodes
.
Node
,
name
:
string
,
type
:
nodes
.
ReferenceType
)
:
void
{
if
(
node
.
offset
!==
-
1
)
{
var
current
=
this
.
scope
.
findScope
(
node
.
offset
,
node
.
length
);
current
.
addSymbol
(
new
Symbol
(
name
,
node
,
type
));
}
}
private
addScope
(
node
:
nodes
.
Node
)
:
Scope
{
if
(
node
.
offset
!==
-
1
)
{
var
current
=
this
.
scope
.
findScope
(
node
.
offset
,
node
.
length
);
...
...
@@ -126,14 +126,14 @@ export class ScopeBuilder implements nodes.IVisitor {
}
return
null
;
}
private
addSymbolToChildScope
(
scopeNode
:
nodes
.
Node
,
node
:
nodes
.
Node
,
name
:
string
,
type
:
nodes
.
ReferenceType
):
void
{
if
(
scopeNode
&&
scopeNode
.
offset
!==
-
1
)
{
var
current
=
this
.
addScope
(
scopeNode
);
// create the scope or gets the existing one
current
.
addSymbol
(
new
Symbol
(
name
,
node
,
type
));
}
}
public
visitNode
(
node
:
nodes
.
Node
):
boolean
{
switch
(
node
.
type
)
{
case
nodes
.
NodeType
.
Keyframe
:
...
...
@@ -171,7 +171,7 @@ export class ScopeBuilder implements nodes.IVisitor {
}
return
true
;
}
public
visitRuleSet
(
node
:
nodes
.
RuleSet
):
boolean
{
var
current
=
this
.
scope
.
findScope
(
node
.
offset
,
node
.
length
);
node
.
getSelectors
().
getChildren
().
forEach
((
node
)
=>
{
...
...
@@ -187,14 +187,14 @@ export class ScopeBuilder implements nodes.IVisitor {
export
class
Symbols
{
private
global
:
Scope
;
constructor
(
node
:
nodes
.
Node
)
{
this
.
global
=
new
GlobalScope
();
node
.
accept
(
new
ScopeBuilder
(
this
.
global
));
}
public
findSymbolsAtOffset
(
offset
:
number
,
referenceType
:
nodes
.
ReferenceType
)
:
Symbol
[]
{
var
scope
=
this
.
global
.
findScope
(
offset
,
0
);
var
result
:
Symbol
[]
=
[];
...
...
@@ -212,7 +212,7 @@ export class Symbols {
}
return
result
;
}
private
internalFindSymbol
(
node
:
nodes
.
Node
,
referenceTypes
:
nodes
.
ReferenceType
[]):
Symbol
{
var
scopeNode
=
node
;
if
(
node
.
parent
instanceof
nodes
.
FunctionParameter
&&
node
.
parent
.
getParent
()
instanceof
nodes
.
BodyDeclaration
)
{
...
...
@@ -244,7 +244,7 @@ export class Symbols {
}
return
null
;
}
private
evaluateReferenceTypes
(
node
:
nodes
.
Node
)
:
nodes
.
ReferenceType
[]
{
if
(
node
instanceof
nodes
.
Identifier
)
{
var
referenceTypes
=
(
<
nodes
.
Identifier
>
node
).
referenceTypes
;
...
...
@@ -274,7 +274,7 @@ export class Symbols {
}
return
null
;
}
public
findSymbolFromNode
(
node
:
nodes
.
Node
):
Symbol
{
if
(
!
node
)
{
return
null
;
...
...
@@ -282,14 +282,14 @@ export class Symbols {
while
(
node
.
type
===
nodes
.
NodeType
.
Interpolation
)
{
node
=
node
.
getParent
();
}
var
referenceTypes
=
this
.
evaluateReferenceTypes
(
node
);
if
(
referenceTypes
)
{
return
this
.
internalFindSymbol
(
node
,
referenceTypes
);
}
return
null
;
}
public
matchesSymbol
(
node
:
nodes
.
Node
,
symbol
:
Symbol
):
boolean
{
if
(
!
node
)
{
return
null
;
...
...
@@ -300,17 +300,17 @@ export class Symbols {
if
(
symbol
.
name
.
length
!==
node
.
length
||
symbol
.
name
!==
node
.
getText
())
{
return
false
;
}
var
referenceTypes
=
this
.
evaluateReferenceTypes
(
node
);
if
(
!
referenceTypes
||
referenceTypes
.
indexOf
(
symbol
.
type
)
===
-
1
)
{
return
false
;
}
var
nodeSymbol
=
this
.
internalFindSymbol
(
node
,
referenceTypes
);
return
nodeSymbol
===
symbol
;
}
public
findSymbol
(
name
:
string
,
type
:
nodes
.
ReferenceType
,
offset
:
number
):
Symbol
{
var
scope
=
this
.
global
.
findScope
(
offset
);
while
(
scope
)
{
...
...
src/vs/languages/css/common/services/browsers.js
浏览文件 @
f6e57602
...
...
@@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// file generated from css-schema.xml using css-exclude_generate_browserjs.js
define
([
"
require
"
,
"
exports
"
],
function
(
require
,
exports
)
{
...
...
src/vs/languages/typescript/common/typescript.ts
浏览文件 @
f6e57602
...
...
@@ -64,7 +64,7 @@ export class DefaultProjectResolver implements IProjectResolver2 {
files
:
[],
options
:
undefined
};
setConsumer
(
consumer
:
IProjectConsumer
)
{
this
.
_consumer
=
consumer
;
}
...
...
@@ -91,7 +91,7 @@ export class DefaultProjectResolver implements IProjectResolver2 {
let
resource
=
filePath
?
URI
.
file
(
filePath
)
:
URI
.
create
(
'
extralib
'
,
undefined
,
Date
.
now
().
toString
());
this
.
_needsProjectUpdate
=
true
;
this
.
_projectChange
.
files
.
push
(
resource
);
this
.
_fileChanges
.
push
({
kind
:
ChangeKind
.
Added
,
resource
,
content
});
...
...
src/vs/platform/plugins/common/ipcRemoteCom.ts
浏览文件 @
f6e57602
...
...
@@ -23,7 +23,7 @@ var pendingRPCReplies: { [msgId: string]: IRPCReply; } = {};
function
createRPC
(
serializeAndSend
:(
obj
:
any
)
=>
void
):
IRPCFunc
{
var
lastMessageId
=
0
;
return
function
rpc
(
rpcId
:
string
,
method
:
string
,
args
:
any
[]):
winjs
.
TPromise
<
any
>
{
var
req
=
String
(
++
lastMessageId
);
var
reply
:
IRPCReply
=
{
...
...
@@ -61,7 +61,7 @@ export function create(send:(obj:string)=>void): IPluginsIPC {
var
rpc
=
createRPC
(
serializeAndSend
);
var
bigHandler
:
remote
.
IManyHandler
=
null
;
var
invokedHandlers
:
{
[
req
:
string
]:
winjs
.
TPromise
<
any
>
;
}
=
Object
.
create
(
null
);
var
r
:
IPluginsIPC
=
{
callOnRemote
:
rpc
,
registerBigHandler
:
(
_bigHandler
:
remote
.
IManyHandler
):
void
=>
{
...
...
@@ -69,7 +69,7 @@ export function create(send:(obj:string)=>void): IPluginsIPC {
},
handle
:
(
rawmsg
)
=>
{
var
msg
=
marshalling
.
demarshallObject
(
rawmsg
,
proxiesMarshalling
);
if
(
msg
.
seq
)
{
if
(
!
pendingRPCReplies
.
hasOwnProperty
(
msg
.
seq
))
{
console
.
warn
(
'
Got reply to unknown seq
'
);
...
...
@@ -93,22 +93,22 @@ export function create(send:(obj:string)=>void): IPluginsIPC {
}
return
;
}
if
(
msg
.
err
)
{
console
.
error
(
msg
.
err
);
return
;
}
var
rpcId
=
msg
.
rpcId
;
if
(
!
bigHandler
)
{
throw
new
Error
(
'
got message before big handler attached!
'
);
}
var
req
=
msg
.
req
;
invokedHandlers
[
req
]
=
invokeHandler
(
rpcId
,
msg
.
method
,
msg
.
args
);
invokedHandlers
[
req
].
then
((
r
)
=>
{
delete
invokedHandlers
[
req
];
serializeAndSend
({
...
...
@@ -124,13 +124,13 @@ export function create(send:(obj:string)=>void): IPluginsIPC {
});
}
};
var
proxiesMarshalling
=
new
remote
.
ProxiesMarshallingContribution
(
r
);
function
serializeAndSend
(
msg
:
any
):
void
{
send
(
marshalling
.
marshallObject
(
msg
,
proxiesMarshalling
));
}
function
invokeHandler
(
rpcId
:
string
,
method
:
string
,
args
:
any
[]):
winjs
.
TPromise
<
any
>
{
try
{
return
winjs
.
TPromise
.
as
(
bigHandler
.
handle
(
rpcId
,
method
,
args
));
...
...
@@ -138,7 +138,7 @@ export function create(send:(obj:string)=>void): IPluginsIPC {
return
winjs
.
TPromise
.
wrapError
(
err
);
}
}
return
r
;
};
src/vs/workbench/parts/output/browser/outputActions.ts
浏览文件 @
f6e57602
...
...
@@ -191,7 +191,7 @@ export class SwitchOutputActionItem extends SelectActionItem {
super
(
null
,
action
,
SwitchOutputActionItem
.
getChannels
(
outputService
,
input
),
SwitchOutputActionItem
.
getChannels
(
outputService
,
input
).
indexOf
(
input
.
getChannel
()));
this
.
input
=
input
;
this
.
outputService
.
onOutputChannel
.
add
(
this
.
onOutputChannel
,
this
);
}
...
...
src/vs/workbench/parts/telemetry/test/node/appInsightsTelemetryAppender.test.ts
浏览文件 @
f6e57602
...
...
@@ -159,7 +159,7 @@ suite('Telemetry - AppInsightsTelemetryAppender', () => {
assert
.
equal
(
appInsightsMock
.
events
.
length
,
2
);
assert
.
equal
(
appInsightsMock
.
events
[
0
].
eventName
,
NodeAppInsightsTelemetryAppender
.
EVENT_NAME_PREFIX
+
'
testEvent
'
);
// test vortex
assert
.
equal
(
appInsightsMock
.
events
[
1
].
eventName
,
NodeAppInsightsTelemetryAppender
.
EVENT_NAME_PREFIX
+
'
testEvent
'
);
});
...
...
src/vs/workbench/services/files/test/node/fileService.test.ts
浏览文件 @
f6e57602
...
...
@@ -58,7 +58,7 @@ suite('FileService', () => {
test
(
'
createFile
'
,
function
(
done
:
()
=>
void
)
{
this
.
timeout
(
10000
);
// test tends to need longer?
let
contents
=
'
Hello World
'
;
service
.
createFile
(
uri
.
file
(
path
.
join
(
testDir
,
'
test.txt
'
)),
contents
).
done
(
s
=>
{
assert
.
equal
(
s
.
name
,
'
test.txt
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录