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
80be8091
Commit
80be8091
authored
Nov 28, 2017
by
ninabreznik
Committed by
yann300
Dec 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work in progress - debugging getActiveHighlights in connection with next/previous
parent
de729819
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
16 deletions
+36
-16
contextView.js
src/app/editor/contextView.js
+33
-16
contextualListener.js
src/app/editor/contextualListener.js
+3
-0
No files found.
src/app/editor/contextView.js
View file @
80be8091
...
...
@@ -115,7 +115,6 @@ class ContextView {
}
_render
(
node
)
{
console
.
log
(
'rendering'
)
if
(
!
node
)
return
yo
`<div></div>`
var
self
=
this
var
references
=
this
.
_api
.
contextualListener
.
referencesOf
(
node
)
...
...
@@ -132,26 +131,44 @@ class ContextView {
}
function
next
()
{
var
currentName
=
node
.
attributes
.
name
if
(
currentName
===
this
.
refName
)
{
this
.
ref
=
this
.
ref
===
undefined
?
0
:
this
.
ref
}
else
{
this
.
ref
=
0
}
var
nodes
=
self
.
_api
.
contextualListener
.
getActiveHighlights
()
self
.
_api
.
jumpTo
(
nodes
[
this
.
ref
].
position
)
this
.
ref
=
(
this
.
ref
+
1
)
%
nodes
.
length
this
.
refName
=
currentName
var
currentName
=
node
.
attributes
.
name
var
position
=
self
.
sourceMappingDecoder
.
decode
(
node
.
src
)
if
(
currentName
!==
self
.
refName
)
self
.
ref
=
0
var
k
=
self
.
ref
/// LOGS ///
nodes
.
forEach
(
node
=>
console
.
log
(
node
.
position
.
start
))
console
.
log
(
'----'
)
console
.
log
(
k
)
console
.
log
(
'----'
)
var
pos
=
nodes
[
k
].
position
self
.
_api
.
jumpTo
(
pos
)
self
.
ref
=
(
self
.
ref
+
1
)
%
nodes
.
length
self
.
refName
=
currentName
}
function
previous
()
{
var
currentName
=
node
.
attributes
.
name
if
(
currentName
===
this
.
refName
)
{
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)
var
nodes
=
self
.
_api
.
contextualListener
.
getActiveHighlights
()
this
.
ref
=
this
.
ref
===
undefined
?
0
:
this
.
ref
self
.
_api
.
jumpTo
(
nodes
[
nodes
.
length
-
1
-
this
.
ref
].
position
)
this
.
ref
=
(
this
.
ref
+
1
)
%
nodes
.
length
this
.
refName
=
currentName
var
currentName
=
node
.
attributes
.
name
if
(
currentName
!==
self
.
refName
)
self
.
ref
=
nodes
.
length
-
1
var
k
=
nodes
.
length
-
1
-
self
.
ref
/// LOGS ///
nodes
.
forEach
(
node
=>
console
.
log
(
node
.
position
.
start
))
console
.
log
(
'----'
)
console
.
log
(
k
)
console
.
log
(
'----'
)
var
pos
=
nodes
[
k
].
position
self
.
_api
.
jumpTo
(
pos
)
self
.
ref
=
(
self
.
ref
+
1
)
%
nodes
.
length
self
.
refName
=
currentName
}
return
yo
`<div class=
${
css
.
line
}
>
...
...
src/app/editor/contextualListener.js
View file @
80be8091
...
...
@@ -39,6 +39,9 @@ class ContextualListener {
getActiveHighlights
()
{
return
[...
this
.
_activeHighlights
]
// return [...this._activeHighlights].sort((a,b) => {
// return a.position.start - b.position.start
// })
}
declarationOf
(
node
)
{
...
...
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