lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thomas Blom wrote:
Has anyone tried VSLua and gotten it to work?

I have been playing with the Hello World sample and the experience I have had so far is this:

- Often it will not hit the breakpoint I put in the Lua code, but occasionally it does. I can't find any repeatable reason why it does or does not work

- When it does hit the breakpoint, clicking on the "watch" icon in the VSLua toolbar doesn't do anything. I can't find any way of bringing up the watch window or looking at the value of variables.

Any similar or better experiences?


First, download the latest version from their site; the first version they put up after the initial newsgroup post was a bit dodgy. Unfortunately they didn't change the filename that get's downloaded, but the size and contents are different.

Second, ensure that the "enable vslua" box is on in the VSLua menu (blue box around it).

Did you leave all project settings intact (using LUA_500 etc)?

I also have experienced things not exactly working every time, but the latest version was almost consistently working for me.

To view the watch window, go to View->OtherWindows->VSLua Watch (if i recall correctly)

To watch a variable, double-click or otherwise highlight the var, then select the Watch command from the menu. Or, you may be able to type the var name into the watch window like the normal devstudio watch window.

Wow, that's subtle! Ok, I have it working now. But the UI is incredibly tricky and the docs don't help at all. Here are some suggestions to the developers:

- I would expect the Watch window to be available in the VSLua menu tab.

- Clicking on the "add watch" button without any variable selected should give an error dialog

- Clicking on "add watch" with a variable selected, but without the watch window up should either a) pop the watch window or b) give an error dialog. Today, if you do this, your request is silently ignored. If you bring up the watch window after doing it, your variable does not appear.

- You can double click on an empty var line in the watch window and type into the text box. But if you do this two bad things happen: a) it does not watch the variable you type in and b) subsequent selection of a variable with the same name and clicking on "add watch" silently ignores your request. You have to go into the watch window, delete that line, and "add watch" again.

- The docs should better reflect the steps needed to get up and running:
    - how to bring up and dock the VSLua toolbar
    - How to bring up and dock the watch window
    - How to click on a variable and select watch

- When I selected the word "print" in the hello world sample and hit "add watch" it came up in the watch window and correctly identified it to be of type LUA_TFUNCTION, but said its value was nil. It certainly is not nil because executing that statement correctly prints the string to the console.

- It is confusing (to me) to prefix global vars with '::', which is not Lua syntax. I think it would be better to either use '_G.' or identify its owner in some other way. In fact, it would be useful to be able to identify the object containing each property in the watch window. This would be especially if you have accidentally shadowed a global variable with a local. Also, Lua can now have undecorated variables which live in globals, locals, or any other object, thanks to setfenv. It would be useful to identify the actual object which contains the property.

- It would be nice if VSLua recognized the .lua file suffix in its default config. I had to go add it in Options before I got syntax highlighting for .lua files.

That's it for an initial pass. I hope it is not inappropriate to post this comments here. I thought it would be useful to get feedback from other Lua users!

--
chris marrin                ,""$,
chris@marrin.com          b`    $                             ,,.
                        mP     b'                            , 1$'
        ,.`           ,b`    ,`                              :$$'
     ,|`             mP    ,`                                       ,mm
   ,b"              b"   ,`            ,mm      m$$    ,m         ,`P$$
  m$`             ,b`  .` ,mm        ,'|$P   ,|"1$`  ,b$P       ,`  :$1
 b$`             ,$: :,`` |$$      ,`   $$` ,|` ,$$,,`"$$     .`    :$|
b$|            _m$`,:`    :$1   ,`     ,$Pm|`    `    :$$,..;"'     |$:
P$b,      _;b$$b$1"       |$$ ,`      ,$$"             ``'          $$
 ```"```'"    `"`         `""`        ""`                          ,P`
"As a general rule,don't solve puzzles that open portals to Hell"'