Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
84fc56e3
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,发现更多精彩内容 >>
提交
84fc56e3
编写于
10月 23, 2020
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: use uriIdentityService for uri comparison
fixes #107830
上级
9ba6b405
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
13 deletion
+26
-13
src/vs/workbench/contrib/debug/browser/callStackEditorContribution.ts
...ench/contrib/debug/browser/callStackEditorContribution.ts
+3
-1
src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts
...kbench/contrib/debug/browser/debugConfigurationManager.ts
+3
-1
src/vs/workbench/contrib/debug/browser/debugEditorActions.ts
src/vs/workbench/contrib/debug/browser/debugEditorActions.ts
+9
-4
src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts
...orkbench/contrib/debug/browser/debugEditorContribution.ts
+7
-5
src/vs/workbench/contrib/debug/browser/debugService.ts
src/vs/workbench/contrib/debug/browser/debugService.ts
+4
-2
未找到文件。
src/vs/workbench/contrib/debug/browser/callStackEditorContribution.ts
浏览文件 @
84fc56e3
...
...
@@ -15,6 +15,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import
{
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
distinct
}
from
'
vs/base/common/arrays
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
const
stickiness
=
TrackedRangeStickiness
.
NeverGrowsWhenTypingAtEdges
;
...
...
@@ -95,6 +96,7 @@ export class CallStackEditorContribution implements IEditorContribution {
constructor
(
private
readonly
editor
:
ICodeEditor
,
@
IDebugService
private
readonly
debugService
:
IDebugService
,
@
IUriIdentityService
private
readonly
uriIdentityService
:
IUriIdentityService
)
{
const
setDecorations
=
()
=>
this
.
decorationIds
=
this
.
editor
.
deltaDecorations
(
this
.
decorationIds
,
this
.
createCallStackDecorations
());
this
.
toDispose
.
push
(
Event
.
any
(
this
.
debugService
.
getViewModel
().
onDidFocusStackFrame
,
this
.
debugService
.
getModel
().
onDidChangeCallStack
)(()
=>
{
...
...
@@ -122,7 +124,7 @@ export class CallStackEditorContribution implements IEditorContribution {
}
}
if
(
candidateStackFrame
&&
candidateStackFrame
.
source
.
uri
.
toString
()
===
this
.
editor
.
getModel
()?.
uri
.
toString
(
))
{
if
(
candidateStackFrame
&&
this
.
uriIdentityService
.
extUri
.
isEqual
(
candidateStackFrame
.
source
.
uri
,
this
.
editor
.
getModel
()?.
uri
))
{
decorations
.
push
(...
createDecorationsForStackFrame
(
candidateStackFrame
,
this
.
topStackFrameRange
,
isSessionFocused
));
}
}
...
...
src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts
浏览文件 @
84fc56e3
...
...
@@ -40,6 +40,7 @@ import { IHistoryService } from 'vs/workbench/services/history/common/history';
import
{
flatten
}
from
'
vs/base/common/arrays
'
;
import
{
getVisibleAndSorted
}
from
'
vs/workbench/contrib/debug/common/debugUtils
'
;
import
{
DebugConfigurationProviderTriggerKind
}
from
'
vs/workbench/api/common/extHostTypes
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
const
jsonRegistry
=
Registry
.
as
<
IJSONContributionRegistry
>
(
JSONExtensions
.
JSONContribution
);
jsonRegistry
.
registerSchema
(
launchSchemaId
,
launchSchema
);
...
...
@@ -78,6 +79,7 @@ export class ConfigurationManager implements IConfigurationManager {
@
IStorageService
private
readonly
storageService
:
IStorageService
,
@
IExtensionService
private
readonly
extensionService
:
IExtensionService
,
@
IHistoryService
private
readonly
historyService
:
IHistoryService
,
@
IUriIdentityService
private
readonly
uriIdentityService
:
IUriIdentityService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
)
{
this
.
configProviders
=
[];
...
...
@@ -491,7 +493,7 @@ export class ConfigurationManager implements IConfigurationManager {
return
undefined
;
}
return
this
.
launches
.
find
(
l
=>
l
.
workspace
&&
l
.
workspace
.
uri
.
toString
()
===
workspaceUri
.
toString
(
));
return
this
.
launches
.
find
(
l
=>
l
.
workspace
&&
this
.
uriIdentityService
.
extUri
.
isEqual
(
l
.
workspace
.
uri
,
workspaceUri
));
}
get
selectedConfiguration
():
{
launch
:
ILaunch
|
undefined
,
name
:
string
|
undefined
,
config
:
IConfig
|
undefined
,
type
:
string
|
undefined
}
{
...
...
src/vs/workbench/contrib/debug/browser/debugEditorActions.ts
浏览文件 @
84fc56e3
...
...
@@ -19,6 +19,7 @@ import { IViewsService } from 'vs/workbench/common/views';
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
getDomNodePagePosition
}
from
'
vs/base/browser/dom
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
export
const
TOGGLE_BREAKPOINT_ID
=
'
editor.debug.action.toggleBreakpoint
'
;
class
ToggleBreakpointAction
extends
EditorAction
{
...
...
@@ -122,6 +123,7 @@ export class RunToCursorAction extends EditorAction {
async
run
(
accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
):
Promise
<
void
>
{
const
debugService
=
accessor
.
get
(
IDebugService
);
const
uriIdentityService
=
accessor
.
get
(
IUriIdentityService
);
const
focusedSession
=
debugService
.
getViewModel
().
focusedSession
;
if
(
debugService
.
state
!==
State
.
Stopped
||
!
focusedSession
)
{
return
;
...
...
@@ -145,7 +147,7 @@ export class RunToCursorAction extends EditorAction {
if
(
!
bpExists
)
{
let
column
=
0
;
const
focusedStackFrame
=
debugService
.
getViewModel
().
focusedStackFrame
;
if
(
focusedStackFrame
&&
focusedStackFrame
.
source
.
uri
.
toString
()
===
uri
.
toString
(
)
&&
focusedStackFrame
.
range
.
startLineNumber
===
position
.
lineNumber
)
{
if
(
focusedStackFrame
&&
uriIdentityService
.
extUri
.
isEqual
(
focusedStackFrame
.
source
.
uri
,
uri
)
&&
focusedStackFrame
.
range
.
startLineNumber
===
position
.
lineNumber
)
{
// If the cursor is on a line different than the one the debugger is currently paused on, then send the breakpoint at column 0 on the line
// otherwise set it at the precise column #102199
column
=
position
.
column
;
...
...
@@ -272,10 +274,11 @@ class StepIntoTargetsAction extends EditorAction {
async
run
(
accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
):
Promise
<
void
>
{
const
debugService
=
accessor
.
get
(
IDebugService
);
const
contextMenuService
=
accessor
.
get
(
IContextMenuService
);
const
uriIdentityService
=
accessor
.
get
(
IUriIdentityService
);
const
session
=
debugService
.
getViewModel
().
focusedSession
;
const
frame
=
debugService
.
getViewModel
().
focusedStackFrame
;
if
(
session
&&
frame
&&
editor
.
hasModel
()
&&
editor
.
getModel
().
uri
.
toString
()
===
frame
.
source
.
uri
.
toString
(
))
{
if
(
session
&&
frame
&&
editor
.
hasModel
()
&&
uriIdentityService
.
extUri
.
isEqual
(
editor
.
getModel
().
uri
,
frame
.
source
.
uri
))
{
const
targets
=
await
session
.
stepInTargets
(
frame
.
frameId
);
if
(
!
targets
)
{
return
;
...
...
@@ -305,6 +308,8 @@ class GoToBreakpointAction extends EditorAction {
async
run
(
accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
):
Promise
<
any
>
{
const
debugService
=
accessor
.
get
(
IDebugService
);
const
editorService
=
accessor
.
get
(
IEditorService
);
const
uriIdentityService
=
accessor
.
get
(
IUriIdentityService
);
if
(
editor
.
hasModel
())
{
const
currentUri
=
editor
.
getModel
().
uri
;
const
currentLine
=
editor
.
getPosition
().
lineNumber
;
...
...
@@ -314,8 +319,8 @@ class GoToBreakpointAction extends EditorAction {
//Try to find breakpoint in current file
let
moveBreakpoint
=
this
.
isNext
?
allEnabledBreakpoints
.
filter
(
bp
=>
bp
.
uri
.
toString
()
===
currentUri
.
toString
(
)
&&
bp
.
lineNumber
>
currentLine
).
shift
()
:
allEnabledBreakpoints
.
filter
(
bp
=>
bp
.
uri
.
toString
()
===
currentUri
.
toString
(
)
&&
bp
.
lineNumber
<
currentLine
).
pop
();
?
allEnabledBreakpoints
.
filter
(
bp
=>
uriIdentityService
.
extUri
.
isEqual
(
bp
.
uri
,
currentUri
)
&&
bp
.
lineNumber
>
currentLine
).
shift
()
:
allEnabledBreakpoints
.
filter
(
bp
=>
uriIdentityService
.
extUri
.
isEqual
(
bp
.
uri
,
currentUri
)
&&
bp
.
lineNumber
<
currentLine
).
pop
();
//Try to find breakpoints in following files
if
(
!
moveBreakpoint
)
{
...
...
src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts
浏览文件 @
84fc56e3
...
...
@@ -38,6 +38,7 @@ import { ModesHoverController } from 'vs/editor/contrib/hover/hover';
import
{
HoverStartMode
}
from
'
vs/editor/contrib/hover/hoverOperation
'
;
import
{
IHostService
}
from
'
vs/workbench/services/host/browser/host
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
const
LAUNCH_JSON_REGEX
=
/
\.
vscode
\/
launch
\.
json$/
;
const
INLINE_VALUE_DECORATION_KEY
=
'
inlinevaluedecoration
'
;
...
...
@@ -187,7 +188,8 @@ export class DebugEditorContribution implements IDebugEditorContribution {
@
ICodeEditorService
private
readonly
codeEditorService
:
ICodeEditorService
,
@
ITelemetryService
private
readonly
telemetryService
:
ITelemetryService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IHostService
private
readonly
hostService
:
IHostService
@
IHostService
private
readonly
hostService
:
IHostService
,
@
IUriIdentityService
private
readonly
uriIdentityService
:
IUriIdentityService
)
{
this
.
hoverWidget
=
this
.
instantiationService
.
createInstance
(
DebugHoverWidget
,
this
.
editor
);
this
.
toDispose
=
[];
...
...
@@ -247,7 +249,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
}
private
applyHoverConfiguration
(
model
:
ITextModel
,
stackFrame
:
IStackFrame
|
undefined
):
void
{
if
(
stackFrame
&&
model
.
uri
.
toString
()
===
stackFrame
.
source
.
uri
.
toString
(
))
{
if
(
stackFrame
&&
this
.
uriIdentityService
.
extUri
.
isEqual
(
model
.
uri
,
stackFrame
.
source
.
uri
))
{
if
(
this
.
altListener
)
{
this
.
altListener
.
dispose
();
}
...
...
@@ -307,7 +309,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
async
showHover
(
range
:
Range
,
focus
:
boolean
):
Promise
<
void
>
{
const
sf
=
this
.
debugService
.
getViewModel
().
focusedStackFrame
;
const
model
=
this
.
editor
.
getModel
();
if
(
sf
&&
model
&&
sf
.
source
.
uri
.
toString
()
===
model
.
uri
.
toString
(
)
&&
!
this
.
altPressed
)
{
if
(
sf
&&
model
&&
this
.
uriIdentityService
.
extUri
.
isEqual
(
sf
.
source
.
uri
,
model
.
uri
)
&&
!
this
.
altPressed
)
{
return
this
.
hoverWidget
.
showAt
(
range
,
focus
);
}
}
...
...
@@ -316,7 +318,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
const
model
=
this
.
editor
.
getModel
();
if
(
model
)
{
this
.
applyHoverConfiguration
(
model
,
sf
);
if
(
sf
&&
sf
.
source
.
uri
.
toString
()
===
model
.
uri
.
toString
(
))
{
if
(
sf
&&
this
.
uriIdentityService
.
extUri
.
isEqual
(
sf
.
source
.
uri
,
model
.
uri
))
{
await
this
.
toggleExceptionWidget
();
}
else
{
this
.
hideHoverWidget
();
...
...
@@ -421,7 +423,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
return
;
}
const
sameUri
=
exceptionSf
.
source
.
uri
.
toString
()
===
model
.
uri
.
toString
(
);
const
sameUri
=
this
.
uriIdentityService
.
extUri
.
isEqual
(
exceptionSf
.
source
.
uri
,
model
.
uri
);
if
(
this
.
exceptionWidget
&&
!
sameUri
)
{
this
.
closeExceptionWidget
();
}
else
if
(
sameUri
)
{
...
...
src/vs/workbench/contrib/debug/browser/debugService.ts
浏览文件 @
84fc56e3
...
...
@@ -48,6 +48,7 @@ import { DebugTelemetry } from 'vs/workbench/contrib/debug/common/debugTelemetry
import
{
DebugCompoundRoot
}
from
'
vs/workbench/contrib/debug/common/debugCompoundRoot
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IQuickInputService
}
from
'
vs/platform/quickinput/common/quickInput
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
export
class
DebugService
implements
IDebugService
{
declare
readonly
_serviceBrand
:
undefined
;
...
...
@@ -92,7 +93,8 @@ export class DebugService implements IDebugService {
@
IExtensionHostDebugService
private
readonly
extensionHostDebugService
:
IExtensionHostDebugService
,
@
IActivityService
private
readonly
activityService
:
IActivityService
,
@
ICommandService
private
readonly
commandService
:
ICommandService
,
@
IQuickInputService
private
readonly
quickInputService
:
IQuickInputService
@
IQuickInputService
private
readonly
quickInputService
:
IQuickInputService
,
@
IUriIdentityService
private
readonly
uriIdentityService
:
IUriIdentityService
)
{
this
.
toDispose
=
[];
...
...
@@ -295,7 +297,7 @@ export class DebugService implements IDebugService {
const
sessions
=
this
.
model
.
getSessions
();
const
alreadyRunningMessage
=
nls
.
localize
(
'
configurationAlreadyRunning
'
,
"
There is already a debug configuration
\"
{0}
\"
running.
"
,
configOrName
);
if
(
sessions
.
some
(
s
=>
s
.
configuration
.
name
===
configOrName
&&
(
!
launch
||
!
launch
.
workspace
||
!
s
.
root
||
s
.
root
.
uri
.
toString
()
===
launch
.
workspace
.
uri
.
toString
(
))))
{
if
(
sessions
.
some
(
s
=>
s
.
configuration
.
name
===
configOrName
&&
(
!
launch
||
!
launch
.
workspace
||
!
s
.
root
||
this
.
uriIdentityService
.
extUri
.
isEqual
(
s
.
root
.
uri
,
launch
.
workspace
.
uri
))))
{
throw
new
Error
(
alreadyRunningMessage
);
}
if
(
compound
&&
compound
.
configurations
&&
sessions
.
some
(
p
=>
compound
!
.
configurations
.
indexOf
(
p
.
configuration
.
name
)
!==
-
1
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录