Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
fa056757
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,发现更多精彩内容 >>
提交
fa056757
编写于
11月 26, 2015
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
差异文件
merge with 'master'
上级
f192e04e
f38e086b
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
283 addition
and
274 deletion
+283
-274
scripts/code.bat
scripts/code.bat
+3
-0
scripts/code.sh
scripts/code.sh
+3
-0
src/vs/base/browser/browser.ts
src/vs/base/browser/browser.ts
+0
-1
src/vs/base/browser/dom.ts
src/vs/base/browser/dom.ts
+0
-19
src/vs/base/common/flags.ts
src/vs/base/common/flags.ts
+1
-10
src/vs/base/common/uri.ts
src/vs/base/common/uri.ts
+1
-1
src/vs/nls.js
src/vs/nls.js
+1
-1
src/vs/workbench/browser/workbench.ts
src/vs/workbench/browser/workbench.ts
+4
-21
src/vs/workbench/electron-browser/shell.ts
src/vs/workbench/electron-browser/shell.ts
+110
-79
src/vs/workbench/electron-main/lifecycle.ts
src/vs/workbench/electron-main/lifecycle.ts
+1
-1
src/vs/workbench/electron-main/menus.ts
src/vs/workbench/electron-main/menus.ts
+3
-4
src/vs/workbench/electron-main/window.ts
src/vs/workbench/electron-main/window.ts
+12
-2
src/vs/workbench/electron-main/windows.ts
src/vs/workbench/electron-main/windows.ts
+10
-12
src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts
...kbench/parts/debug/electron-browser/debug.contribution.ts
+1
-7
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+86
-1
src/vs/workbench/parts/debug/electron-browser/extensionOutput.ts
...workbench/parts/debug/electron-browser/extensionOutput.ts
+0
-115
src/vs/workbench/parts/debug/test/common/replHistory.test.ts
src/vs/workbench/parts/debug/test/common/replHistory.test.ts
+47
-0
未找到文件。
scripts/code.bat
浏览文件 @
fa056757
...
...
@@ -9,6 +9,9 @@ if not exist node_modules call .\scripts\npm.bat install
:: Get electron
node
.\node_modules\gulp\bin\gulp.js
electron
:: Build
if
not
exist
out
node
.\node_modules\gulp\bin\gulp.js
compile
:: Configuration
set
NODE_ENV
=
development
set
VSCODE_DEV
=
1
...
...
scripts/code.sh
浏览文件 @
fa056757
...
...
@@ -16,6 +16,9 @@ function code() {
# Get electron
node node_modules/gulp/bin/gulp.js electron
# Build
test
-d
out
||
gulp compile
# Configuration
export
NODE_ENV
=
development
export
VSCODE_DEV
=
1
...
...
src/vs/base/browser/browser.ts
浏览文件 @
fa056757
...
...
@@ -55,7 +55,6 @@ var globals = <IGlobalScope><any> (typeof self === 'object' ? self : global);
var
userAgent
=
globals
.
navigator
?
globals
.
navigator
.
userAgent
:
''
;
var
isTest
=
!!
globals
.
isTest
;
var
isPseudo
=
globals
.
document
&&
globals
.
document
.
URL
.
match
(
/
[^\?]
*
\?[^\#]
*pseudo=true/
);
// DOCUMENTED FOR FUTURE REFERENCE:
// When running IE11 in IE10 document mode, the code below will identify the browser as being IE10,
...
...
src/vs/base/browser/dom.ts
浏览文件 @
fa056757
...
...
@@ -1046,25 +1046,6 @@ export function removeScriptTags(html:string):string {
return
div
.
innerHTML
;
};
export
function
parseSearch
():{[
key
:
string
]:
string
}
{
var
result
:{[
key
:
string
]:
string
}
=
{};
var
search
=
window
.
location
.
search
;
if
(
search
)
{
var
params
=
search
.
split
(
/
[
?&
]
/
);
for
(
var
i
=
0
;
i
<
params
.
length
;
i
++
)
{
var
param
=
params
[
i
];
if
(
param
)
{
var
keyValue
=
param
.
split
(
'
=
'
);
if
(
keyValue
.
length
===
2
)
{
result
[
keyValue
[
0
]]
=
decodeURIComponent
(
keyValue
[
1
]);
}
}
}
}
return
result
;
}
export
function
append
<
T
extends
Node
>
(
parent
:
HTMLElement
,
child
:
T
):
T
{
parent
.
appendChild
(
child
);
return
child
;
...
...
src/vs/base/common/flags.ts
浏览文件 @
fa056757
...
...
@@ -6,16 +6,7 @@
import
{
globals
}
from
'
vs/base/common/platform
'
;
function
getWorkersCount
():
number
{
var
defaultValue
=
2
;
var
url_matches
=
(
globals
.
location
?
globals
.
location
.
search
:
''
).
match
(
/monaco-workers=
(\d
+
)
/i
);
if
(
url_matches
)
{
defaultValue
=
parseInt
(
url_matches
[
1
],
10
);
}
return
environment
(
'
workersCount
'
,
defaultValue
);
}
export
const
workersCount
=
getWorkersCount
();
export
const
workersCount
=
environment
(
'
workersCount
'
,
2
);
export
const
enableTasks
=
environment
(
'
enableTasks
'
);
export
const
enableSendASmile
=
environment
(
'
enableSendASmile
'
);
export
const
enableJavaScriptRewriting
=
environment
(
'
enableJavaScriptRewriting
'
);
...
...
src/vs/base/common/uri.ts
浏览文件 @
fa056757
...
...
@@ -174,7 +174,7 @@ export default class URI {
var
ret
=
URI
.
_parse
(
path
);
if
(
ret
.
scheme
||
ret
.
fragment
||
ret
.
query
)
{
throw
new
Error
();
throw
new
Error
(
`Path
${
path
}
contains a scheme, fragment or a query. Can not convert it to a file uri.`
);
}
ret
=
ret
.
with
(
'
file
'
,
undefined
,
...
...
src/vs/nls.js
浏览文件 @
fa056757
...
...
@@ -22,7 +22,7 @@ var NLSLoaderPlugin;
var
global
=
_nlsPluginGlobal
;
var
Resources
=
global
.
Plugin
&&
global
.
Plugin
.
Resources
?
global
.
Plugin
.
Resources
:
undefined
;
var
DEFAULT_TAG
=
'
i-default
'
;
var
IS_PSEUDO
=
(
global
&&
global
.
document
&&
global
.
document
.
URL
.
match
(
/
[^\?]
*
\?[^\#]
*pseudo=true/
)
);
var
IS_PSEUDO
=
(
global
&&
global
.
document
&&
global
.
document
.
location
&&
global
.
document
.
location
.
hash
.
indexOf
(
'
pseudo=true
'
)
>=
0
);
var
slice
=
Array
.
prototype
.
slice
;
function
_format
(
message
,
args
)
{
var
result
;
...
...
src/vs/workbench/browser/workbench.ts
浏览文件 @
fa056757
...
...
@@ -34,7 +34,6 @@ import {WorkbenchLayout, LayoutOptions} from 'vs/workbench/browser/layout';
import
{
IActionBarRegistry
,
Extensions
as
ActionBarExtensions
}
from
'
vs/workbench/browser/actionBarRegistry
'
;
import
{
IViewletRegistry
,
Extensions
as
ViewletExtensions
}
from
'
vs/workbench/browser/viewlet
'
;
import
{
QuickOpenController
}
from
'
vs/workbench/browser/parts/quickopen/quickOpenController
'
;
import
{
WorkspaceStats
}
from
'
vs/platform/telemetry/common/workspaceStats
'
;
import
{
getServices
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
AbstractKeybindingService
}
from
'
vs/platform/keybinding/browser/keybindingServiceImpl
'
;
import
{
UntitledEditorService
,
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/browser/untitledEditorService
'
;
...
...
@@ -71,6 +70,7 @@ interface WorkbenchParams {
export
interface
IWorkbenchCallbacks
{
onServicesCreated
?:
()
=>
void
;
onWorkbenchStarted
?:
()
=>
void
;
}
/**
...
...
@@ -247,26 +247,9 @@ export class Workbench implements IPartService {
this
.
eventService
.
emit
(
EventType
.
WORKBENCH_CREATED
);
this
.
creationPromiseComplete
(
true
);
// Log to telemetry service
let
windowSize
=
{
innerHeight
:
window
.
innerHeight
,
innerWidth
:
window
.
innerWidth
,
outerHeight
:
window
.
outerHeight
,
outerWidth
:
window
.
outerWidth
};
this
.
telemetryService
.
publicLog
(
'
workspaceLoad
'
,
{
userAgent
:
navigator
.
userAgent
,
windowSize
:
windowSize
,
autoSaveEnabled
:
this
.
contextService
.
isAutoSaveEnabled
&&
this
.
contextService
.
isAutoSaveEnabled
(),
emptyWorkbench
:
!
this
.
contextService
.
getWorkspace
(),
customKeybindingsCount
:
this
.
keybindingService
.
customKeybindingsCount
(),
theme
:
this
.
currentTheme
});
let
workspaceStats
:
WorkspaceStats
=
<
WorkspaceStats
>
this
.
instantiationService
.
createInstance
(
WorkspaceStats
);
workspaceStats
.
reportWorkspaceTags
();
if
(
this
.
callbacks
&&
this
.
callbacks
.
onWorkbenchStarted
)
{
this
.
callbacks
.
onWorkbenchStarted
();
}
},
errors
.
onUnexpectedError
);
}
catch
(
error
)
{
...
...
src/vs/workbench/electron-browser/shell.ts
浏览文件 @
fa056757
...
...
@@ -14,7 +14,7 @@ import 'vs/css!vs/workbench/browser/media/vs-theme';
import
'
vs/css!vs/workbench/browser/media/vs-dark-theme
'
;
import
'
vs/css!vs/workbench/browser/media/hc-black-theme
'
;
import
{
Promise
,
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Promise
,
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Dimension
,
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
env
=
require
(
'
vs/base/common/flags
'
);
...
...
@@ -32,6 +32,7 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
import
{
ElectronTelemetryService
}
from
'
vs/platform/telemetry/electron-browser/electronTelemetryService
'
;
import
{
ElectronIntegration
}
from
'
vs/workbench/electron-browser/integration
'
;
import
{
Update
}
from
'
vs/workbench/electron-browser/update
'
;
import
{
WorkspaceStats
}
from
'
vs/platform/telemetry/common/workspaceStats
'
;
import
{
IWindowService
,
WindowService
}
from
'
vs/workbench/services/window/electron-browser/windowService
'
;
import
{
MessageService
}
from
'
vs/workbench/services/message/electron-browser/messageService
'
;
import
{
RequestService
}
from
'
vs/workbench/services/request/node/requestService
'
;
...
...
@@ -146,7 +147,7 @@ export function getDelayedService<TService>(clientPromise: TPromise<Client>, ser
return
servicePromise
().
then
(
service
=>
service
[
key
](...
args
));
}
});
},
<
TService
>
{});
},
<
TService
>
{});
}
/**
...
...
@@ -154,12 +155,15 @@ export function getDelayedService<TService>(clientPromise: TPromise<Client>, ser
* With the Shell being the top level element in the page, it is also responsible for driving the layouting.
*/
export
class
WorkbenchShell
{
private
storageService
Instance
:
IStorageService
;
private
messageService
Instance
:
IMessageService
;
private
contextViewService
Instance
:
ContextViewService
;
private
windowService
Instance
:
IWindowService
;
private
threadService
Instance
:
MainThreadService
;
private
storageService
:
IStorageService
;
private
messageService
:
IMessageService
;
private
contextViewService
:
ContextViewService
;
private
windowService
:
IWindowService
;
private
threadService
:
MainThreadService
;
private
themeService
:
IThemeService
;
private
contextService
:
WorkspaceContextService
;
private
telemetryService
:
ElectronTelemetryService
;
private
keybindingService
:
PluginWorkbenchKeybindingService
;
private
container
:
HTMLElement
;
private
toUnbind
:
{
():
void
;
}[];
...
...
@@ -208,6 +212,9 @@ export class WorkbenchShell {
this
.
workbench
.
startup
({
onServicesCreated
:
()
=>
{
this
.
initPluginSystem
();
},
onWorkbenchStarted
:
()
=>
{
this
.
onWorkbenchStarted
();
}
});
...
...
@@ -229,88 +236,112 @@ export class WorkbenchShell {
return
workbenchContainer
;
}
private
onWorkbenchStarted
():
void
{
// Log to telemetry service
let
windowSize
=
{
innerHeight
:
window
.
innerHeight
,
innerWidth
:
window
.
innerWidth
,
outerHeight
:
window
.
outerHeight
,
outerWidth
:
window
.
outerWidth
};
this
.
telemetryService
.
publicLog
(
'
workspaceLoad
'
,
{
userAgent
:
navigator
.
userAgent
,
windowSize
:
windowSize
,
autoSaveEnabled
:
this
.
contextService
.
isAutoSaveEnabled
&&
this
.
contextService
.
isAutoSaveEnabled
(),
emptyWorkbench
:
!
this
.
contextService
.
getWorkspace
(),
customKeybindingsCount
:
this
.
keybindingService
.
customKeybindingsCount
(),
theme
:
this
.
currentTheme
});
let
workspaceStats
:
WorkspaceStats
=
<
WorkspaceStats
>
this
.
workbench
.
getInstantiationService
().
createInstance
(
WorkspaceStats
);
workspaceStats
.
reportWorkspaceTags
();
}
private
initInstantiationService
():
IInstantiationService
{
let
eventService
Instance
=
new
EventService
();
let
eventService
=
new
EventService
();
let
contextServiceInstance
=
new
WorkspaceContextService
(
eventServiceInstan
ce
,
this
.
workspace
,
this
.
configuration
,
this
.
options
);
contextServiceInstan
ce
.
getConfiguration
().
additionalWorkerServices
=
[
this
.
contextService
=
new
WorkspaceContextService
(
eventServi
ce
,
this
.
workspace
,
this
.
configuration
,
this
.
options
);
this
.
contextServi
ce
.
getConfiguration
().
additionalWorkerServices
=
[
{
serviceId
:
'
requestService
'
,
moduleName
:
'
vs/workbench/services/request/common/requestService
'
,
ctorName
:
'
WorkerRequestService
'
}
];
this
.
windowService
Instance
=
new
WindowService
();
this
.
storageService
Instance
=
new
Storage
(
contextServiceInstan
ce
);
this
.
windowService
=
new
WindowService
();
this
.
storageService
=
new
Storage
(
this
.
contextServi
ce
);
// no telemetry in a window for plugin development!
let
enableTelemetry
=
this
.
configuration
.
env
.
isBuilt
&&
!
this
.
configuration
.
env
.
pluginDevelopmentPath
?
!!
this
.
configuration
.
env
.
enableTelemetry
:
false
;
let
telemetryServiceInstance
=
new
ElectronTelemetryService
(
this
.
storageServiceInstan
ce
,
{
enableTelemetry
:
enableTelemetry
,
version
:
this
.
configuration
.
env
.
version
,
commitHash
:
this
.
configuration
.
env
.
commitHash
});
this
.
telemetryService
=
new
ElectronTelemetryService
(
this
.
storageServi
ce
,
{
enableTelemetry
:
enableTelemetry
,
version
:
this
.
configuration
.
env
.
version
,
commitHash
:
this
.
configuration
.
env
.
commitHash
});
let
keybindingServiceInstance
=
new
PluginWorkbenchKeybindingService
(
contextServiceInstance
,
eventServiceInstance
,
telemetryServiceInstan
ce
,
<
any
>
window
);
this
.
keybindingService
=
new
PluginWorkbenchKeybindingService
(
this
.
contextService
,
eventService
,
this
.
telemetryServi
ce
,
<
any
>
window
);
this
.
messageService
Instance
=
new
MessageService
(
contextServiceInstance
,
this
.
windowServiceInstance
,
telemetryServiceInstance
,
keybindingServiceInstan
ce
);
keybindingServiceInstance
.
setMessageService
(
this
.
messageServiceInstan
ce
);
this
.
messageService
=
new
MessageService
(
this
.
contextService
,
this
.
windowService
,
this
.
telemetryService
,
this
.
keybindingServi
ce
);
this
.
keybindingService
.
setMessageService
(
this
.
messageServi
ce
);
let
configService
Instance
=
new
ConfigurationService
(
contextServiceInstan
ce
,
eventService
Instance
let
configService
=
new
ConfigurationService
(
this
.
contextServi
ce
,
eventService
);
let
fileService
Instance
=
new
FileService
(
configService
Instance
,
eventService
Instance
,
contextServiceInstan
ce
let
fileService
=
new
FileService
(
configService
,
eventService
,
this
.
contextServi
ce
);
this
.
contextViewService
Instance
=
new
ContextViewService
(
this
.
container
,
telemetryServiceInstance
,
this
.
messageServiceInstan
ce
);
this
.
contextViewService
=
new
ContextViewService
(
this
.
container
,
this
.
telemetryService
,
this
.
messageServi
ce
);
let
lifecycleService
Instance
=
new
LifecycleService
(
this
.
messageServiceInstance
,
this
.
windowServiceInstan
ce
);
lifecycleService
Instance
.
onShutdown
.
add
(()
=>
fileServiceInstan
ce
.
dispose
());
let
lifecycleService
=
new
LifecycleService
(
this
.
messageService
,
this
.
windowServi
ce
);
lifecycleService
.
onShutdown
.
add
(()
=>
fileServi
ce
.
dispose
());
this
.
threadService
Instance
=
new
MainThreadService
(
contextServiceInstance
,
this
.
messageServiceInstance
,
this
.
windowServiceInstan
ce
);
lifecycleService
Instance
.
onShutdown
.
add
(()
=>
this
.
threadServiceInstan
ce
.
dispose
());
this
.
threadService
=
new
MainThreadService
(
this
.
contextService
,
this
.
messageService
,
this
.
windowServi
ce
);
lifecycleService
.
onShutdown
.
add
(()
=>
this
.
threadServi
ce
.
dispose
());
let
requestService
Instance
=
new
RequestService
(
contextServiceInstan
ce
,
configService
Instance
,
t
elemetryServiceInstan
ce
let
requestService
=
new
RequestService
(
this
.
contextServi
ce
,
configService
,
t
his
.
telemetryServi
ce
);
this
.
threadService
Instance
.
registerInstance
(
requestServiceInstan
ce
);
lifecycleService
Instance
.
onShutdown
.
add
(()
=>
requestServiceInstan
ce
.
dispose
());
this
.
threadService
.
registerInstance
(
requestServi
ce
);
lifecycleService
.
onShutdown
.
add
(()
=>
requestServi
ce
.
dispose
());
let
markerService
Instance
=
new
MarkerService
(
this
.
threadServiceInstan
ce
);
let
markerService
=
new
MarkerService
(
this
.
threadServi
ce
);
let
pluginService
=
new
MainProcessPluginService
(
contextServiceInstance
,
this
.
threadServiceInstance
,
this
.
messageServiceInstance
,
telemetryServiceInstan
ce
);
keybindingServiceInstan
ce
.
setPluginService
(
pluginService
);
let
pluginService
=
new
MainProcessPluginService
(
this
.
contextService
,
this
.
threadService
,
this
.
messageService
,
this
.
telemetryServi
ce
);
this
.
keybindingServi
ce
.
setPluginService
(
pluginService
);
let
modelService
Instance
=
new
ModelServiceImpl
(
this
.
threadServiceInstance
,
markerServiceInstan
ce
);
let
modeService
=
new
MainThreadModeServiceImpl
(
this
.
threadService
Instance
,
pluginService
,
modelServiceInstan
ce
);
let
modelService
=
new
ModelServiceImpl
(
this
.
threadService
,
markerServi
ce
);
let
modeService
=
new
MainThreadModeServiceImpl
(
this
.
threadService
,
pluginService
,
modelServi
ce
);
let
untitledEditorService
=
new
UntitledEditorService
();
this
.
themeService
=
new
ThemeService
(
pluginService
);
let
result
=
createInstantiationService
();
result
.
addSingleton
(
ITelemetryService
,
t
elemetryServiceInstan
ce
);
result
.
addSingleton
(
IEventService
,
eventService
Instance
);
result
.
addSingleton
(
IRequestService
,
requestService
Instance
);
result
.
addSingleton
(
IWorkspaceContextService
,
contextServiceInstan
ce
);
result
.
addSingleton
(
IContextViewService
,
this
.
contextViewService
Instance
);
result
.
addSingleton
(
IContextMenuService
,
new
ContextMenuService
(
this
.
messageService
Instance
,
telemetryServiceInstan
ce
));
result
.
addSingleton
(
IMessageService
,
this
.
messageService
Instance
);
result
.
addSingleton
(
IStorageService
,
this
.
storageService
Instance
);
result
.
addSingleton
(
ILifecycleService
,
lifecycleService
Instance
);
result
.
addSingleton
(
IThreadService
,
this
.
threadService
Instance
);
result
.
addSingleton
(
ITelemetryService
,
t
his
.
telemetryServi
ce
);
result
.
addSingleton
(
IEventService
,
eventService
);
result
.
addSingleton
(
IRequestService
,
requestService
);
result
.
addSingleton
(
IWorkspaceContextService
,
this
.
contextServi
ce
);
result
.
addSingleton
(
IContextViewService
,
this
.
contextViewService
);
result
.
addSingleton
(
IContextMenuService
,
new
ContextMenuService
(
this
.
messageService
,
this
.
telemetryServi
ce
));
result
.
addSingleton
(
IMessageService
,
this
.
messageService
);
result
.
addSingleton
(
IStorageService
,
this
.
storageService
);
result
.
addSingleton
(
ILifecycleService
,
lifecycleService
);
result
.
addSingleton
(
IThreadService
,
this
.
threadService
);
result
.
addSingleton
(
IPluginService
,
pluginService
);
result
.
addSingleton
(
IModeService
,
modeService
);
result
.
addSingleton
(
IFileService
,
fileService
Instance
);
result
.
addSingleton
(
IFileService
,
fileService
);
result
.
addSingleton
(
IUntitledEditorService
,
untitledEditorService
);
result
.
addSingleton
(
ISearchService
,
new
SearchService
(
modelService
Instance
,
untitledEditorService
,
contextServiceInstance
,
configServiceInstan
ce
));
result
.
addSingleton
(
IWindowService
,
this
.
windowService
Instance
);
result
.
addSingleton
(
IConfigurationService
,
configService
Instance
);
result
.
addSingleton
(
IKeybindingService
,
keybindingServiceInstan
ce
);
result
.
addSingleton
(
IMarkerService
,
markerService
Instance
);
result
.
addSingleton
(
IModelService
,
modelService
Instance
);
result
.
addSingleton
(
ISearchService
,
new
SearchService
(
modelService
,
untitledEditorService
,
this
.
contextService
,
configServi
ce
));
result
.
addSingleton
(
IWindowService
,
this
.
windowService
);
result
.
addSingleton
(
IConfigurationService
,
configService
);
result
.
addSingleton
(
IKeybindingService
,
this
.
keybindingServi
ce
);
result
.
addSingleton
(
IMarkerService
,
markerService
);
result
.
addSingleton
(
IModelService
,
modelService
);
result
.
addSingleton
(
ICodeEditorService
,
new
CodeEditorServiceImpl
());
result
.
addSingleton
(
IThemeService
,
this
.
themeService
);
result
.
addSingleton
(
IActionsService
,
new
ActionsService
(
pluginService
,
keybindingServiceInstan
ce
));
result
.
addSingleton
(
IActionsService
,
new
ActionsService
(
pluginService
,
this
.
keybindingServi
ce
));
return
result
;
...
...
@@ -318,24 +349,24 @@ export class WorkbenchShell {
// TODO@Alex, TODO@Joh move this out of here?
private
initPluginSystem
():
void
{
this
.
threadService
Instance
.
getRemotable
(
MainProcessVSCodeAPIHelper
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadDocuments
);
this
.
threadService
Instance
.
getRemotable
(
RemoteTelemetryServiceHelper
);
this
.
threadService
.
getRemotable
(
MainProcessVSCodeAPIHelper
);
this
.
threadService
.
getRemotable
(
MainThreadDocuments
);
this
.
threadService
.
getRemotable
(
RemoteTelemetryServiceHelper
);
this
.
workbench
.
getInstantiationService
().
createInstance
(
MainProcessTextMateSyntax
);
this
.
workbench
.
getInstantiationService
().
createInstance
(
MainProcessTextMateSnippet
);
this
.
workbench
.
getInstantiationService
().
createInstance
(
LanguageConfigurationFileHandler
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadConfiguration
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadQuickOpen
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadStatusBar
);
this
.
threadService
.
getRemotable
(
MainThreadConfiguration
);
this
.
threadService
.
getRemotable
(
MainThreadQuickOpen
);
this
.
threadService
.
getRemotable
(
MainThreadStatusBar
);
this
.
workbench
.
getInstantiationService
().
createInstance
(
MainThreadFileSystemEventService
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadCommands
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadOutputService
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadDiagnostics
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadMessageService
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadLanguages
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadWorkspace
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadEditors
);
this
.
threadService
Instance
.
getRemotable
(
MainThreadStorage
);
this
.
threadService
.
getRemotable
(
MainThreadCommands
);
this
.
threadService
.
getRemotable
(
MainThreadOutputService
);
this
.
threadService
.
getRemotable
(
MainThreadDiagnostics
);
this
.
threadService
.
getRemotable
(
MainThreadMessageService
);
this
.
threadService
.
getRemotable
(
MainThreadLanguages
);
this
.
threadService
.
getRemotable
(
MainThreadWorkspace
);
this
.
threadService
.
getRemotable
(
MainThreadEditors
);
this
.
threadService
.
getRemotable
(
MainThreadStorage
);
this
.
threadServiceInstance
.
getRemotable
(
MainThreadLanguageFeatures
);
}
...
...
@@ -365,15 +396,15 @@ export class WorkbenchShell {
this
.
registerListeners
();
// Enable theme support
let
themeId
=
this
.
storageService
Instance
.
get
(
Preferences
.
THEME
,
StorageScope
.
GLOBAL
,
null
);
let
themeId
=
this
.
storageService
.
get
(
Preferences
.
THEME
,
StorageScope
.
GLOBAL
,
null
);
if
(
!
themeId
)
{
themeId
=
themes
.
toId
(
themes
.
BaseTheme
.
VS_DARK
);
this
.
storageService
Instance
.
store
(
Preferences
.
THEME
,
themeId
,
StorageScope
.
GLOBAL
);
this
.
storageService
.
store
(
Preferences
.
THEME
,
themeId
,
StorageScope
.
GLOBAL
);
}
this
.
setTheme
(
themeId
,
false
);
this
.
toUnbind
.
push
(
this
.
storageService
Instance
.
addListener
(
StorageEventType
.
STORAGE
,
(
e
:
StorageEvent
)
=>
{
this
.
toUnbind
.
push
(
this
.
storageService
.
addListener
(
StorageEventType
.
STORAGE
,
(
e
:
StorageEvent
)
=>
{
if
(
e
.
key
===
Preferences
.
THEME
)
{
this
.
setTheme
(
e
.
newValue
);
}
...
...
@@ -487,8 +518,8 @@ export class WorkbenchShell {
console
.
error
(
errorMsg
);
// Show to user if friendly message provided
if
(
error
.
friendlyMessage
&&
this
.
messageService
Instance
)
{
this
.
messageService
Instance
.
show
(
Severity
.
Error
,
error
.
friendlyMessage
);
if
(
error
.
friendlyMessage
&&
this
.
messageService
)
{
this
.
messageService
.
show
(
Severity
.
Error
,
error
.
friendlyMessage
);
}
}
...
...
@@ -498,7 +529,7 @@ export class WorkbenchShell {
let
contentsSize
=
new
Dimension
(
clArea
.
width
,
clArea
.
height
);
this
.
contentsContainer
.
size
(
contentsSize
.
width
,
contentsSize
.
height
);
this
.
contextViewService
Instance
.
layout
();
this
.
contextViewService
.
layout
();
this
.
workbench
.
layout
();
}
...
...
@@ -518,8 +549,8 @@ export class WorkbenchShell {
}
}
this
.
contextViewService
Instance
.
dispose
();
this
.
storageService
Instance
.
dispose
();
this
.
contextViewService
.
dispose
();
this
.
storageService
.
dispose
();
// Listeners
while
(
this
.
toUnbind
.
length
)
{
...
...
src/vs/workbench/electron-main/lifecycle.ts
浏览文件 @
fa056757
...
...
@@ -133,7 +133,7 @@ export class Lifecycle {
c
(
true
);
// veto
});
vscodeWindow
.
win
.
webContents
.
send
(
'
vscode:beforeUnload
'
,
{
okChannel
:
oneTimeOkEvent
,
cancelChannel
:
oneTimeCancelEvent
});
vscodeWindow
.
send
(
'
vscode:beforeUnload
'
,
{
okChannel
:
oneTimeOkEvent
,
cancelChannel
:
oneTimeCancelEvent
});
});
}
...
...
src/vs/workbench/electron-main/menus.ts
浏览文件 @
fa056757
...
...
@@ -37,7 +37,6 @@ export class VSCodeMenu {
private
static
lastKnownKeybindingsMapStorageKey
=
'
lastKnownKeybindings
'
;
private
static
MAX_RECENT_ENTRIES
=
10
;
private
static
AUTO_SAVE_DELAY_DEFAULT
=
1000
;
// in ms
private
static
AUTO_SAVE_DISABLED
=
-
1
;
...
...
@@ -119,7 +118,7 @@ export class VSCodeMenu {
// Resolve keybindings when workbench window is up
if
(
this
.
actionIdKeybindingRequests
.
length
)
{
win
.
win
.
webContents
.
send
(
'
vscode:resolveKeybindings
'
,
JSON
.
stringify
(
this
.
actionIdKeybindingRequests
));
win
.
send
(
'
vscode:resolveKeybindings
'
,
JSON
.
stringify
(
this
.
actionIdKeybindingRequests
));
}
}
...
...
@@ -423,7 +422,7 @@ export class VSCodeMenu {
// Folders
recentList
.
folders
.
forEach
((
folder
,
index
)
=>
{
if
(
index
<
VSCodeMenu
.
MAX_RECENT_ENTRIES
)
{
if
(
index
<
windows
.
WindowsManager
.
MAX_RECENT_ENTRIES
)
{
openRecentMenu
.
append
(
this
.
createOpenRecentMenuItem
(
folder
));
}
});
...
...
@@ -435,7 +434,7 @@ export class VSCodeMenu {
}
recentList
.
files
.
forEach
((
file
,
index
)
=>
{
if
(
index
<
VSCodeMenu
.
MAX_RECENT_ENTRIES
)
{
if
(
index
<
windows
.
WindowsManager
.
MAX_RECENT_ENTRIES
)
{
openRecentMenu
.
append
(
this
.
createOpenRecentMenuItem
(
file
));
}
});
...
...
src/vs/workbench/electron-main/window.ts
浏览文件 @
fa056757
...
...
@@ -294,9 +294,9 @@ export class VSCodeWindow {
// Support navigation via mouse buttons 4/5
if
(
cmd
===
'
browser-backward
'
)
{
this
.
_win
.
webContents
.
send
(
'
vscode:runAction
'
,
'
workbench.action.navigateBack
'
);
this
.
send
(
'
vscode:runAction
'
,
'
workbench.action.navigateBack
'
);
}
else
if
(
cmd
===
'
browser-forward
'
)
{
this
.
_win
.
webContents
.
send
(
'
vscode:runAction
'
,
'
workbench.action.navigateForward
'
);
this
.
send
(
'
vscode:runAction
'
,
'
workbench.action.navigateForward
'
);
}
});
...
...
@@ -532,6 +532,16 @@ export class VSCodeWindow {
this
.
win
.
setMenuBarVisibility
(
isFullScreen
);
}
public
sendWhenReady
(
channel
:
string
,
...
args
:
any
[]):
void
{
this
.
ready
().
then
(()
=>
{
this
.
send
(
channel
,
...
args
);
});
}
public
send
(
channel
:
string
,
...
args
:
any
[]):
void
{
this
.
_win
.
webContents
.
send
(
channel
,
...
args
);
}
public
dispose
():
void
{
if
(
this
.
showTimeoutHandle
)
{
clearTimeout
(
this
.
showTimeoutHandle
);
...
...
src/vs/workbench/electron-main/windows.ts
浏览文件 @
fa056757
...
...
@@ -95,8 +95,9 @@ export class WindowsManager {
public
static
autoSaveDelayStorageKey
=
'
autoSaveDelay
'
;
public
static
openedPathsListStorageKey
=
'
openedPathsList
'
;
p
rivate
static
workingDirPickerStorageKey
=
'
pickerWorkingDir
'
;
p
ublic
static
MAX_RECENT_ENTRIES
=
10
;
private
static
workingDirPickerStorageKey
=
'
pickerWorkingDir
'
;
private
static
windowsStateStorageKey
=
'
windowsState
'
;
private
static
themeStorageKey
=
'
theme
'
;
// TODO@Ben this key is only used to find out if a window can be shown instantly because of light theme, remove once we have support for bg color
...
...
@@ -390,13 +391,13 @@ export class WindowsManager {
if
(
!
openFilesInNewWindow
&&
lastActiveWindow
)
{
lastActiveWindow
.
restore
();
lastActiveWindow
.
ready
().
then
((
readyWindow
)
=>
{
readyWindow
.
win
.
webContents
.
send
(
'
vscode:openFiles
'
,
{
readyWindow
.
send
(
'
vscode:openFiles
'
,
{
filesToOpen
:
filesToOpen
,
filesToCreate
:
filesToCreate
});
if
(
extensionsToInstall
.
length
)
{
readyWindow
.
win
.
webContents
.
send
(
'
vscode:installExtensions
'
,
{
extensionsToInstall
});
readyWindow
.
send
(
'
vscode:installExtensions
'
,
{
extensionsToInstall
});
}
});
}
...
...
@@ -418,13 +419,13 @@ export class WindowsManager {
if
(
windowsOnWorkspacePath
.
length
>
0
)
{
windowsOnWorkspacePath
[
0
].
restore
();
// just focus one of them
windowsOnWorkspacePath
[
0
].
ready
().
then
((
readyWindow
)
=>
{
readyWindow
.
win
.
webContents
.
send
(
'
vscode:openFiles
'
,
{
readyWindow
.
send
(
'
vscode:openFiles
'
,
{
filesToOpen
:
filesToOpen
,
filesToCreate
:
filesToCreate
});
if
(
extensionsToInstall
.
length
)
{
readyWindow
.
win
.
webContents
.
send
(
'
vscode:installExtensions
'
,
{
extensionsToInstall
});
readyWindow
.
send
(
'
vscode:installExtensions
'
,
{
extensionsToInstall
});
}
});
...
...
@@ -567,7 +568,8 @@ export class WindowsManager {
// Clear those dupes
recentPaths
=
arrays
.
distinct
(
recentPaths
);
return
recentPaths
;
// Make sure it is bounded
return
recentPaths
.
slice
(
0
,
WindowsManager
.
MAX_RECENT_ENTRIES
);
}
private
toIPath
(
anyPath
:
string
,
ignoreFileNotFound
?:
boolean
,
gotoLineMode
?:
boolean
):
window
.
IPath
{
...
...
@@ -889,9 +891,7 @@ export class WindowsManager {
const
focusedWindow
=
this
.
getFocusedWindow
()
||
this
.
getLastActiveWindow
();
if
(
focusedWindow
)
{
focusedWindow
.
ready
().
then
((
readyWindow
)
=>
{
readyWindow
.
win
.
webContents
.
send
(
channel
,
...
args
);
});
focusedWindow
.
sendWhenReady
(
channel
,
...
args
);
}
}
...
...
@@ -901,9 +901,7 @@ export class WindowsManager {
return
;
// do not send if we are instructed to ignore it
}
w
.
ready
().
then
((
readyWindow
)
=>
{
readyWindow
.
win
.
webContents
.
send
(
channel
,
payload
);
});
w
.
sendWhenReady
(
channel
,
payload
);
});
}
...
...
src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts
浏览文件 @
fa056757
...
...
@@ -8,12 +8,6 @@ import platform = require('vs/platform/platform');
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IDebugService
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
service
=
require
(
'
vs/workbench/parts/debug/electron-browser/debugService
'
);
import
{
ExtensionOutputHandler
}
from
'
vs/workbench/parts/debug/electron-browser/extensionOutput
'
;
// Register Service
registerSingleton
(
IDebugService
,
service
.
DebugService
);
// Register Extension Output Handler
(
<
IWorkbenchContributionsRegistry
>
platform
.
Registry
.
as
(
Extensions
.
Workbench
)).
registerWorkbenchContribution
(
ExtensionOutputHandler
);
\ No newline at end of file
registerSingleton
(
IDebugService
,
service
.
DebugService
);
\ No newline at end of file
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
fa056757
...
...
@@ -13,6 +13,7 @@ import uri from 'vs/base/common/uri';
import
arrays
=
require
(
'
vs/base/common/arrays
'
);
import
actions
=
require
(
'
vs/base/common/actions
'
);
import
json
=
require
(
'
vs/base/common/json
'
);
import
types
=
require
(
'
vs/base/common/types
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
severity
from
'
vs/base/common/severity
'
;
import
{
Promise
,
TPromise
}
from
'
vs/base/common/winjs.base
'
;
...
...
@@ -49,7 +50,8 @@ import { IPluginService, IPluginDescription } from 'vs/platform/plugins/common/p
import
{
IOutputService
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
IKeybindingService
,
IKeybindingContextKey
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
IQuickOpenService
}
from
'
vs/workbench/services/quickopen/browser/quickOpenService
'
;
import
{
IWindowService
}
from
'
vs/workbench/services/window/electron-browser/windowService
'
;
import
{
IWindowService
,
IBroadcast
}
from
'
vs/workbench/services/window/electron-browser/windowService
'
;
import
{
ILogEntry
,
PLUGIN_LOG_BROADCAST_CHANNEL
}
from
'
vs/workbench/services/thread/electron-browser/threadService
'
;
var
DEBUG_BREAKPOINTS_KEY
=
'
debug.breakpoint
'
;
var
DEBUG_BREAKPOINTS_ACTIVATED_KEY
=
'
debug.breakpointactivated
'
;
...
...
@@ -184,6 +186,89 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
lifecycleService
.
onShutdown
.
add
(
this
.
store
,
this
);
lifecycleService
.
onShutdown
.
add
(
this
.
dispose
,
this
);
this
.
windowService
.
onBroadcast
.
add
(
this
.
onBroadcast
,
this
);
}
private
onBroadcast
(
broadcast
:
IBroadcast
):
void
{
let
session
=
this
.
getActiveSession
();
if
(
!
session
||
session
.
getType
()
!==
'
extensionHost
'
)
{
return
;
// we are only intersted if we have an active debug session for extensionHost
}
// A plugin logged output, show it inside the REPL
if
(
broadcast
.
channel
===
PLUGIN_LOG_BROADCAST_CHANNEL
)
{
let
extensionOutput
:
ILogEntry
=
broadcast
.
payload
;
let
sev
=
extensionOutput
.
severity
===
'
warn
'
?
severity
.
Warning
:
extensionOutput
.
severity
===
'
error
'
?
severity
.
Error
:
severity
.
Info
;
let
args
:
any
[]
=
[];
try
{
let
parsed
=
JSON
.
parse
(
extensionOutput
.
arguments
);
args
.
push
(...
Object
.
getOwnPropertyNames
(
parsed
).
map
(
o
=>
parsed
[
o
]));
}
catch
(
error
)
{
args
.
push
(
extensionOutput
.
arguments
);
}
// Add output for each argument logged
let
simpleVals
:
any
[]
=
[];
for
(
let
i
=
0
;
i
<
args
.
length
;
i
++
)
{
let
a
=
args
[
i
];
// Undefined gets printed as 'undefined'
if
(
typeof
a
===
'
undefined
'
)
{
simpleVals
.
push
(
'
undefined
'
);
}
// Null gets printed as 'null'
else
if
(
a
===
null
)
{
simpleVals
.
push
(
'
null
'
);
}
// Objects & Arrays are special because we want to inspect them in the REPL
else
if
(
types
.
isObject
(
a
)
||
Array
.
isArray
(
a
))
{
// Flush any existing simple values logged
if
(
simpleVals
.
length
)
{
this
.
logToRepl
(
simpleVals
.
join
(
'
'
),
sev
);
simpleVals
=
[];
}
// Show object
this
.
logToRepl
(
a
,
sev
);
}
// String: watch out for % replacement directive
// String substitution and formatting @ https://developer.chrome.com/devtools/docs/console
else
if
(
typeof
a
===
'
string
'
)
{
let
buf
=
''
;
for
(
let
j
=
0
,
len
=
a
.
length
;
j
<
len
;
j
++
)
{
if
(
a
[
j
]
===
'
%
'
&&
(
a
[
j
+
1
]
===
'
s
'
||
a
[
j
+
1
]
===
'
i
'
||
a
[
j
+
1
]
===
'
d
'
))
{
i
++
;
// read over substitution
buf
+=
!
types
.
isUndefinedOrNull
(
args
[
i
])
?
args
[
i
]
:
''
;
// replace
j
++
;
// read over directive
}
else
{
buf
+=
a
[
j
];
}
}
simpleVals
.
push
(
buf
);
}
// number or boolean is joined together
else
{
simpleVals
.
push
(
a
);
}
}
// Flush simple values
if
(
simpleVals
.
length
)
{
this
.
logToRepl
(
simpleVals
.
join
(
'
'
),
sev
);
}
// Show repl
this
.
revealRepl
(
true
/* in background */
).
done
(
null
,
errors
.
onUnexpectedError
);
}
}
private
registerSessionListeners
():
void
{
...
...
src/vs/workbench/parts/debug/electron-browser/extensionOutput.ts
已删除
100644 → 0
浏览文件 @
f192e04e
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
IDebugService
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
types
=
require
(
'
vs/base/common/types
'
);
import
severity
from
'
vs/base/common/severity
'
;
import
{
ILogEntry
,
PLUGIN_LOG_BROADCAST_CHANNEL
}
from
'
vs/workbench/services/thread/electron-browser/threadService
'
;
import
{
IWindowService
,
IBroadcast
}
from
'
vs/workbench/services/window/electron-browser/windowService
'
;
import
ipc
=
require
(
'
ipc
'
);
export
class
ExtensionOutputHandler
implements
IWorkbenchContribution
{
static
ID
=
'
debug.extensionOutputHandler
'
;
constructor
(
@
IDebugService
private
debugService
:
IDebugService
,
@
IWindowService
private
windowService
:
IWindowService
)
{
this
.
registerListeners
();
}
private
registerListeners
():
void
{
this
.
windowService
.
onBroadcast
.
add
(
this
.
onBroadcast
,
this
);
}
private
onBroadcast
(
broadcast
:
IBroadcast
):
void
{
let
session
=
this
.
debugService
.
getActiveSession
();
if
(
!
session
||
session
.
getType
()
!==
'
extensionHost
'
)
{
return
;
// we are only intersted if we have an active debug session for extensionHost
}
// A plugin logged output, show it inside the REPL
if
(
broadcast
.
channel
===
PLUGIN_LOG_BROADCAST_CHANNEL
)
{
let
extensionOutput
:
ILogEntry
=
broadcast
.
payload
;
let
sev
=
extensionOutput
.
severity
===
'
warn
'
?
severity
.
Warning
:
extensionOutput
.
severity
===
'
error
'
?
severity
.
Error
:
severity
.
Info
;
let
args
:
any
[]
=
[];
try
{
let
parsed
=
JSON
.
parse
(
extensionOutput
.
arguments
);
args
.
push
(...
Object
.
getOwnPropertyNames
(
parsed
).
map
(
o
=>
parsed
[
o
]));
}
catch
(
error
)
{
args
.
push
(
extensionOutput
.
arguments
);
}
// Add output for each argument logged
let
simpleVals
:
any
[]
=
[];
for
(
let
i
=
0
;
i
<
args
.
length
;
i
++
)
{
let
a
=
args
[
i
];
// Undefined gets printed as 'undefined'
if
(
typeof
a
===
'
undefined
'
)
{
simpleVals
.
push
(
'
undefined
'
);
}
// Null gets printed as 'null'
else
if
(
a
===
null
)
{
simpleVals
.
push
(
'
null
'
);
}
// Objects & Arrays are special because we want to inspect them in the REPL
else
if
(
types
.
isObject
(
a
)
||
Array
.
isArray
(
a
))
{
// Flush any existing simple values logged
if
(
simpleVals
.
length
)
{
this
.
debugService
.
logToRepl
(
simpleVals
.
join
(
'
'
),
sev
);
simpleVals
=
[];
}
// Show object
this
.
debugService
.
logToRepl
(
a
,
sev
);
}
// String: watch out for % replacement directive
// String substitution and formatting @ https://developer.chrome.com/devtools/docs/console
else
if
(
typeof
a
===
'
string
'
)
{
let
buf
=
''
;
for
(
let
j
=
0
,
len
=
a
.
length
;
j
<
len
;
j
++
)
{
if
(
a
[
j
]
===
'
%
'
&&
(
a
[
j
+
1
]
===
'
s
'
||
a
[
j
+
1
]
===
'
i
'
||
a
[
j
+
1
]
===
'
d
'
))
{
i
++
;
// read over substitution
buf
+=
!
types
.
isUndefinedOrNull
(
args
[
i
])
?
args
[
i
]
:
''
;
// replace
j
++
;
// read over directive
}
else
{
buf
+=
a
[
j
];
}
}
simpleVals
.
push
(
buf
);
}
// number or boolean is joined together
else
{
simpleVals
.
push
(
a
);
}
}
// Flush simple values
if
(
simpleVals
.
length
)
{
this
.
debugService
.
logToRepl
(
simpleVals
.
join
(
'
'
),
sev
);
}
// Show repl
this
.
debugService
.
revealRepl
(
true
/* in background */
).
done
(
null
,
errors
.
onUnexpectedError
);
}
}
public
getId
():
string
{
return
ExtensionOutputHandler
.
ID
;
}
}
\ No newline at end of file
src/vs/workbench/parts/debug/test/common/replHistory.test.ts
0 → 100644
浏览文件 @
fa056757
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
assert
=
require
(
'
assert
'
);
import
{
ReplHistory
}
from
'
vs/workbench/parts/debug/common/replHistory
'
;
suite
(
'
Debug - Repl History
'
,
()
=>
{
var
history
:
ReplHistory
;
setup
(()
=>
{
history
=
new
ReplHistory
([
'
one
'
,
'
two
'
,
'
three
'
,
'
four
'
,
'
five
'
]);
});
teardown
(()
=>
{
history
=
null
;
});
test
(
'
previous and next
'
,
()
=>
{
assert
.
equal
(
history
.
previous
(),
'
five
'
);
assert
.
equal
(
history
.
previous
(),
'
four
'
);
assert
.
equal
(
history
.
previous
(),
'
three
'
);
assert
.
equal
(
history
.
previous
(),
'
two
'
);
assert
.
equal
(
history
.
previous
(),
'
one
'
);
assert
.
equal
(
history
.
previous
(),
null
);
assert
.
equal
(
history
.
next
(),
'
two
'
);
assert
.
equal
(
history
.
next
(),
'
three
'
);
assert
.
equal
(
history
.
next
(),
'
four
'
);
assert
.
equal
(
history
.
next
(),
'
five
'
);
});
test
(
'
evaluated and remember
'
,
()
=>
{
history
.
evaluated
(
'
six
'
);
assert
.
equal
(
history
.
previous
(),
'
six
'
);
assert
.
equal
(
history
.
previous
(),
'
five
'
);
assert
.
equal
(
history
.
next
(),
'
six
'
);
history
.
remember
(
'
six++
'
,
true
);
assert
.
equal
(
history
.
next
(),
'
six++
'
);
assert
.
equal
(
history
.
previous
(),
'
six
'
);
history
.
evaluated
(
'
seven
'
);
assert
.
equal
(
history
.
previous
(),
'
seven
'
);
assert
.
equal
(
history
.
previous
(),
'
six
'
);
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录