-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
298 lines (251 loc) · 13 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
fun properties(key: String) = project.findProperty(key).toString()
// https://github.com/JetBrains/gradle-intellij-plugin
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "2.0.21"
id("org.jetbrains.intellij") version "1.17.4"
}
group = properties("pluginGroup")
version = properties("pluginVersion")
repositories {
mavenCentral()
}
dependencies {
// https://github.com/junit-team/junit5-samples/blob/main/junit5-jupiter-starter-gradle-kotlin/build.gradle.kts
testImplementation(platform("org.junit:junit-bom:5.11.3"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij {
pluginName.set(properties("pluginName"))
version.set(properties("platformVersion"))
// type.set(properties("platformType"))
// Do not set an until build: https://intellij-support.jetbrains.com/hc/en-us/community/posts/14610689926674/comments/14625872002706
updateSinceUntilBuild.set(false)
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
}
tasks {
// Set the JVM compatibility versions
properties("javaVersion").let {
withType<JavaCompile> {
sourceCompatibility = it
targetCompatibility = it
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = it
}
}
wrapper {
gradleVersion = properties("gradleVersion")
}
runPluginVerifier {
ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty))
}
// Disable building searchableOptions as this isn't beneficial for this plugin.
// From the FAQ: As a result of disabling building searchable options,
// the configurables that your plugin provides won't be searchable in the Settings dialog.
// https://github.com/JetBrains/gradle-intellij-plugin/blob/master/FAQ.md
buildSearchableOptions {
enabled = false
}
patchPluginXml {
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
pluginDescription.set("""
Quickly toggle words and symbols with a hotkey. Toggles can be configured from the settings menu.
<br><br>
Do you really like Toggler? Consider giving a star on <a href="https://github.com/Noorts/Toggler">GitHub</a> or leaving a review on the <a href="https://plugins.jetbrains.com/plugin/16166-toggler">JetBrains marketplace</a>.
<br><br>
Did you find a bug or do you have a feature request? Feel free to open an issue on <a href="https://github.com/Noorts/Toggler/issues">GitHub</a>.
<br>
<h3>Features</h3>
<ul>
<li>Customizable through the settings menu.</li>
<li>Support for multiple cursors.</li>
<li>Support for numerous toggles.</li>
<li>Support for partial matches.</li>
<li>Limited support for transferring word case.</li>
<li>Easy importing and exporting of the JSON configuration.</li>
<li>No external dependencies required.</li>
</ul>
<h3>Usage</h3>
Select or place your cursor on a word/symbol and press the hotkey
(by default <kbd>Ctrl+Shift+X</kbd> on Windows or <kbd>Cmd+Shift+X</kbd> on macOS) to
toggle the word/symbol to the next toggle defined in the configuration file (wrapping around when it reaches the end).
The shortcut can be changed from <kbd>Settings/Preferences -> Keymap -> Plug-ins -> Toggler</kbd>.
The toggle action can also be found as <kbd>Toggle Word/Symbol</kbd> in the <kbd>Edit</kbd> menu.
<br><br>
The normal action toggles forward (e.g., 1, 2, 3, 1). A reverse toggle action can be used to toggle backwards (e.g., 1, 3, 2, 1).
By default it is mapped to <kbd>Ctrl+Shift+Alt+X</kbd> on Windows and <kbd>Cmd+Shift+Opt+X</kbd> on macOS.
<br><br>
The partial matching functionality allows for substrings of words/symbols to be toggled. E.g. <code>getName</code> could be
toggled to <code>setName</code> by placing the cursor anywhere on <code>get</code> and then activating the toggle action.
The largest match found is prioritised. This means that if you have the following toggles configured <code>["dev", "prod"],
["development", "production"]</code> and toggle <code>development</code>, then it will be replaced with <code>production</code>. The partial
matching functionality can be bypassed by using your cursor to create a precise selection of the sub word/symbol you
want to toggle. The partial matching functionality (which is enabled by default) can also be disabled completely in
the configuration menu.
<h3>Configuration</h3>
You can configure the toggles in your IDE by going to <kbd>Settings/Preferences -> Tools -> Toggler</kbd>.
<br><br>
Toggles can be added and removed by modifying the JSON inside the configuration menu and subsequently
pressing the <code>Apply</code> button. The <code>Import</code>, <code>Export</code> and <code>Reset to Defaults</code> buttons have been added for convenience.
<br><br>
The following <a href="https://github.com/Noorts/Toggler/blob/master/src/main/java/core/Config.java#L11">boundary characters</a>
are used for word/symbol selection internally and thus can't be used inside the toggles
<code>' ', ';', ':', '.', ',', '`', '"', ''', '(', ')', '[', ']', '{', '}', '\t'</code>.
<br><br>
Default <a href="https://github.com/Noorts/Toggler/blob/master/src/main/java/core/Config.java#L22">toggles</a>
are included with every fresh installment.
<h3>Roadmap</h3>
The roadmap can be found on the <a href="https://github.com/users/Noorts/projects/2">Toggler board</a>.
<h3>Contribute</h3>
Want to contribute? Check out the <a href="https://github.com/Noorts/Toggler/tree/master#contribute">contribute</a> section over on GitHub.
<h3>Alternatives</h3>
If you're looking for more text manipulation features,
then check out <a href="https://plugins.jetbrains.com/plugin/6149-shifter">Shifter</a>.
Which also includes a dictionary (with custom symbols/words) just like Toggler
and includes many other nice features.
</ul>
<h3>Acknowledgements</h3>
This plugin has drawn a lot of inspiration from <a href="https://github.com/HiDeoo">HiDeoo</a> his
original versions of toggle plugins/extensions
for <a href="https://marketplace.visualstudio.com/items?itemName=hideoo.toggler">VSCode</a>
and <a href="https://atom.io/packages/toggler">Atom</a>.
""")
changeNotes.set("""
For all changes check out: <a href="https://github.com/Noorts/Toggler/commits">https://github.com/Noorts/Toggler/commits</a>
<br><br>
[1.4.1] - 2024-12-01
<ul>
<li>Addressed a deprecation. See: <a href="https://github.com/Noorts/Toggler/issues/80">#80</a>.</li>
</ul><br>
[1.4.0] - 2024-05-12
<ul>
<li>This update includes internal version bumps to stay compatible with the newest IDE versions.</li>
<li>The minimum IDE version has been bumped from 2021.1.3 to 2022.3.1. The plugin is now compatible with any IDE
versions from 2022.3.1 onwards.</li>
<li>Addressed a deprecation. See: <a href="https://github.com/Noorts/Toggler/issues/64">#64</a>.</li>
</ul><br>
[1.3.1] - 2024-02-01
<ul>
<li>The plugin is now automatically compatible with any IDE versions from 2021.1 onwards.</li>
</ul><br>
[1.3.0] - 2024-01-31
<ul>
<li>The reverse toggle action has been added! Instead of forwards (e.g., 1, 2, 3, 1), it is now also possible to toggle backwards with the reverse toggle action (e.g., 1, 3, 2, 1). By default the new action is bound to <kbd>Ctrl/Cmd + Shift + Alt/Opt + X</kbd>. The keybind can be changed under <kbd>Settings/Preferences -> Keymap -> Plug-ins -> Toggler</kbd>.</li>
<li>Update internal plugins.</li>
<li>Plugin description updated.</li>
</ul><br>
[1.2.14] - 2023-11-12
<ul>
<li>Extend plugin IDE compatibility range from 2023.2 to 2023.3.</li>
<li>Update internal plugins.</li>
</ul><br>
[1.2.13] - 2023-06-10
<ul>
<li>Extend plugin IDE compatibility range from 2023.1 to 2023.2.</li>
<li>Update internal plugins.</li>
</ul><br>
[1.2.12] - 2023-02-26
<ul>
<li>Extend plugin IDE compatibility range to 2021.1 to 2023.1.</li>
<li>Upgrade Gradle to 7.6.1.</li>
<li>Update internal plugins.</li>
</ul><br>
[1.2.11] - 2022-11-14
<ul>
<li>Extend plugin IDE compatibility range from 2022.2 to 2022.3.</li>
<li>Update plugin description.</li>
</ul><br>
[1.2.10] - 2022-11-12
<ul>
<li>Add limited support for tabs as whitespace. See: <a href="https://github.com/Noorts/Toggler/issues/20">#20</a>.</li>
</ul><br>
[1.2.9] - 2022-08-21
<ul>
<li>Update plugin description.</li>
<li>Upgrade Gradle to 7.5.1.</li>
<li>Expand integration tests.</li>
<li>Improve internal organization.</li>
</ul><br>
[1.2.8] - 2022-08-20
<ul>
<li>Fix Toggler configuration menu bug, which caused the menu to not show up due to incompatibility with external plugins. See: <a href="https://github.com/Noorts/Toggler/issues/5">#5</a>.</li>
</ul><br>
[1.2.7] - 2022-07-19
<ul>
<li>Extend plugin IDE compatibility range from 2022.1 to 2022.2.</li>
</ul><br>
[1.2.6] - 2022-07-17
<ul>
<li>Extend plugin IDE compatibility range from 2021.3 to 2022.1.</li>
<li>Upgrade Gradle to 7.5 and migrate build configs.</li>
<li>Expand tests.</li>
</ul><br>
[1.2.5] - 2022-02-13
<ul>
<li>Improve plugin description.</li>
<li>Add alternatives section to plugin description.</li>
</ul><br>
[1.2.4] - 2021-12-29
<ul>
<li>Add confirmation dialog to the "Reset to Defaults" button in the configuration menu.</li>
<li>Replace console system errors with error notifications.</li>
<li>Improve code quality.</li>
</ul><br>
[1.2.3] - 2021-09-11
<ul>
<li>Removed deprecated API methods. This improves the plugin its compatibility for future IDE versions.</li>
<li>Fixed a JsonParser bug that prevented the number 4 from being added to a toggle.</li>
</ul><br>
[1.2.2] - 2021-08-02
<ul>
<li>Bug caused by folded text in the editor has been fixed.</li>
<li>The position of the Toggler action in the IDE menu has been adjusted.</li>
<li>Handling of error when no text can be selected has been improved.</li>
<li>The no match found notification has been changed slightly.</li>
</ul><br>
[1.2.1] - 2021-07-08
<ul>
<li>The plugin is now compatible with IDE builds from 2020.3 and onwards. Under the hood the notification system was updated which improves compatibility with future versions of the JetBrains products. This also means that older IDE versions (prior to 2020.3/203.4341) are no longer supported as of this update.</li>
</ul><br>
[1.2.0] - 2021-07-07
<ul>
<li>The partial matching functionality has finally been added! It is now possible to toggle a partial match such as 'add' inside of 'addClass'. The new functionality is enabled by default and can be disabled in the configuration.</li>
<li>Unit tests were added to improve the development of Toggler.</li>
<li>Plugin description updated.</li>
</ul><br>
[1.1.2] - 2021-04-15
<ul>
<li>Additional boundary characters have been added. They are now set to the following: <kbd>' ', ';', ':', '.', ',', '`', '"', ''', '(', ')', '[', ']', '{', '}'</kbd></li>
</ul><br>
[1.1.1] - 2021-03-17
<ul>
<li>Words inside of apostrophes will now be detected correctly.</li>
<li>Boundary characters will now be detected inside of the configuration JSON to prevent invalid toggles.</li>
<li>Default spacing inside of the configuration JSON is now set to a tab instead of 4 spaces to improve the configuration experience.</li>
</ul><br>
[1.1.0] - 2021-02-26
<ul>
<li>Total rewrite of the word/symbol selection system to allow for better selection of symbols.
Note: the system hasn't been tested extensively yet. Use at your own risk.</li>
<li>It is now possible to toggle multiple carets that are on the same line.</li>
<li>Plugin description updated.</li>
<li>Notification clarity improved.</li>
</ul><br>
[1.0.1] - 2021-02-25
<ul>
<li>Plugin description updated.</li>
<li>Plugin now compatible with builds from 2019.1 until 2021.2.</li>
<li>Miscellaneous developer tweaks.</li>
</ul><br>
[1.0.0] - 2021-02-22
<ul>
<li>Initial version.</li>
</ul><br>
""")
}
}