suggetions for plugin development
Recently, I am begin the plugin development. I come across lots of problems during the development. Some reasons are I am fresh to plugin development. I do want to give some suggestion from my perspective.
## the official api document is too simple
For example, I want to create a file by plugin. There are some words in the document:
How do I create a PSI file?
The PsiFileFactory
createFileFromText()
method creates an in-memory PSI file with the specified contents.
To save the PSI file to disk, use the PsiDirectory
add()
method.
But there are no detailed steps to describe how to create a file. So what I can do is to search the code inside Github and find the related implementaion. It's really a painful process. If the offical document could provide the detailed steps like this:
var psiFileFactory = PsiFileFactory.getInstance(project)
var curTime = Instant.now()
val createFileFromText = psiFileFactory.createFileFromText("sca-$curTime.md", result)
var directory = modFile.containingDirectory
directory.add(createFileFromText)
It would be much more useful.
## The template is too complex
I create the plugin by the template from https://github.com/JetBrains/intellij-platform-plugin-template. With no doubt, the template is very pwerful. But it's complex in the meanwhile. There are so may steps and contents in the project. It's really unfriendly to a new guy. And I belive as a template project, simplicity is very important. So some unnecessary steps should be removed.
Please sign in to leave a comment.
Thanks for the feedback. Obviously, the documentation cannot cover and describe all available use-cases, but we'll try to improve it.
Your use case is described here: https://plugins.jetbrains.com/docs/intellij/psi-files.html#how-do-i-create-a-psi-file
You can also use the in-page feedback button to suggest improvements for specific page directly.
Please consider joining our Slack community, where beginners are also welcome: https://plugins.jetbrains.com/slack/
I'm afraid the template project is as close to "most simple" as possible, given that it covers the whole publication/deployment workflow (which you can ignore until you actually release your plugin). Which steps do you consider unnecessary?