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
8be16b1f
Commit
8be16b1f
authored
Sep 25, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
highlight entire line if contains children
parent
6e83b2a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
23 deletions
+22
-23
browser-solidity.css
assets/css/browser-solidity.css
+0
-14
app.js
src/app.js
+14
-2
contextualListener.js
src/app/editor/contextualListener.js
+8
-7
No files found.
assets/css/browser-solidity.css
View file @
8be16b1f
...
...
@@ -297,20 +297,6 @@ input[type="file"] {
opacity
:
0.7
}
.highlightdeclaration
{
position
:
absolute
;
z-index
:
20
;
background-color
:
lightgrey
;
opacity
:
0.4
}
.highlightcurrent
{
position
:
absolute
;
z-index
:
20
;
background-color
:
lightgrey
;
opacity
:
0.4
}
.highlightcode
{
position
:
absolute
;
z-index
:
20
;
...
...
src/app.js
View file @
8be16b1f
...
...
@@ -394,10 +394,22 @@ function run () {
getCompilationResult
:
()
=>
{
return
compiler
.
lastCompilationResult
},
highlight
:
(
position
,
node
,
type
)
=>
{
highlight
:
(
position
,
node
)
=>
{
if
(
compiler
.
lastCompilationResult
&&
compiler
.
lastCompilationResult
.
source
&&
compiler
.
lastCompilationResult
.
source
.
target
===
config
.
get
(
'currentFile'
))
{
position
=
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
compiler
.
lastCompilationResult
)
return
editor
.
addMarker
(
position
,
config
.
get
(
'currentFile'
),
'highlight'
+
type
)
if
(
node
.
children
&&
node
.
children
.
length
)
{
position
=
{
start
:
{
line
:
position
.
start
.
line
,
column
:
0
},
end
:
{
line
:
position
.
start
.
line
+
1
,
column
:
0
}
}
}
return
editor
.
addMarker
(
position
,
config
.
get
(
'currentFile'
),
'highlightreference'
)
}
return
null
},
...
...
src/app/editor/contextualListener.js
View file @
8be16b1f
...
...
@@ -62,9 +62,10 @@ class ContextualListener {
}
}
_highlight
(
node
,
compilationResult
,
type
)
{
var
position
=
this
.
sourceMappingDecoder
.
decode
(
node
.
src
)
var
eventId
=
this
.
_api
.
highlight
(
position
,
node
,
type
)
_highlight
(
node
,
compilationResult
)
{
var
src
=
node
.
src
var
position
=
this
.
sourceMappingDecoder
.
decode
(
src
)
var
eventId
=
this
.
_api
.
highlight
(
position
,
node
)
if
(
eventId
)
{
this
.
_events
.
push
({
eventId
,
position
,
fileTarget
:
compilationResult
.
source
.
target
})
}
...
...
@@ -77,16 +78,16 @@ class ContextualListener {
var
calls
=
self
.
_index
[
'Declarations'
][
id
]
for
(
var
call
in
calls
)
{
var
node
=
calls
[
call
]
self
.
_highlight
(
node
,
compilationResult
,
'reference'
)
self
.
_highlight
(
node
,
compilationResult
)
}
}
}
if
(
node
.
attributes
&&
node
.
attributes
.
referencedDeclaration
)
{
highlights
(
node
.
attributes
.
referencedDeclaration
)
var
current
=
this
.
_index
[
'FlatReferences'
][
node
.
attributes
.
referencedDeclaration
]
this
.
_highlight
(
current
,
compilationResult
,
'declaration'
)
}
else
{
highlights
(
node
.
id
,
'current'
)
this
.
_highlight
(
current
,
compilationResult
)
}
else
if
(
node
&&
node
.
name
&&
node
.
name
!==
'FunctionDefinition'
&&
node
.
name
!==
'ContractDefinition'
&&
node
.
name
!==
'Block'
)
{
highlights
(
node
.
id
)
}
}
...
...
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