有什么方法可以禁用项目的语法检查吗? [英] Any way to disable syntax checking for a project?

查看:54
本文介绍了有什么方法可以禁用项目的语法检查吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个项目示例代码" ...在这里,我只是粘贴示例代码...其中大部分是无法编译的代码段.

I created a project "Sample Code"... here I just paste sample code... much of it is snippets that won't compile.

是否可以进行一些特定于项目的设置,以使Eclipse不会尝试对其进行编译?

Is there some project-specific setting I can make so that Eclipse doesn't try to compile it?

我不希望源代码中堆满红色错误标记.

I would prefer not to have the source code littered with red error markers.

推荐答案

我的解决方案

好的,这不是解决我问题的确切方法...但这是另一种解决方法,我现在很喜欢...

ok, this is not an exact solution to my problem... but it is another way to do it and I kinda like it now...

我只是忘了使用Eclipse存储示例Java文件!

我为Mac找到了一个很好的程序 CodeBox ,用于存储代码段,而且我确信Windows,Linux上也存在此类内容...

I found a good program CodeBox for Mac to store code snippets and I'm sure there exist such things for Windows, Linux too...

有趣的是,当我从该程序中选择要在外部编辑器(Eclipse)中打开Java代码段文件(.java)时,它将在Eclipse 中打开而没有任何语法检查...哇!没有波浪线

there interesting thing is that when I choose from this program to open the java snippet file (.java) in an external editor (Eclipse), it will open in Eclipse without any Syntax checking... wohoo! no squiggly lines

因此,它不是高亮显示的代码...类和变量的颜色相同...但这没关系..仍然很可读.远远超过在Eclipse中运行语法高亮显示的情况...

Because of this, it is not full blown code highlighting... classes and variables same color... but that's ok.. still quite readable. Much more than if it was in Eclipse with syntax highlighting running on it...

因此,基本上,如果您想摆脱这些红色的花样,一种方法是不要在Eclipse的项目中保留示例.java(或其他语言)文件...只需将它们保存在文件系统或代码存储应用程序,并在要查看它们时使用Eclipse打开它们.

So basically, if you want to get rid of these red squiggles... one way to do it is don't keep sample .java (or other language) files in a project in Eclipse... simply keep them in the filesystem or code storage app and open them with Eclipse when you want to view them.

这篇关于有什么方法可以禁用项目的语法检查吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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