Page 1 of 1

javascript editor - parse pure object too

Posted: Wed Apr 08, 2015 10:40 am
by martin.dufka
Hi Eric,

it would be nice if your javascript editor parse pure object file too, the same as file with object array.

Stand alone files in eclipse
1. [{x:'x',y:'y'}] - array is OK
2. {x:'x',y:'y'} - generates error:

Multiple markers at this line
- Syntax error on token ":", invalid
Semicolon_full
- 1 changed line

For example, I have got extjs tabpanel with items array, where every item has its own file.

tab_panel.phtml:
....,
items : [
//detail.phtml file
<?php echo $this->render('detail.phtml'); ?>,
// attach.phtml file
<?php echo $this->render('attach.phtml'); ?>
], ....

detail.phtml content:
{
title:'detail',
html:'detail'
}

attach.phtml content:
{
title:'Attach',
html:'attach'
}

Re: javascript editor - parse pure object too

Posted: Thu Apr 09, 2015 7:46 am
by eric_suen
pure object is not valid js syntax, that should be json syntax, maybe use a json editor?

Re: javascript editor - parse pure object too

Posted: Thu Apr 09, 2015 8:04 am
by martin.dufka
Spket JSON Editor generates "Syntax error on token ":", invalid Semicolon_full" error on detail.phtml, attach.phtml files.

Re: javascript editor - parse pure object too

Posted: Fri Apr 10, 2015 5:57 am
by eric_suen
Json Editor only has syntax highlighting, I don't think it has syntax check or code assist.

Re: javascript editor - parse pure object too

Posted: Fri Apr 10, 2015 9:10 am
by martin.dufka
so it would be nice to accept {} file similary as [{}] file in JS editor. : ))))

Spket JSON Editor really generates "Syntax error on token ":", invalid Semicolon_full" error. I see this with one's own eyes on kepler eclipse. : )))