Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,43 @@
<vendor url="https://github.com/SLNE-Development/">SLNE-Development</vendor>

<description><![CDATA[
Provides inspections, code generation, line markers, and framework detection
for surf-api (Paper/Velocity/Core), surf-redis, and surf-database-r2dbc.
<p>
<b>Surf Framework</b> is a comprehensive IntelliJ IDEA plugin that enhances development experience
for projects using the Surf ecosystem: <b>surf-api</b>, <b>surf-redis</b>, and <b>surf-database-r2dbc</b>.
</p>

<h3>Features</h3>

<h4>Surf API Support (Paper/Velocity/Core)</h4>
<ul>
<li>Internal API usage detection with error highlighting</li>
<li>Event listener code generation for Paper and Velocity platforms</li>
<li>@MustBeInvokedByOverriders annotation enforcement</li>
</ul>

<h4>Surf Redis Support</h4>
<ul>
<li>Inspections for @OnRedisEvent and @HandleRedisRequest handlers</li>
<li>Detection of missing @Serializable annotations on Redis event/request/response classes</li>
<li>Parameter validation for event and request handlers</li>
<li>RequestContext leak detection to prevent misuse</li>
<li>Handler modifier validation for MethodHandles compatibility</li>
<li>Code generation for Redis event and request handlers</li>
<li>Line markers for Redis events, handlers, and publish calls</li>
<li>Postfix templates for Redis operations</li>
<li>Inlay hints for Redis sync structure keys</li>
</ul>

<h4>Surf Database R2DBC Support</h4>
<ul>
<li>Transaction context inspections</li>
</ul>

<h4>General</h4>
<ul>
<li>Automatic framework detection when Surf libraries are on the classpath</li>
<li>Facet support for project configuration</li>
</ul>
]]></description>

<depends>com.intellij.modules.compose</depends>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,43 @@
<html>
<body>
Write your description here.
Start the description with a verb in 3rd person singular, like reports, detects, highlights.
In the first sentence, briefly explain what exactly the inspection helps you detect.
Make sure the sentence is not very long and complicated.
Reports overriding methods that do not call the annotated super method.
<p>
The first sentence must be in a dedicated paragraph separated from the rest of the text. This will make the
description easier to read.
Make sure the description doesn’t just repeat the inspection title.
Detects when a method overrides a function annotated with
<code>@MustBeInvokedByOverriders</code> or <code>@OverridingMethodsMustInvokeSuper</code>
but does not include a <code>super.methodName()</code> call.
</p>
<p>
See https://plugins.jetbrains.com/docs/intellij/inspections.html#descriptions for more information.
Example of problematic code:
</p>
<pre><code>
open class Parent {
@MustBeInvokedByOverriders
open fun initialize() {
// important setup logic
}
}

class Child : Parent() {
override fun initialize() {
// Missing super.initialize() call - reported
doSomething()
}
}
</code></pre>
<p>
Embed code snippets:
Correct code:
</p>
<pre><code>
// automatically highlighted according to inspection registration 'language' attribute
class Child : Parent() {
override fun initialize() {
super.initialize() // Required call
doSomething()
}
}
</code></pre>
<!-- tooltip end -->
<p>Text after this comment will only be shown in the settings of the inspection.</p>

<p>To open related settings directly from the description, add a link with `settings://$` optionally followed by `?$` to
pre-select a UI element.</p>
<p>
The quick-fix adds a <code>super.methodName()</code> call at the beginning of the method body.
</p>
</body>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
<html>
<body>
Write your description here.
Start the description with a verb in 3rd person singular, like reports, detects, highlights.
In the first sentence, briefly explain what exactly the inspection helps you detect.
Make sure the sentence is not very long and complicated.
Reports <code>@OnRedisEvent</code> handler methods with incorrect parameter signatures.
<p>
The first sentence must be in a dedicated paragraph separated from the rest of the text. This will make the
description easier to read.
Make sure the description doesn’t just repeat the inspection title.
An <code>@OnRedisEvent</code> handler must have exactly one parameter, and that parameter
must be a subtype of <code>RedisEvent</code>. The framework uses this parameter type to
determine which events to route to the handler.
</p>
<p>
See https://plugins.jetbrains.com/docs/intellij/inspections.html#descriptions for more information.
Example of problematic code:
</p>
<pre><code>
@OnRedisEvent
fun onEvent() { } // Missing parameter

@OnRedisEvent
fun onEvent(event: MyEvent, extra: String) { } // Too many parameters

@OnRedisEvent
fun onEvent(data: String) { } // Parameter is not a RedisEvent subtype
</code></pre>
<p>
Embed code snippets:
Correct code:
</p>
<pre><code>
// automatically highlighted according to inspection registration 'language' attribute
@OnRedisEvent
fun onEvent(event: MyEvent) {
// handle event
}
</code></pre>
<!-- tooltip end -->
<p>Text after this comment will only be shown in the settings of the inspection.</p>

<p>To open related settings directly from the description, add a link with `settings://$` optionally followed by `?$` to
pre-select a UI element.</p>
<p>
Ensure the handler has exactly one parameter of a type that extends <code>RedisEvent</code>.
</p>
</body>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
<html>
<body>
Write your description here.
Start the description with a verb in 3rd person singular, like reports, detects, highlights.
In the first sentence, briefly explain what exactly the inspection helps you detect.
Make sure the sentence is not very long and complicated.
Reports <code>@OnRedisEvent</code> handler parameters that do not follow the naming convention.
<p>
The first sentence must be in a dedicated paragraph separated from the rest of the text. This will make the
description easier to read.
Make sure the description doesn’t just repeat the inspection title.
By convention, the event parameter in <code>@OnRedisEvent</code> handlers should be named
<code>event</code> for consistency and readability across the codebase.
</p>
<p>
See https://plugins.jetbrains.com/docs/intellij/inspections.html#descriptions for more information.
</p>
<p>
Embed code snippets:
Example:
</p>
<pre><code>
// automatically highlighted according to inspection registration 'language' attribute
@OnRedisEvent
fun onEvent(e: MyEvent) { } // 'e' should be renamed to 'event'

@OnRedisEvent
fun onEvent(event: MyEvent) { } // Correct
</code></pre>
<!-- tooltip end -->
<p>Text after this comment will only be shown in the settings of the inspection.</p>

<p>To open related settings directly from the description, add a link with `settings://$` optionally followed by `?$` to
pre-select a UI element.</p>
<p>
The quick-fix renames the parameter to <code>event</code>.
</p>
</body>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<html lang="en">
<body>
Write your description here.
Start the description with a verb in 3rd person singular, like reports, detects, highlights.
In the first sentence, briefly explain what exactly the inspection helps you detect.
Make sure the sentence is not very long and complicated.
Reports classes that extend <code>RedisEvent</code>, <code>RedisRequest</code>, or <code>RedisResponse</code>
but are missing the <code>@Serializable</code> annotation.
<p>
The first sentence must be in a dedicated paragraph separated from the rest of the text. This will make the
description easier to read.
Make sure the description doesn’t just repeat the inspection title.
All Redis message types must be serializable to be transmitted over the Redis pub/sub channel.
Without the <code>@Serializable</code> annotation from kotlinx.serialization, the message
cannot be encoded/decoded and will cause runtime errors.
</p>
<p>
See https://plugins.jetbrains.com/docs/intellij/inspections.html#descriptions for more information.
Example of problematic code:
</p>
<pre><code>
class MyEvent(val data: String) : RedisEvent // Missing @Serializable
</code></pre>
<p>
Embed code snippets:
Correct code:
</p>
<pre><code>
// automatically highlighted according to inspection registration 'language' attribute
@Serializable
class MyEvent(val data: String) : RedisEvent
</code></pre>
<!-- tooltip end -->
<p>Text after this comment will only be shown in the settings of the inspection.</p>

<p>To open related settings directly from the description, add a link with `settings://$` optionally followed by `?$` to
pre-select a UI element.</p>
<p>
The quick-fix adds the <code>@Serializable</code> annotation from kotlinx.serialization.
</p>
</body>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
<html>
<body>
Write your description here.
Start the description with a verb in 3rd person singular, like reports, detects, highlights.
In the first sentence, briefly explain what exactly the inspection helps you detect.
Make sure the sentence is not very long and complicated.
Reports Redis handler methods with modifiers that are incompatible with <code>MethodHandles.Lookup</code>.
<p>
The first sentence must be in a dedicated paragraph separated from the rest of the text. This will make the
description easier to read.
Make sure the description doesn’t just repeat the inspection title.
Methods annotated with <code>@OnRedisEvent</code> or <code>@HandleRedisRequest</code>
are invoked via reflection using <code>MethodHandles</code>. Certain modifiers like
<code>abstract</code>, <code>open</code>, <code>override</code>, and <code>inline</code>
can interfere with this mechanism.
</p>
<p>
See https://plugins.jetbrains.com/docs/intellij/inspections.html#descriptions for more information.
Example of problematic code:
</p>
<pre><code>
@OnRedisEvent
abstract fun onEvent(event: MyEvent) // abstract not allowed

@OnRedisEvent
open fun onEvent(event: MyEvent) { } // open not recommended

@OnRedisEvent
inline fun onEvent(event: MyEvent) { } // inline not allowed
</code></pre>
<p>
Embed code snippets:
Correct code:
</p>
<pre><code>
// automatically highlighted according to inspection registration 'language' attribute
@OnRedisEvent
fun onEvent(event: MyEvent) {
// handle event
}
</code></pre>
<!-- tooltip end -->
<p>Text after this comment will only be shown in the settings of the inspection.</p>

<p>To open related settings directly from the description, add a link with `settings://$` optionally followed by `?$` to
pre-select a UI element.</p>
<p>
The quick-fix removes the problematic modifier from the function declaration.
</p>
</body>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
<html>
<body>
Write your description here.
Start the description with a verb in 3rd person singular, like reports, detects, highlights.
In the first sentence, briefly explain what exactly the inspection helps you detect.
Make sure the sentence is not very long and complicated.
Reports Redis handler methods that are declared as <code>suspend</code> functions.
<p>
The first sentence must be in a dedicated paragraph separated from the rest of the text. This will make the
description easier to read.
Make sure the description doesn’t just repeat the inspection title.
Methods annotated with <code>@OnRedisEvent</code> or <code>@HandleRedisRequest</code>
must not be suspend functions. The Redis handler framework invokes these methods
synchronously using reflection, and suspend functions are not compatible with this mechanism.
</p>
<p>
See https://plugins.jetbrains.com/docs/intellij/inspections.html#descriptions for more information.
Example of problematic code:
</p>
<pre><code>
@OnRedisEvent
suspend fun onEvent(event: MyEvent) { // suspend not allowed
// ...
}
</code></pre>
<p>
Embed code snippets:
Correct code:
</p>
<pre><code>
// automatically highlighted according to inspection registration 'language' attribute
@OnRedisEvent
fun onEvent(event: MyEvent) {
myCoroutineScope.launch {
// async work here
}
}
</code></pre>
<!-- tooltip end -->
<p>Text after this comment will only be shown in the settings of the inspection.</p>

<p>To open related settings directly from the description, add a link with `settings://$` optionally followed by `?$` to
pre-select a UI element.</p>
<p>
The quick-fix removes the <code>suspend</code> modifier. If you need to perform
asynchronous operations, launch a coroutine inside the handler using your own
<code>CoroutineScope</code>.
</p>
</body>
</html>
</html>
Loading