Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike: add InteliiJ plugins for macOS #25422

Closed
mostlikelee opened this issue Jan 14, 2025 · 4 comments
Closed

Spike: add InteliiJ plugins for macOS #25422

mostlikelee opened this issue Jan 14, 2025 · 4 comments
Assignees
Labels
#g-software Software product group :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. ~sub-task A technical sub-task that is part of a story. (Not QA'd. Not estimated.)

Comments

@mostlikelee
Copy link
Contributor

mostlikelee commented Jan 14, 2025

@mostlikelee mostlikelee added :product Product Design department (shows up on 🦢 Drafting board) :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. #g-software Software product group and removed :product Product Design department (shows up on 🦢 Drafting board) labels Jan 14, 2025
@mostlikelee mostlikelee added the ~sub-task A technical sub-task that is part of a story. (Not QA'd. Not estimated.) label Jan 14, 2025
@ksykulev
Copy link
Contributor

Brain dump of what I found about this before organizing it for #22463

  1. Path in which plugins are found

  2. Once path is determined each plugin in directory is either a directory or "bundled"

  3. Loading each plugin is handled by https://github.com/JetBrains/intellij-community/blob/master/platform/core-impl/src/com/intellij/ide/plugins/PluginDescriptorLoader.kt#L255 loadDescriptorFromFileOrDir

  4. There are two types of loading that occurs loadFromPluginDir or loadDescriptorFromJar

  5. loadFromPluginDir -> intelligently searches through directory via putMoreLikelyPluginJarsFirst then invokes loadDescriptorFromJar.

  6. loadDescriptorFromJar -> takes a jar and uses ImmutableZipFileDataLoader to load the plugin descriptor (usually located at /META-INF/plugin.xml). Jar files are pretty close to zip files, just slightly different headers

  7. Jetbrains created custom code to open paths in jar files as an input stream. https://github.com/JetBrains/intellij-community/blob/master/platform/util/zip/src/com/intellij/util/lang/ImmutableZipFile.java#L126

  8. Converting a path to an input stream is handled by
    https://github.com/JetBrains/intellij-community/blob/master/platform/util/zip/src/com/intellij/util/lang/Xxh3.java
    https://github.com/JetBrains/intellij-community/blob/master/platform/util/zip/src/com/intellij/util/lang/Ikv.java

  9. Once an inputstream is fetched it is loaded via loadDescriptorFromStream

  10. This finally creates an instance of IdeaPluginDescriptorImpl which has easy convenience methods for getting plugin version

@ksykulev
Copy link
Contributor

@fleet-release
Copy link
Contributor

Plugin codes weave in,
Mac users find calm reprieve,
Fleet's reach expands, believe.

@ksykulev
Copy link
Contributor

Added a lot of context and code samples into #20644. Please review that issue for more details.

@mostlikelee mostlikelee removed this from the 4.64.0-tentative milestone Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#g-software Software product group :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. ~sub-task A technical sub-task that is part of a story. (Not QA'd. Not estimated.)
Projects
None yet
Development

No branches or pull requests

4 participants