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
5a3c9ef2
Unverified
Commit
5a3c9ef2
authored
May 16, 2019
by
yann300
Committed by
GitHub
May 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update contextualListener.js
parent
0c3340e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
contextualListener.js
src/app/editor/contextualListener.js
+10
-3
No files found.
src/app/editor/contextualListener.js
View file @
5a3c9ef2
'use strict'
'use strict'
const
remixLib
=
require
(
'remix-lib'
)
const
remixLib
=
require
(
'remix-lib'
)
const
csjs
=
require
(
'csjs-inject'
)
const
SourceMappingDecoder
=
remixLib
.
SourceMappingDecoder
const
SourceMappingDecoder
=
remixLib
.
SourceMappingDecoder
const
AstWalker
=
remixLib
.
AstWalker
const
AstWalker
=
remixLib
.
AstWalker
const
EventManager
=
require
(
'../../lib/events'
)
const
EventManager
=
require
(
'../../lib/events'
)
...
@@ -115,10 +116,16 @@ class ContextualListener {
...
@@ -115,10 +116,16 @@ class ContextualListener {
let
lastCompilationResult
=
this
.
_deps
.
compilersArtefacts
[
'__last'
]
let
lastCompilationResult
=
this
.
_deps
.
compilersArtefacts
[
'__last'
]
if
(
lastCompilationResult
&&
lastCompilationResult
.
languageversion
.
indexOf
(
'soljson'
)
===
0
)
{
if
(
lastCompilationResult
&&
lastCompilationResult
.
languageversion
.
indexOf
(
'soljson'
)
===
0
)
{
let
lineColumn
=
this
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
lastCompilationResult
.
getSourceCode
().
sources
,
lastCompilationResult
.
getAsts
())
let
lineColumn
=
this
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
lastCompilationResult
.
getSourceCode
().
sources
,
lastCompilationResult
.
getAsts
())
let
css
=
'highlightreference'
const
css
=
csjs
`
.highlightref_fullLine {
position:absolute;
z-index:20;
opacity: 0.4;
background-color: var(--info);
}
`
if
(
node
.
children
&&
node
.
children
.
length
)
{
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.
// If node has children, highlight the entire line. if not, just highlight the current source position of the node.
css
=
'highlightreference'
lineColumn
=
{
lineColumn
=
{
start
:
{
start
:
{
line
:
lineColumn
.
start
.
line
,
line
:
lineColumn
.
start
.
line
,
...
@@ -132,7 +139,7 @@ class ContextualListener {
...
@@ -132,7 +139,7 @@ class ContextualListener {
}
}
const
fileName
=
lastCompilationResult
.
getSourceName
(
position
.
file
)
const
fileName
=
lastCompilationResult
.
getSourceName
(
position
.
file
)
if
(
fileName
)
{
if
(
fileName
)
{
return
this
.
editor
.
addMarker
(
lineColumn
,
fileName
,
css
)
return
this
.
editor
.
addMarker
(
lineColumn
,
fileName
,
css
.
highlightref_fullLine
.
className
)
}
}
}
}
return
null
return
null
...
...
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