Skip to content

Instantly share code, notes, and snippets.

Last active October 23, 2021 14:07
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Metaxal/a9dc34faaff4ec7e3c7872b63cc1b76f to your computer and use it in GitHub Desktop.
Rename identifier quickscript, like in the right-click menu item
#lang racket/base
(require quickscript
;;; License: [Apache License, Version 2.0]( or
;;; [MIT license]( at your option.
(script-help-string "Rename the identifier under the cursor (if check syntax succeeded)")
(define-script rename-identifier
#:label "Rename &Identifier"
#:menu-path ("Re&factor")
(λ (selection #:definitions defs)
(define kmap (send defs get-keymap))
;; The last `#true` argument ensures that all keymaps in the chain are tried.
(send kmap call-function (string-constant cs-rename-id) defs (new event%) #true)))
(module url2script-info racket/base
(provide filename url)
(define filename "rename-identifier.rkt")
(define url ""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment