JetBrains / resharper-rider-plugin

https://www.jetbrains.com/help/resharper/sdk/
https://www.jetbrains.org/intellij/sdk/docs/
Apache License 2.0
171 stars 43 forks source link

Writing plugin to extend formatting #83

Closed asgerhallas closed 10 months ago

asgerhallas commented 10 months ago

I'm curious if this is also the place to start - or if it's even possible - to extend code cleanup with some special rules?

I have been through the samples and can't see any related to that, so it would be really nice, if you could point me in the right direction - given that there is a right direction :)

osdm commented 10 months ago

Hi @asgerhallas ! Could you describe what kind of rules do you want to extend? Are they formatting rules (like indenting, line breaks, etc) or some syntax rules?

asgerhallas commented 10 months ago

@osdm Sure, I'm looking to extend a line break rule for methods invocations, that says something along the lines of: Never break before an argument, if there's only one argument (with some exceptions though). So a formatting rule.

osdm commented 10 months ago

@asgerhallas Please take a look at https://github.com/JetBrains/resharper-formatter-quirks. We haven't blogged about it yet, but you can use it to study how to extend the ReSharper's formatter.

asgerhallas commented 10 months ago

@osdm Ah there it was! I saw the plugin in the lists of plugins, but couldn't find the source :) Thanks a lot!