Create Source Editor in Android Studio Community Edition.
Hi,
I started a intellij plugin development and I want to create a source and designer editor in the plugin. Consider I am new to intellij plugin development, can anyone tell me How I can create an editor in intellij.
Thanks
Ishan Jain
Please sign in to leave a comment.
This is far from trivial task. What exactly do you want to achieve? You can look at existing "GUI" editors (Android, Swing GUI Builder) in IntelliJ Community/Android sources).
Thanks for reply.
I have created a custom source editor with custom language. But my real task is to create a html designer editor. How can I add a GUI in the editor like xml GUI editor of android.
It would be great if you send me a link of the source where it exactly is created.
Thanks
Ishan Jain
See com.intellij.util.xml.ui.PerspectiveFileEditorProvider to provide additional tabs to switch from source to designer view. See com.intellij.android.designer.AndroidDesignerEditorProvider as reference for Android designer.
Thanks for reply.
I have tried the FileEditorProvider and also register it in the extension in plugin.xml. But when I create a file with the same extension as given in the source then it does not take that editor and instead the list of other editors which also doesnot contain my editor. I don't understand the exact problem.
Thanks
Ishan Jain
Could you share your sources? Otherwise it's impossible to diagnose what is happening here.
AFAIU LangEditor does not implement com.intellij.openapi.fileEditor.FileEditorProvider or any of its inheritors. Thus the Extension Point will be ignored. If it still doesn't work, please provide a Github URL or ZIP of project.
Thanks for reply.
In the following method of LangEditorProvider class I am returning LangEditor.
It can't match your "ext" filetype because the registration of <fileTypeFactory> assigning your custom filetype is commented out in plugin.xml. After this it works for me.
Thanks for reply.
No I have already commented out that, I have just commented in this post. Did you see the UI in the editor, the browser which I have added to the editor?
Because I only see the text editor.
I'm referring to the code in your repository you linked above. Please try to debug into accept() method and see if filetype is correctly associated with your file. And verify there is no other association via IDE settings.
Thank you very much for the reply. I have also seen the UI in the editor.
Earlier it was not showing it because I have also created another project which was giving errors.
So I reinstalled the ide and created new project. Can you also tell me one more thing that if I have created another plugin project and run it, then again run another plugin project then how can I remove the earlier cached plugins.
It also does not show in the settings window with plugin tab.
I see, clear out the sandbox directory configured in SDKs->IJ SDK->"Sandbox Home"
Hi,
Can I add New <AppName> Project in the file->New->New <App Name> Project option in the menu bar.
Thanks
Yes, you can add any Action to group NewProjectOrModuleGroup for generic setup or use EP com.intellij.projectImport.ProjectImportProvider to re-use "Import from existing sources" logic.
Hi,
Can someone provide the ".bnf" grammar file for javascript or ecmascript?
Thanks