[英]How can I create an editor for a custom code using java code
I'm reading methods from a text file and then execute them in my java program.我正在从文本文件中读取方法,然后在我的 java 程序中执行它们。 For this I'm using java reflection.为此,我使用 java 反射。 I want to know how can I create an editor for these text files so that I can have syntax coloring and code completion (and maybe later on compiling) because today these files are hard to read.我想知道如何为这些文本文件创建一个编辑器,以便我可以进行语法着色和代码完成(可能稍后在编译时),因为今天这些文件很难阅读。
Do you have any idea where should I start looking?你知道我应该从哪里开始寻找吗?
Here is an example of a lines in the file:以下是文件中一行的示例:
a := 5;
b := 6;
sum := add(a, b);
Better don't create your own text editor, it's not worth the effort.最好不要创建自己的文本编辑器,这不值得。 Just create some custom syntax highlighting, for example for IntellijIdea or any other text editor which you prefer.只需创建一些自定义语法突出显示,例如 IntellijIdea 或您喜欢的任何其他文本编辑器。 Example for IntellijIdea: https://blog.jetbrains.com/idea/2010/09/custom-file-types-in-intellij-idea/ IntellijIdea 示例: https://blog.jetbrains.com/idea/2010/09/custom-file-types-in-intellij-idea/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.