Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
fa3494b1
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,发现更多精彩内容 >>
提交
fa3494b1
编写于
11月 26, 2015
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: move debugSource to its own file.
上级
d147ddd4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
52 addition
and
43 deletion
+52
-43
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+1
-31
src/vs/workbench/parts/debug/common/debugModel.ts
src/vs/workbench/parts/debug/common/debugModel.ts
+8
-7
src/vs/workbench/parts/debug/common/debugSource.ts
src/vs/workbench/parts/debug/common/debugSource.ts
+37
-0
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+6
-5
未找到文件。
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
fa3494b1
...
...
@@ -7,12 +7,12 @@ import nls = require('vs/nls');
import
uri
from
'
vs/base/common/uri
'
;
import
{
TPromise
,
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
ee
=
require
(
'
vs/base/common/eventEmitter
'
);
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
severity
from
'
vs/base/common/severity
'
;
import
{
IJSONSchema
}
from
'
vs/base/common/jsonSchema
'
;
import
{
createDecorator
,
ServiceIdentifier
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
pluginsRegistry
=
require
(
'
vs/platform/plugins/common/pluginsRegistry
'
);
import
editor
=
require
(
'
vs/editor/common/editorCommon
'
);
import
{
Source
}
from
'
vs/workbench/parts/debug/common/debugSource
'
;
export
var
VIEWLET_ID
=
'
workbench.view.debug
'
;
export
var
DEBUG_SERVICE_ID
=
'
debugService
'
;
...
...
@@ -79,36 +79,6 @@ export interface IExceptionBreakpoint extends IEnablement {
name
:
string
;
}
export
class
Source
{
public
uri
:
uri
;
public
inMemory
:
boolean
;
public
available
:
boolean
;
private
static
INTERNAL_URI_PREFIX
=
'
debug://internal/
'
;
constructor
(
public
name
:
string
,
uriStr
:
string
,
public
reference
=
0
)
{
this
.
uri
=
uri
.
parse
(
uriStr
);
this
.
inMemory
=
uriStr
.
indexOf
(
Source
.
INTERNAL_URI_PREFIX
)
===
0
;
this
.
available
=
true
;
}
public
toRawSource
():
DebugProtocol
.
Source
{
return
this
.
inMemory
?
{
name
:
this
.
name
}
:
{
path
:
paths
.
normalize
(
this
.
uri
.
fsPath
,
true
)
};
}
public
static
fromRawSource
(
rawSource
:
DebugProtocol
.
Source
):
Source
{
var
uriStr
=
rawSource
.
path
?
uri
.
file
(
rawSource
.
path
).
toString
()
:
Source
.
INTERNAL_URI_PREFIX
+
rawSource
.
name
;
return
new
Source
(
rawSource
.
name
,
uriStr
,
rawSource
.
sourceReference
);
}
public
static
fromUri
(
uri
:
uri
):
Source
{
var
uriStr
=
uri
.
toString
();
return
new
Source
(
uriStr
.
substr
(
uriStr
.
lastIndexOf
(
'
/
'
)
+
1
),
uriStr
);
}
}
// Events
export
var
ModelEvents
=
{
...
...
src/vs/workbench/parts/debug/common/debugModel.ts
浏览文件 @
fa3494b1
...
...
@@ -13,6 +13,7 @@ import severity from 'vs/base/common/severity';
import
types
=
require
(
'
vs/base/common/types
'
);
import
arrays
=
require
(
'
vs/base/common/arrays
'
);
import
debug
=
require
(
'
vs/workbench/parts/debug/common/debug
'
);
import
{
Source
}
from
'
vs/workbench/parts/debug/common/debugSource
'
;
function
resolveChildren
(
debugService
:
debug
.
IDebugService
,
parent
:
debug
.
IExpressionContainer
):
TPromise
<
Variable
[]
>
{
var
session
=
debugService
.
getActiveSession
();
...
...
@@ -204,7 +205,7 @@ export class StackFrame implements debug.IStackFrame {
private
internalId
:
string
;
private
scopes
:
TPromise
<
Scope
[]
>
;
constructor
(
public
threadId
:
number
,
public
frameId
:
number
,
public
source
:
debug
.
Source
,
public
name
:
string
,
public
lineNumber
:
number
,
public
column
:
number
)
{
constructor
(
public
threadId
:
number
,
public
frameId
:
number
,
public
source
:
Source
,
public
name
:
string
,
public
lineNumber
:
number
,
public
column
:
number
)
{
this
.
internalId
=
uuid
.
generateUuid
();
this
.
scopes
=
null
;
}
...
...
@@ -229,7 +230,7 @@ export class Breakpoint implements debug.IBreakpoint {
public
lineNumber
:
number
;
private
id
:
string
;
constructor
(
public
source
:
debug
.
Source
,
public
desiredLineNumber
:
number
,
public
enabled
:
boolean
)
{
constructor
(
public
source
:
Source
,
public
desiredLineNumber
:
number
,
public
enabled
:
boolean
)
{
this
.
lineNumber
=
this
.
desiredLineNumber
;
this
.
id
=
uuid
.
generateUuid
();
}
...
...
@@ -326,7 +327,7 @@ export class Model extends ee.EventEmitter implements debug.IModel {
}
if
(
!
found
)
{
this
.
breakpoints
.
push
(
new
Breakpoint
(
debug
.
Source
.
fromUri
(
modelUri
),
lineNumber
,
true
));
this
.
breakpoints
.
push
(
new
Breakpoint
(
Source
.
fromUri
(
modelUri
),
lineNumber
,
true
));
this
.
breakpointsActivated
=
true
;
}
...
...
@@ -370,7 +371,7 @@ export class Model extends ee.EventEmitter implements debug.IModel {
public
setBreakpointsForModel
(
modelUri
:
uri
,
data
:
{
lineNumber
:
number
;
enabled
:
boolean
;
}[]):
void
{
this
.
clearBreakpoints
(
modelUri
);
for
(
var
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
this
.
breakpoints
.
push
(
new
Breakpoint
(
debug
.
Source
.
fromUri
(
modelUri
),
data
[
i
].
lineNumber
,
data
[
i
].
enabled
));
this
.
breakpoints
.
push
(
new
Breakpoint
(
Source
.
fromUri
(
modelUri
),
data
[
i
].
lineNumber
,
data
[
i
].
enabled
));
}
this
.
emit
(
debug
.
ModelEvents
.
BREAKPOINTS_UPDATED
);
}
...
...
@@ -533,7 +534,7 @@ export class Model extends ee.EventEmitter implements debug.IModel {
this
.
emit
(
debug
.
ModelEvents
.
WATCH_EXPRESSIONS_UPDATED
);
}
public
sourceIsUnavailable
(
source
:
debug
.
Source
):
void
{
public
sourceIsUnavailable
(
source
:
Source
):
void
{
Object
.
keys
(
this
.
threads
).
forEach
(
key
=>
{
this
.
threads
[
key
].
callStack
.
forEach
(
stackFrame
=>
{
if
(
stackFrame
.
source
.
uri
.
toString
()
===
source
.
uri
.
toString
())
{
...
...
@@ -555,10 +556,10 @@ export class Model extends ee.EventEmitter implements debug.IModel {
this
.
threads
[
data
.
threadId
].
callStack
=
data
.
callStack
.
map
(
(
rsf
,
level
)
=>
{
if
(
!
rsf
)
{
return
new
StackFrame
(
data
.
threadId
,
0
,
debug
.
Source
.
fromUri
(
uri
.
parse
(
'
unknown
'
)),
nls
.
localize
(
'
unknownStack
'
,
"
Unknown stack location
"
),
undefined
,
undefined
);
return
new
StackFrame
(
data
.
threadId
,
0
,
Source
.
fromUri
(
uri
.
parse
(
'
unknown
'
)),
nls
.
localize
(
'
unknownStack
'
,
"
Unknown stack location
"
),
undefined
,
undefined
);
}
return
new
StackFrame
(
data
.
threadId
,
rsf
.
id
,
rsf
.
source
?
debug
.
Source
.
fromRawSource
(
rsf
.
source
)
:
debug
.
Source
.
fromUri
(
uri
.
parse
(
'
unknown
'
)),
rsf
.
name
,
rsf
.
line
,
rsf
.
column
);
return
new
StackFrame
(
data
.
threadId
,
rsf
.
id
,
rsf
.
source
?
Source
.
fromRawSource
(
rsf
.
source
)
:
Source
.
fromUri
(
uri
.
parse
(
'
unknown
'
)),
rsf
.
name
,
rsf
.
line
,
rsf
.
column
);
});
this
.
threads
[
data
.
threadId
].
exception
=
data
.
exception
;
...
...
src/vs/workbench/parts/debug/common/debugSource.ts
0 → 100644
浏览文件 @
fa3494b1
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
uri
from
'
vs/base/common/uri
'
;
import
paths
=
require
(
'
vs/base/common/paths
'
);
export
class
Source
{
public
uri
:
uri
;
public
inMemory
:
boolean
;
public
available
:
boolean
;
private
static
INTERNAL_URI_PREFIX
=
'
debug://internal/
'
;
constructor
(
public
name
:
string
,
uriStr
:
string
,
public
reference
=
0
)
{
this
.
uri
=
uri
.
parse
(
uriStr
);
this
.
inMemory
=
uriStr
.
indexOf
(
Source
.
INTERNAL_URI_PREFIX
)
===
0
;
this
.
available
=
true
;
}
public
toRawSource
():
DebugProtocol
.
Source
{
return
this
.
inMemory
?
{
name
:
this
.
name
}
:
{
path
:
paths
.
normalize
(
this
.
uri
.
fsPath
,
true
)
};
}
public
static
fromRawSource
(
rawSource
:
DebugProtocol
.
Source
):
Source
{
var
uriStr
=
rawSource
.
path
?
uri
.
file
(
rawSource
.
path
).
toString
()
:
Source
.
INTERNAL_URI_PREFIX
+
rawSource
.
name
;
return
new
Source
(
rawSource
.
name
,
uriStr
,
rawSource
.
sourceReference
);
}
public
static
fromUri
(
uri
:
uri
):
Source
{
var
uriStr
=
uri
.
toString
();
return
new
Source
(
uriStr
.
substr
(
uriStr
.
lastIndexOf
(
'
/
'
)
+
1
),
uriStr
);
}
}
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
fa3494b1
...
...
@@ -31,6 +31,7 @@ import viewmodel = require('vs/workbench/parts/debug/common/debugViewModel');
import
debugactions
=
require
(
'
vs/workbench/parts/debug/browser/debugActions
'
);
import
{
Adapter
}
from
'
vs/workbench/parts/debug/node/debugAdapter
'
;
import
{
Repl
}
from
'
vs/workbench/parts/debug/browser/replEditor
'
;
import
{
Source
}
from
'
vs/workbench/parts/debug/common/debugSource
'
;
import
{
Position
}
from
'
vs/platform/editor/common/editor
'
;
import
{
ITaskService
,
TaskEvent
,
TaskType
,
TaskServiceEvents
}
from
'
vs/workbench/parts/tasks/common/taskService
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/common/viewletService
'
;
...
...
@@ -366,7 +367,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
private
loadBreakpoints
():
debug
.
IBreakpoint
[]
{
try
{
return
JSON
.
parse
(
this
.
storageService
.
get
(
DEBUG_BREAKPOINTS_KEY
,
StorageScope
.
WORKSPACE
,
'
[]
'
)).
map
((
breakpoint
:
any
)
=>
{
return
new
model
.
Breakpoint
(
new
debug
.
Source
(
breakpoint
.
source
.
name
,
breakpoint
.
source
.
uri
,
breakpoint
.
source
.
reference
),
breakpoint
.
desiredLineNumber
||
breakpoint
.
lineNumber
,
breakpoint
.
enabled
);
return
new
model
.
Breakpoint
(
new
Source
(
breakpoint
.
source
.
name
,
breakpoint
.
source
.
uri
,
breakpoint
.
source
.
reference
),
breakpoint
.
desiredLineNumber
||
breakpoint
.
lineNumber
,
breakpoint
.
enabled
);
});
}
catch
(
e
)
{
return
[];
...
...
@@ -746,7 +747,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
return
this
.
viewModel
;
}
public
openOrRevealEditor
(
source
:
debug
.
Source
,
lineNumber
:
number
,
preserveFocus
:
boolean
,
sideBySide
:
boolean
):
Promise
{
public
openOrRevealEditor
(
source
:
Source
,
lineNumber
:
number
,
preserveFocus
:
boolean
,
sideBySide
:
boolean
):
Promise
{
const
visibleEditors
=
this
.
editorService
.
getVisibleEditors
();
for
(
var
i
=
0
;
i
<
visibleEditors
.
length
;
i
++
)
{
const
fileInput
=
wbeditorcommon
.
asFileEditorInput
(
visibleEditors
[
i
].
input
);
...
...
@@ -798,7 +799,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
);
}
private
sourceIsUnavailable
(
source
:
debug
.
Source
,
sideBySide
:
boolean
):
Promise
{
private
sourceIsUnavailable
(
source
:
Source
,
sideBySide
:
boolean
):
Promise
{
this
.
model
.
sourceIsUnavailable
(
source
);
const
editorInput
=
this
.
getDebugStringEditorInput
(
source
,
'
Source is not available.
'
,
'
text/plain
'
);
...
...
@@ -844,7 +845,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
});
}
private
getDebugStringEditorInput
(
source
:
debug
.
Source
,
value
:
string
,
mtype
:
string
):
debuginputs
.
DebugStringEditorInput
{
private
getDebugStringEditorInput
(
source
:
Source
,
value
:
string
,
mtype
:
string
):
debuginputs
.
DebugStringEditorInput
{
var
filtered
=
this
.
debugStringEditorInputs
.
filter
(
input
=>
input
.
getResource
().
toString
()
===
source
.
uri
.
toString
());
if
(
filtered
.
length
===
0
)
{
...
...
@@ -880,7 +881,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
this
.
model
.
getBreakpoints
().
filter
(
bp
=>
this
.
model
.
areBreakpointsActivated
()
&&
bp
.
enabled
&&
bp
.
source
.
uri
.
toString
()
===
modelUri
.
toString
()),
bp
=>
`
${
bp
.
desiredLineNumber
}
`
);
return
this
.
session
.
setBreakpoints
({
source
:
debug
.
Source
.
fromUri
(
modelUri
).
toRawSource
(),
lines
:
breakpointsToSend
.
map
(
bp
=>
bp
.
desiredLineNumber
)
}).
then
(
response
=>
{
return
this
.
session
.
setBreakpoints
({
source
:
Source
.
fromUri
(
modelUri
).
toRawSource
(),
lines
:
breakpointsToSend
.
map
(
bp
=>
bp
.
desiredLineNumber
)
}).
then
(
response
=>
{
let
index
=
0
;
breakpointsToSend
.
forEach
(
bp
=>
{
const
lineNumber
=
response
.
body
.
breakpoints
[
index
++
].
line
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录