Code assist for javascript in HTML files not working well in Aptana 3
Asked Answered
C

2

3

I'm beginning to use Aptana3 for web development, when using javascript inside a html file I get fewer suggestions than when I work in .js file. I took this screenshots:

HTML file

https://www.dropbox.com/s/31fn0samrk8cbbf/html.jpeg

javascript file

https://www.dropbox.com/s/ej135t5k9v3w3j9/jscript.jpeg

So basically in html i get poor suggestions for javascript.

What can I do?

Casket answered 20/10, 2012 at 17:34 Comment(3)
It is good practice to keep your js code in .js files, separate from the .html file. I would go with the flow, and not keep js code in html.Indeliberate
Thats what I'm doing for now, still it would be good to have the choice.Casket
any news on this? I'm getting the same behavior. @Indeliberate there are cases where creating a new file or importing a big js file is an overkill, so it would be create if there is a fix about thisCloninger
D
2

Try changing the default editor for .html files to the Aptana JS Editor.

Go to Preferences > General > Editors -> File Associations

Then select *.html from the top list and Aptana JS Editor in the bottom list, then press the 'Default' button.

Dramaturgy answered 12/11, 2012 at 21:32 Comment(1)
except that in latest version we cannot see this option anymore... :\Serilda
H
2

I think that is related to JFlex (scanner generator used by Aptana) that will skip <script> inside HTML. When I added new lexical rule the JFlex to include the <script type="application/javascript">, Aptana Studio 3 will display JavaScript content assist inside HTML. https://github.com/JockiHendry/aptanastudio-contentassist-patch

Harmonia answered 21/1, 2013 at 19:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.