resyntax
resyntax copied to clipboard
A Racket refactoring engine
Resyntax allows limiting the number of fixes it will apply via a `--max-fixes` flag. When used with the Autofixer, this can result in confusion because Resyntax will leave files in...
```scheme #lang resyntax/test test: "let in function argument can be extracted" -------------------- #lang racket (define (f) (g (let ([x 42]) (* x 2)) (let ([y 100]) (* y 3)))) --------------------...
```scheme #lang resyntax/test test: "with-output-to-string should be used when equivalent" -------------------- #lang racket (define (f) (define os (open-output-string)) (parameterize ([current-output-port os]) (displayln "foo") (get-output-string os))) -------------------- -------------------- #lang racket (define...
Resyntax currently rewrites this: ```scheme `("foo" "bar") ``` Into this: ``` (list "foo" "bar") ``` This is a side effect of the rule that gets rid of unnecessary quasiquotation. That...
This is due to deficiencies in the identifier usage analyzer.
Consider the `hash-ref-set!-to-hash-ref!` rule: ```scheme (define-refactoring-rule hash-ref-set!-to-hash-ref! #:description "This expression can be replaced with a simpler, equivalent `hash-ref!` expression." #:literals (hash-ref hash-set! define) (hash-ref h1:id k1:pure-expression (_:lambda-by-any-name () (define v1:id...
The Autofixer is quite useful, but requires a lot of fiddly manual setup. Even with the custom action I've created, setting up weekly Autofixer pull requests requires creating a new...
Saw a few cases in racket/typed-racket#1410 where `#:when` would clean up various bits of pattern matching code: ```scheme #lang resyntax/test test: "original code should be refactorable to new code" --------------------...
Encountered [here](https://github.com/racket/typed-racket/pull/1410/files/daa1906f94ff9129873ab9451a92e74ed9f90610#r1834956957): ```scheme #lang resyntax/test test: "root-level and pattern can be removed when matching on a variable" -------------------- #lang racket (define (f xs) (match xs [(and foo (list x y...