AutoLispExt icon indicating copy to clipboard operation
AutoLispExt copied to clipboard

right click on a word select a menuitem "add it to local variable" in the current defun

Open arcqiufeng opened this issue 5 years ago • 6 comments

that's could be very convenience

arcqiufeng avatar Jun 05 '20 02:06 arcqiufeng

This enhancement will make a big difference in debugging efficiency.

lisanlowa avatar Jun 10 '20 08:06 lisanlowa

it looks like VSCODE has supported to add variable to "watch" instead of "local" window. There is any other strong reasons it must add to "local" window? image

whlkw avatar Jun 12 '20 04:06 whlkw

This is what I mean:

I have the code:

(defun test()
  (setq msg "This is a test.")
  (alert msg)
)

When I right click on the word "msg" with mouse, a popup menu is called out then I can select "add it to local var". Then the codes will become this:

(defun test( / msg) (setq msg...

If the var is in lambda, is will be (lambda ( xxx / var...)....

If "add to global var", several lines will be added in the beginning of the code: ;;; Globals ;;; ===== (setq msg v1) ... ;;; End of Globals and also can provide a global var editor box....

arcqiufeng avatar Jun 12 '20 04:06 arcqiufeng

Thanks! I understand it! It looks like it is similar to this one https://github.com/Autodesk-AutoCAD/AutoLispExt/issues/2

whlkw avatar Jun 12 '20 04:06 whlkw

I would prefer a code Aktion for this operation (default keybinding Ctrl+.). image

Knowledge which Variables a localized would also make renaming of Variables possible (default keybinding F2). image

Another helpful improvement would be different highlighting for local and global variables.

Examples are from C#.

hansWurst-creator avatar Sep 03 '20 09:09 hansWurst-creator

From my understand with go to definition now implemented this should not be too complicated to implemented. Basically after checking if it is a local variable add the variable to the defun statment.

hansWurst-creator avatar Jun 01 '21 07:06 hansWurst-creator