Making progress... Please tell me about Editors
Hello and thanks for all the help
My Lexer seems to running properly and I have registered a
SyntaxHighlighter and a BraceMatcher. The code is getting called, and
there are no errors.
However, when I click on a Clojure file, no editor now pops up. Do I
need to register an Editor for my language. If so, how?
I am not finding anything in
http://www.jetbrains.net/confluence/display/IDEADEV/DevelopingCustomLanguagePluginsforIntelliJIDEA
I just want to use the standard text editor. How do I associate my
FileType with an editor?
Thanks
P
请先登录再写评论。
Can you post your FileType?
Hi Jay, I am guessing that returning a null EditorHighlighter is the problem. Removing that call changes the behavior (now I get an error probably to do with the Lexer).
Thanks
P
public class ClojureFileType extends LanguageFileType {
public static final ClojureFileType CLOJURE_FILE_TYPE = new
ClojureFileType();
public static final Language CLOJURE_LANGUAGE =
CLOJURE_FILE_TYPE.getLanguage();
public static final Icon CLOJURE_LOGO =
ClojureIcons.CLOJURE_ICON_16x16;
@NonNls
public static final String CLOJURE_DEFAULT_EXTENSION = "clj";
protected ClojureFileType() {
super(new ClojureLanguage());
}
@NotNull
public String getName() {
return "Clojure";
}
@NotNull
public String getDescription() {
return "Clojure file";
}
@NotNull
public String getDefaultExtension() {
return "clj";
}
final Icon CLOJURE_ICON_16x16 =
IconLoader.findIcon("/fileTypes/favicon.png");
public Icon getIcon() {
return CLOJURE_ICON_16x16;
}
public boolean isJVMDebuggingSupported() {
return true;
}
public EditorHighlighter getEditorHighlighter(@Nullable Project project, @Nullable VirtualFile virtualFile, @NotNull EditorColorsScheme colors) {
return null;
}
}
Hi Jay, I think I found the problem. My file type was returning a null
EditorHighlighter.
Thanks
P
public EditorHighlighter getEditorHighlighter(@Nullable Project project,
@Nullable VirtualFile virtualFile, @NotNull EditorColorsScheme colors) {
return null;
}