问题描述
我正在使用Emacs 23.2。以下是我加载语义的方式: (setq semantic-default-submodes'(global-semantic-idle-scheduler-mode
global-semanticdb-minor-mode
global-semantic-idle-summary-mode
global-semantic-mru-bookmark-mode)
(语义模式1)
所以,如果我创建一个简单的java文件并访问它,我得到本地定义的方法的代码完成,类。但是我无法弄清楚如何使语义知道jdk库。例如,如果我在String变量上尝试 semantic-ia-complete-symbol
,我得到找不到'String blah'的类型
。
有没有人知道如何将jdk库加载到semanticdb中,因此可以使用像String这样的标准对象类型的代码完成?
从CEDET 1.1开始,Semantic支持通过javap检索类信息。您需要将 cedet-java-jdk-root
变量设置为JAVA_HOME,并将 semanticdb-javap-classpath
变量与Java系统jar的路径列表,如 rt.jar
等。
有(在俄语中,但你可以得到)关于设置Java完成的语义 - 请查看更多细节。
I'm using Emacs 23.2. Here's how I'm loading semantic:
(setq semantic-default-submodes '(global-semantic-idle-scheduler-mode
global-semanticdb-minor-mode
global-semantic-idle-summary-mode
global-semantic-mru-bookmark-mode))
(semantic-mode 1)
So, if I create a simple java file and visit it, I get code completion for locally defined methods and classes. But I can't figure out how to make semantic aware of jdk libraries. For example, if I try semantic-ia-complete-symbol
on a String variable, I get Cannot find types for 'String blah'
.
Does anyone know how to load the jdk libraries into semanticdb so code completion of standard object types like String are available?
Starting with CEDET 1.1, Semantic has support for retrieving class information through javap. You need to setup cedet-java-jdk-root
variable to JAVA_HOME, and populate semanticdb-javap-classpath
variable with list of paths to Java's system jars, like rt.jar
, etc.
There is an article (in Russian, but you can get translation) about setting Semantic up for Java completion - please look there for more details.
这篇关于如何在emacs语义中包含标准的jdk库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!