Skip to content

Instantly share code, notes, and snippets.

@SebastianAigner
Last active March 4, 2021 09:45
Show Gist options
  • Save SebastianAigner/b06f50b1448f6466775b0df14fb2b35f to your computer and use it in GitHub Desktop.
Save SebastianAigner/b06f50b1448f6466775b0df14fb2b35f to your computer and use it in GitHub Desktop.
Structural Search and Replace Template to mark RComponent implementations as @JsExport

This is a template for Structural Search and Replace to mark RComponents as @JsExport. To use it, open SSR via File | Find | Replace Structurally, click on the wrench icon, and select "Import Template from Clipboard". You can then click "Find" and "Replace All" to annotate all interfaces properly.

<replaceConfiguration name="Unnamed" text="class $componentName$($propsParam$: $propsType$) : RComponent&lt;$propsType$, $stateType$&gt;($propsParam$)" recursive="false" caseInsensitive="false" type="Kotlin" pattern_context="default" reformatAccordingToStyle="false" shortenFQN="false" replacement="@JsExport&#10;class $componentName$($propsParam$: $propsType$) : RComponent&lt;$propsType$, $stateType$&gt;($propsParam$)">
  <constraint name="__context__" within="" contains="" />
  <constraint name="componentName" within="" contains="" />
  <constraint name="propsParam" within="" contains="" />
  <constraint name="propsType" within="" contains="" />
  <constraint name="stateType" within="" contains="" />
</replaceConfiguration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment