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
de729819
Commit
de729819
authored
Nov 27, 2017
by
ninabreznik
Committed by
yann300
Dec 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add getter (getActiveHighlights) and remove unused api reference
parent
5a404f06
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
app.js
src/app.js
+0
-1
contextView.js
src/app/editor/contextView.js
+3
-2
contextualListener.js
src/app/editor/contextualListener.js
+4
-0
No files found.
src/app.js
View file @
de729819
...
@@ -349,7 +349,6 @@ function run () {
...
@@ -349,7 +349,6 @@ function run () {
// ---------------- ContextView -----------------------
// ---------------- ContextView -----------------------
this
.
_components
.
contextView
=
new
ContextView
({
this
.
_components
.
contextView
=
new
ContextView
({
contextualListener
:
this
.
_components
.
contextualListener
,
contextualListener
:
this
.
_components
.
contextualListener
,
editor
:
editor
,
jumpTo
:
(
position
)
=>
{
jumpTo
:
(
position
)
=>
{
if
(
compiler
.
lastCompilationResult
&&
compiler
.
lastCompilationResult
.
data
)
{
if
(
compiler
.
lastCompilationResult
&&
compiler
.
lastCompilationResult
.
data
)
{
var
lineColumn
=
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
compiler
.
lastCompilationResult
)
var
lineColumn
=
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
compiler
.
lastCompilationResult
)
...
...
src/app/editor/contextView.js
View file @
de729819
...
@@ -115,6 +115,7 @@ class ContextView {
...
@@ -115,6 +115,7 @@ class ContextView {
}
}
_render
(
node
)
{
_render
(
node
)
{
console
.
log
(
'rendering'
)
if
(
!
node
)
return
yo
`<div></div>`
if
(
!
node
)
return
yo
`<div></div>`
var
self
=
this
var
self
=
this
var
references
=
this
.
_api
.
contextualListener
.
referencesOf
(
node
)
var
references
=
this
.
_api
.
contextualListener
.
referencesOf
(
node
)
...
@@ -135,7 +136,7 @@ class ContextView {
...
@@ -135,7 +136,7 @@ class ContextView {
if
(
currentName
===
this
.
refName
)
{
if
(
currentName
===
this
.
refName
)
{
this
.
ref
=
this
.
ref
===
undefined
?
0
:
this
.
ref
this
.
ref
=
this
.
ref
===
undefined
?
0
:
this
.
ref
}
else
{
this
.
ref
=
0
}
}
else
{
this
.
ref
=
0
}
var
nodes
=
self
.
_api
.
contextualListener
.
_activeHighlights
var
nodes
=
self
.
_api
.
contextualListener
.
getActiveHighlights
()
self
.
_api
.
jumpTo
(
nodes
[
this
.
ref
].
position
)
self
.
_api
.
jumpTo
(
nodes
[
this
.
ref
].
position
)
this
.
ref
=
(
this
.
ref
+
1
)
%
nodes
.
length
this
.
ref
=
(
this
.
ref
+
1
)
%
nodes
.
length
this
.
refName
=
currentName
this
.
refName
=
currentName
...
@@ -146,7 +147,7 @@ class ContextView {
...
@@ -146,7 +147,7 @@ class ContextView {
if
(
currentName
===
this
.
refName
)
{
if
(
currentName
===
this
.
refName
)
{
this
.
ref
=
this
.
ref
===
undefined
?
0
:
this
.
ref
this
.
ref
=
this
.
ref
===
undefined
?
0
:
this
.
ref
}
else
{
this
.
ref
=
0
}
// should be this.ref = ref of the selected node (loop through all nodes to find this one)
}
else
{
this
.
ref
=
0
}
// should be this.ref = ref of the selected node (loop through all nodes to find this one)
var
nodes
=
self
.
_api
.
contextualListener
.
_activeHighlights
var
nodes
=
self
.
_api
.
contextualListener
.
getActiveHighlights
()
this
.
ref
=
this
.
ref
===
undefined
?
0
:
this
.
ref
this
.
ref
=
this
.
ref
===
undefined
?
0
:
this
.
ref
self
.
_api
.
jumpTo
(
nodes
[
nodes
.
length
-
1
-
this
.
ref
].
position
)
self
.
_api
.
jumpTo
(
nodes
[
nodes
.
length
-
1
-
this
.
ref
].
position
)
this
.
ref
=
(
this
.
ref
+
1
)
%
nodes
.
length
this
.
ref
=
(
this
.
ref
+
1
)
%
nodes
.
length
...
...
src/app/editor/contextualListener.js
View file @
de729819
...
@@ -37,6 +37,10 @@ class ContextualListener {
...
@@ -37,6 +37,10 @@ class ContextualListener {
},
1000
)
},
1000
)
}
}
getActiveHighlights
()
{
return
[...
this
.
_activeHighlights
]
}
declarationOf
(
node
)
{
declarationOf
(
node
)
{
if
(
node
.
attributes
&&
node
.
attributes
.
referencedDeclaration
)
{
if
(
node
.
attributes
&&
node
.
attributes
.
referencedDeclaration
)
{
return
this
.
_index
[
'FlatReferences'
][
node
.
attributes
.
referencedDeclaration
]
return
this
.
_index
[
'FlatReferences'
][
node
.
attributes
.
referencedDeclaration
]
...
...
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