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
b75dd57a
Commit
b75dd57a
authored
Jul 02, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix offsetToLineColumn
parent
3840aee8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
9 deletions
+12
-9
debugger.js
src/app/debugger/debugger.js
+3
-3
contextView.js
src/app/editor/contextView.js
+1
-1
contextualListener.js
src/app/editor/contextualListener.js
+1
-1
staticAnalysisView.js
src/app/staticanalysis/staticAnalysisView.js
+4
-1
offsetToLineColumnConverter.js
src/lib/offsetToLineColumnConverter.js
+3
-3
No files found.
src/app/debugger/debugger.js
View file @
b75dd57a
...
...
@@ -36,7 +36,7 @@ function Debugger (id, sourceHighlighter, localRegistry) {
this
.
isActive
=
false
this
.
breakPointManager
=
new
remixCore
.
code
.
BreakpointManager
(
this
.
debugger
,
(
sourceLocation
)
=>
{
return
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
this
.
_deps
.
compiler
.
lastCompilationResult
.
data
)
return
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
this
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
)
})
this
.
debugger
.
setBreakpointManager
(
this
.
breakPointManager
)
...
...
@@ -74,8 +74,8 @@ function Debugger (id, sourceHighlighter, localRegistry) {
this
.
debugger
.
codeManager
.
event
.
register
(
'changed'
,
this
,
function
(
code
,
address
,
index
)
{
if
(
self
.
_deps
.
compiler
.
lastCompilationResult
)
{
self
.
debugger
.
callTree
.
sourceLocationTracker
.
getSourceLocationFromInstructionIndex
(
address
,
index
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
contracts
,
function
(
error
,
rawLocation
)
{
if
(
!
error
)
{
var
lineColumnPos
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
)
if
(
!
error
&&
self
.
_deps
.
compiler
.
lastCompilationResult
&&
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
)
{
var
lineColumnPos
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
)
self
.
_components
.
sourceHighlighter
.
currentSourceLocation
(
lineColumnPos
,
rawLocation
)
}
else
{
self
.
_components
.
sourceHighlighter
.
currentSourceLocation
(
null
)
...
...
src/app/editor/contextView.js
View file @
b75dd57a
...
...
@@ -98,7 +98,7 @@ class ContextView {
}
}
if
(
self
.
_deps
.
compiler
.
lastCompilationResult
&&
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
)
{
var
lineColumn
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
)
var
lineColumn
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
)
var
filename
=
self
.
_deps
.
compiler
.
getSourceName
(
position
.
file
)
// TODO: refactor with rendererAPI.errorClick
if
(
filename
!==
self
.
_deps
.
config
.
get
(
'currentFile'
))
{
...
...
src/app/editor/contextualListener.js
View file @
b75dd57a
...
...
@@ -114,7 +114,7 @@ class ContextualListener {
_highlightInternal
(
position
,
node
)
{
var
self
=
this
if
(
self
.
_deps
.
compiler
.
lastCompilationResult
&&
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
)
{
var
lineColumn
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
)
var
lineColumn
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
)
var
css
=
'highlightreference'
if
(
node
.
children
&&
node
.
children
.
length
)
{
// If node has children, highlight the entire line. if not, just highlight the current source position of the node.
...
...
src/app/staticanalysis/staticAnalysisView.js
View file @
b75dd57a
...
...
@@ -20,6 +20,7 @@ function staticAnalysisView (localRegistry) {
this
.
runner
=
new
StaticAnalysisRunner
()
this
.
modulesView
=
renderModules
(
this
.
runner
.
modules
())
this
.
lastCompilationResult
=
null
this
.
lastCompilationSource
=
null
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globlalRegistry
// dependencies
...
...
@@ -31,9 +32,11 @@ function staticAnalysisView (localRegistry) {
self
.
_deps
.
compiler
.
event
.
register
(
'compilationFinished'
,
function
(
success
,
data
,
source
)
{
self
.
lastCompilationResult
=
null
self
.
lastCompilationSource
=
null
$
(
'#staticanalysisresult'
).
empty
()
if
(
success
)
{
self
.
lastCompilationResult
=
data
self
.
lastCompilationSource
=
source
if
(
self
.
view
.
querySelector
(
'#autorunstaticanalysis'
).
checked
)
{
self
.
run
()
}
...
...
@@ -94,7 +97,7 @@ staticAnalysisView.prototype.run = function () {
start
:
parseInt
(
split
[
0
]),
length
:
parseInt
(
split
[
1
])
}
location
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
location
,
file
)
location
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
location
,
file
,
self
.
lastCompilationSource
.
sources
)
location
=
Object
.
keys
(
self
.
lastCompilationResult
.
contracts
)[
file
]
+
':'
+
(
location
.
start
.
line
+
1
)
+
':'
+
(
location
.
start
.
column
+
1
)
+
':'
}
warningCount
++
...
...
src/lib/offsetToLineColumnConverter.js
View file @
b75dd57a
...
...
@@ -10,10 +10,10 @@ function offsetToColumnConverter (compilerEvent) {
})
}
offsetToColumnConverter
.
prototype
.
offsetToLineColumn
=
function
(
rawLocation
,
file
,
compilationResult
)
{
offsetToColumnConverter
.
prototype
.
offsetToLineColumn
=
function
(
rawLocation
,
file
,
sources
)
{
if
(
!
this
.
lineBreakPositionsByContent
[
file
])
{
var
filename
=
Object
.
keys
(
compilationResult
.
data
.
sources
)[
file
]
this
.
lineBreakPositionsByContent
[
file
]
=
this
.
sourceMappingDecoder
.
getLinebreakPositions
(
compilationResult
.
source
.
sources
[
filename
].
content
)
var
filename
=
Object
.
keys
(
sources
)[
file
]
this
.
lineBreakPositionsByContent
[
file
]
=
this
.
sourceMappingDecoder
.
getLinebreakPositions
(
sources
[
filename
].
content
)
}
return
this
.
sourceMappingDecoder
.
convertOffsetToLineColumn
(
rawLocation
,
this
.
lineBreakPositionsByContent
[
file
])
}
...
...
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