Commit d86a398
committed
Improve LineReader completer updates, CTRL+C handling, and add tests
GrailsConsole improvements:
- Use updateCompleter() with LineReaderImpl.setCompleter() instead of
rebuilding the entire LineReader when completers are added
- Add dedicated initializeHistory() method that properly attaches
DefaultHistory to the LineReader after construction
- CandidateListCompletionHandler: Auto-complete common prefix in buffer
GrailsCli improvements:
- Replace manual terminal attribute manipulation and input polling with
JLine 3's native Terminal.Signal.INT handler for CTRL+C cancellation
- This is the idiomatic way to handle interrupts in JLine 3
Test coverage:
- Add comprehensive tests for GrailsConsole completer management
- Add tests for CandidateListCompletionHandler
- Add tests for all CLI completers: StringsCompleter, RegexCompletor,
ClosureCompleter, SortedAggregateCompleter, EscapingFileNameCompletor,
SimpleOrFileNameCompletor, and CommandCompleter1 parent b4e78a0 commit d86a398
12 files changed
Lines changed: 2344 additions & 29 deletions
File tree
- grails-bootstrap/src
- main/groovy
- grails/build/logging
- org/grails/build/interactive
- test/groovy
- grails/build/logging
- org/grails/build/interactive
- grails-shell-cli/src
- main/groovy/org/grails/cli
- test/groovy/org/grails/cli
- interactive/completers
- profile/commands
Lines changed: 32 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| 197 | + | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
201 | 218 | | |
202 | 219 | | |
203 | 220 | | |
| |||
263 | 280 | | |
264 | 281 | | |
265 | 282 | | |
266 | | - | |
| 283 | + | |
267 | 284 | | |
268 | 285 | | |
269 | 286 | | |
270 | 287 | | |
271 | 288 | | |
272 | | - | |
| 289 | + | |
273 | 290 | | |
274 | 291 | | |
275 | 292 | | |
276 | 293 | | |
277 | | - | |
278 | | - | |
| 294 | + | |
279 | 295 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
299 | 308 | | |
300 | 309 | | |
301 | 310 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
53 | 73 | | |
54 | 74 | | |
55 | 75 | | |
| |||
0 commit comments