Eclipse语法突出显示无扩展文件? [英] Eclipse syntax highlighting on extensionless files?

查看:126
本文介绍了Eclipse语法突出显示无扩展文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个perl CGI脚本需要具有特定的无扩展名文件,才能从使用它的软件中正确运行。我在Ubuntu 11.04 Linux上使用Eclipse 3.7.0作为我的IDE,并没有突出显示文件的语法,也没有使用有限的自动完成功能(比如为引号和各种括号添加第二个结束标记)。右键单击>文件属性显示操作系统似乎知道它是一个perl脚本,但Eclipse显然没有。我能以某种方式告诉Eclipse使用perl语法高亮显示器来处理所有无扩展文件吗?或者,对于这个特定的文件失败了吗?

I have a perl CGI script that needs to have a specific extensionless filename to run correctly from the software that uses it. I'm using Eclipse 3.7.0 on Ubuntu 11.04 Linux as my IDE, and it's not highlighting syntax on the file nor using the limited autocomplete features (like adding a second closing tag for things like quotes and various brackets). Right click> properties on the file reveals that the OS seems to know it's a perl script, but Eclipse evidently does not. Can I somehow tell Eclipse to use the perl syntax highlighter for all extensionless files? Or, failing that, for this specific file?

推荐答案

找到解决方案,以为我可能会把它扔进这里,如果有人稍后会遇到类似的问题并遇到这个问题。

Found the solution to this, thought I might throw it in here if someone has a similar problem later and runs into this.

我所做的是创建一个指向脚本的链接,并为链接提供了.pl扩展名。这很愉快地导致Eclipse正确地解析语法。问题解决了。

What I did was create a link to the script, and gave the link a .pl extension. This happily caused Eclipse to parse the syntax correctly. Problem solved.

这篇关于Eclipse语法突出显示无扩展文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆