Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
d9c56ee4
Commit
d9c56ee4
authored
Aug 07, 2017
by
yann300
Committed by
GitHub
Aug 07, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #653 from ethereum/fixSourceLocationChange
Fix: switching file when debugging
parents
46a5ab53
735c4e54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
app.js
src/app.js
+9
-7
editor.js
src/app/editor.js
+9
-4
No files found.
src/app.js
View file @
d9c56ee4
...
@@ -748,17 +748,19 @@ function run () {
...
@@ -748,17 +748,19 @@ function run () {
var
debugAPI
=
{
var
debugAPI
=
{
statementMarker
:
null
,
statementMarker
:
null
,
fullLineMarker
:
null
,
fullLineMarker
:
null
,
source
:
null
,
currentSourceLocation
:
(
lineColumnPos
,
location
)
=>
{
currentSourceLocation
:
(
lineColumnPos
,
location
)
=>
{
if
(
this
.
statementMarker
)
editor
.
removeMarker
(
this
.
statementMarker
)
if
(
this
.
statementMarker
)
editor
.
removeMarker
(
this
.
statementMarker
,
this
.
source
)
if
(
this
.
fullLineMarker
)
editor
.
removeMarker
(
this
.
fullLineMarker
)
if
(
this
.
fullLineMarker
)
editor
.
removeMarker
(
this
.
fullLineMarker
,
this
.
source
)
this
.
statementMarker
=
null
this
.
statementMarker
=
null
this
.
fullLineMarker
=
null
this
.
fullLineMarker
=
null
this
.
source
=
null
if
(
lineColumnPos
)
{
if
(
lineColumnPos
)
{
var
source
=
compiler
.
lastCompilationResult
.
data
.
sourceList
[
location
.
file
]
// auto switch to that tab
this
.
source
=
compiler
.
lastCompilationResult
.
data
.
sourceList
[
location
.
file
]
// auto switch to that tab
if
(
config
.
get
(
'currentFile'
)
!==
source
)
{
if
(
config
.
get
(
'currentFile'
)
!==
this
.
source
)
{
switchToFile
(
source
)
switchToFile
(
this
.
source
)
}
}
this
.
statementMarker
=
editor
.
addMarker
(
lineColumnPos
,
'highlightcode'
)
this
.
statementMarker
=
editor
.
addMarker
(
lineColumnPos
,
this
.
source
,
'highlightcode'
)
editor
.
scrollToLine
(
lineColumnPos
.
start
.
line
,
true
,
true
,
function
()
{})
editor
.
scrollToLine
(
lineColumnPos
.
start
.
line
,
true
,
true
,
function
()
{})
if
(
lineColumnPos
.
start
.
line
===
lineColumnPos
.
end
.
line
)
{
if
(
lineColumnPos
.
start
.
line
===
lineColumnPos
.
end
.
line
)
{
...
@@ -771,7 +773,7 @@ function run () {
...
@@ -771,7 +773,7 @@ function run () {
line
:
lineColumnPos
.
start
.
line
+
1
,
line
:
lineColumnPos
.
start
.
line
+
1
,
column
:
0
column
:
0
}
}
},
'highlightcode_fullLine'
)
},
this
.
source
,
'highlightcode_fullLine'
)
}
}
}
}
},
},
...
...
src/app/editor.js
View file @
d9c56ee4
...
@@ -148,17 +148,22 @@ function Editor (opts = {}) {
...
@@ -148,17 +148,22 @@ function Editor (opts = {}) {
}
}
}
}
this
.
addMarker
=
function
(
lineColumnPos
,
cssClass
)
{
this
.
addMarker
=
function
(
lineColumnPos
,
source
,
cssClass
)
{
var
currentRange
=
new
Range
(
lineColumnPos
.
start
.
line
,
lineColumnPos
.
start
.
column
,
lineColumnPos
.
end
.
line
,
lineColumnPos
.
end
.
column
)
var
currentRange
=
new
Range
(
lineColumnPos
.
start
.
line
,
lineColumnPos
.
start
.
column
,
lineColumnPos
.
end
.
line
,
lineColumnPos
.
end
.
column
)
return
editor
.
session
.
addMarker
(
currentRange
,
cssClass
)
if
(
sessions
[
source
])
{
return
sessions
[
source
].
addMarker
(
currentRange
,
cssClass
)
}
return
null
}
}
this
.
scrollToLine
=
function
(
line
,
center
,
animate
,
callback
)
{
this
.
scrollToLine
=
function
(
line
,
center
,
animate
,
callback
)
{
editor
.
scrollToLine
(
line
,
center
,
animate
,
callback
)
editor
.
scrollToLine
(
line
,
center
,
animate
,
callback
)
}
}
this
.
removeMarker
=
function
(
markerId
)
{
this
.
removeMarker
=
function
(
markerId
,
source
)
{
editor
.
session
.
removeMarker
(
markerId
)
if
(
sessions
[
source
])
{
sessions
[
source
].
removeMarker
(
markerId
)
}
}
}
this
.
clearAnnotations
=
function
()
{
this
.
clearAnnotations
=
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment