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

Make plugin dynamic #71

Closed
rock3r opened this issue Jul 27, 2022 · 3 comments
Closed

Make plugin dynamic #71

rock3r opened this issue Jul 27, 2022 · 3 comments

Comments

@rock3r
Copy link
Contributor

rock3r commented Jul 27, 2022

The plugin requires an IDE restart every time it's updated. It would be great if it could be made properly dynamic, so it can be loaded/unloaded/updated without having to restart the IDE.

tnorbye added a commit that referenced this issue Jul 28, 2022
Misc code cleanup (such as a new FormattingTask object which
passes around state for the formatting job, such that it no
longer has to have the hacky parameter order list in the options
class etc).

Plus 1.5.5 work:
- Fixed the following bugs:
   - #53: The collapse-single-line setting does not work in the IDE
   - #69: Paragraph + list (stability), variation 2
   - #70: Multi-line @link isn't converted if there's a #
   - #71: Make plugin dynamic
   - #72: @param with brackets is not supported
   - A bug where `<p>` paragraphs following a blank line would be
     deleted (without leaving a blank paragraph separator)
- Changed heuristics around optimal or greedy line breaking in list
  items and for KDoc tag and TODO-item paragraph formatting.
- The .editorconfig support is improved. It will now pick up the nearest
  applicable .editorconfig settings for a file, but any options
  explicitly set from the command line will override the .editor config.
   - Also, the "collapse documents that fit on a single line" option,
     instead of just defaulting to true, will now use the default
     specified for the equivalent setting for Java (if set), ensuring a
     more consistent codebase. (You can also set it for Kotlin using
     `ij_kotlin_doc_do_not_wrap_if_one_line`, though that option isn't
     supported in the IDE or by the Kotlin plugin currently.)
- Preliminary support for formatting line comments and block comments
  (enabled via new flags, `--include-line-comments` and
  `--include-block-comments`.)
- Misc IDE plugin improvements
- `<pre>` tags are converted into KDoc preformatted blocks
@tnorbye
Copy link
Owner

tnorbye commented Jul 28, 2022

This is fixed in 1.5.5 (uploaded to the marketplace pending JetBrains approval) - there's also a plugin zip available in the releases section here.

The reason it wasn't dynamic was surprising; it was because of this entry in the plugin.xml:

    <group>
    <add-to-group group-id="ProjectViewPopupMenuModifyGroup" anchor="after" relative-to-action="ReformatCode" />
      <reference ref="ReflowKDoc"/>
    </group>

I was surprised that an XML action registration could have that effect -- but discovered by commenting out different parts of my plugin to see where the problems were. In any case I've just commented this part out; having the Reformat action show up in the file menu isn't important now that the plugin also hooks into the IDE formatting machinery (it didn't use to).

@tnorbye tnorbye closed this as completed Jul 28, 2022
@rock3r
Copy link
Contributor Author

rock3r commented Jul 29, 2022

Thanks Tor! I'll pass the info along to the platform team, seems weird to me too that the action XML could cause it not to be dynamic.

@yole
Copy link

yole commented Aug 1, 2022

This requirement is explicitly documented:
https://plugins.jetbrains.com/docs/intellij/dynamic-plugins.html#action-group-requires-id

In this case the <group> is not needed at all; <add-to-group> can be used directly as a child of the <reference> element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants