简体   繁体   English

在Aptana 3中,HTML文件中的javascript代码辅助效果不佳

[英]Code assist for javascript in HTML files not working well in Aptana 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. 我开始使用Aptana3进行Web开发,当在html文件中使用javascript时,我得到的建议比在.js文件中工作时少。 I took this screenshots: 我拍了这张截图:

HTML file HTML文件

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

javascript file javascript文件

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

So basically in html i get poor suggestions for javascript. 所以基本上在HTML中我得到的javascript建议很差。

What can I do? 我能做什么?

Try changing the default editor for .html files to the Aptana JS Editor. 尝试将.html文件的默认编辑器更改为Aptana JS编辑器。

Go to Preferences > General > Editors -> File Associations 转到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. 然后从顶部列表中选择* .html,在底部列表中选择Aptana JS Editor,然后按“默认”按钮。

I think that is related to JFlex (scanner generator used by Aptana) that will skip <script> inside HTML. 我认为这与JFlex(Aptana使用的扫描仪生成器)有关,它将跳过HTML中的<script>。 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. 当我添加新的词法规则JFlex以包含<script type =“application / javascript”>时,Aptana Studio 3将在HTML中显示JavaScript内容辅助。 https://github.com/JockiHendry/aptanastudio-contentassist-patch https://github.com/JockiHendry/aptanastudio-contentassist-patch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM