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
d0c14614
Commit
d0c14614
authored
May 12, 2020
by
yann300
Committed by
ioedeveloper
Jul 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check is ast present
parent
075867a5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
compiler-abstract.js
apps/remix-ide/src/app/compiler/compiler-abstract.js
+4
-0
offsetToLineColumnConverter.js
apps/remix-ide/src/lib/offsetToLineColumnConverter.js
+6
-0
No files found.
apps/remix-ide/src/app/compiler/compiler-abstract.js
View file @
d0c14614
...
@@ -32,6 +32,10 @@ module.exports = class CompilerAbstract {
...
@@ -32,6 +32,10 @@ module.exports = class CompilerAbstract {
getSourceName
(
fileIndex
)
{
getSourceName
(
fileIndex
)
{
if
(
this
.
data
&&
this
.
data
.
sources
)
{
if
(
this
.
data
&&
this
.
data
.
sources
)
{
return
Object
.
keys
(
this
.
data
.
sources
)[
fileIndex
]
return
Object
.
keys
(
this
.
data
.
sources
)[
fileIndex
]
}
else
if
(
Object
.
keys
(
this
.
source
.
sources
).
length
===
1
)
{
// if we don't have ast, we return the only one filename present.
const
sourcesArray
=
Object
.
keys
(
this
.
source
.
sources
)
return
sourcesArray
[
0
]
}
}
return
null
return
null
}
}
...
...
apps/remix-ide/src/lib/offsetToLineColumnConverter.js
View file @
d0c14614
...
@@ -19,6 +19,11 @@ export class OffsetToLineColumnConverter extends Plugin {
...
@@ -19,6 +19,11 @@ export class OffsetToLineColumnConverter extends Plugin {
offsetToLineColumn
(
rawLocation
,
file
,
sources
,
asts
)
{
offsetToLineColumn
(
rawLocation
,
file
,
sources
,
asts
)
{
if
(
!
this
.
lineBreakPositionsByContent
[
file
])
{
if
(
!
this
.
lineBreakPositionsByContent
[
file
])
{
const
sourcesArray
=
Object
.
keys
(
sources
)
if
(
!
asts
&&
file
===
0
&&
sourcesArray
.
length
===
1
)
{
// if we don't have ast, we process the only one available content
this
.
lineBreakPositionsByContent
[
file
]
=
this
.
sourceMappingDecoder
.
getLinebreakPositions
(
sources
[
sourcesArray
[
0
]].
content
)
}
else
{
for
(
var
filename
in
asts
)
{
for
(
var
filename
in
asts
)
{
var
source
=
asts
[
filename
]
var
source
=
asts
[
filename
]
if
(
source
.
id
===
file
)
{
if
(
source
.
id
===
file
)
{
...
@@ -27,6 +32,7 @@ export class OffsetToLineColumnConverter extends Plugin {
...
@@ -27,6 +32,7 @@ export class OffsetToLineColumnConverter extends Plugin {
}
}
}
}
}
}
}
return
this
.
sourceMappingDecoder
.
convertOffsetToLineColumn
(
rawLocation
,
this
.
lineBreakPositionsByContent
[
file
])
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