LuaLS / lua-language-server

A language server that offers Lua language support - programmed in Lua
https://luals.github.io
MIT License
3.38k stars 320 forks source link

[Feature Request] Remote Debugging Support #2951

Closed iandol closed 1 week ago

iandol commented 2 weeks ago

LuaLS is by far the best Lua language server. But debugging is a really important part of development (especially remote debugging given where Lua runs). I currently use https://github.com/pkulchenko/MobDebug which works well from the command line and using Zerobrane Studio, but VS Code is such a good editor. There is a vscode-mobdebug extension and luarock: https://github.com/moteus/vscode-mobdebug - but there is no documentation and it is not maintained (last commit 3 years ago). The other alternatives:

  1. LuaHelper from Tencent: all-in-one LS and debugger (uses luapanda), but LuaLS feels better for everything else.
  2. https://github.com/actboy168/lua-debug - the most installed lua debugger,but again no documentation and unstable.

Given the quality of LuaLS, I suspect if you adapted one of the other debuggers and integrated it we would have a much better experience.

CppCXY commented 1 week ago

LuaLS will not integrate debugg features, as it is not the goal of this repository. Lua-debug is indeed good for debugging, but you have overlooked another plugin, EmmyLua. The EmmyLua debugger is also extremely powerful and is written entirely in C++, offering excellent performance and ease of use.

iandol commented 1 week ago

This: https://github.com/EmmyLua/VSCode-EmmyLua ? Thanks i did not know of this option as it does not show in the top results when searching for lua debug in VS Code. Perhaps you could link it in the README here to make it easier for people to find if you seem to work on both projects it makes sense.

However, here are no clear instructions , I did find related docs https://emmylua.github.io/run/remote.html which seems to be using Mobdebug anyway? What settings for VS Code configuration.json for the remote debugger need to be set up in VS Code, dependencies, doe it heed a seperate lua file like luapanda etc.

CppCXY commented 1 week ago

This: https://github.com/EmmyLua/VSCode-EmmyLua ? Thanks i did not know of this option as it does not show in the top results when searching for lua debug in VS Code. Perhaps you could link it in the README here to make it easier for people to find if you seem to work on both projects it makes sense.

However, here are no clear instructions , I did find related docs https://emmylua.github.io/run/remote.html which seems to be using Mobdebug anyway? What settings for VS Code configuration.json for the remote debugger need to be set up in VS Code, dependencies, doe it heed a seperate lua file like luapanda etc.

This documentation is also outdated. EmmyLua has its own debugger, emmy_core, which has no dependencies.

CppCXY commented 1 week ago

Actually, I am the maintainer of the debugger. If you have any questions, please refer to the corresponding issue.

iandol commented 1 week ago

which repository should issues be made -- here https://github.com/EmmyLua/VSCode-EmmyLua/issues ?

Doesn't emmyLua and LuaLS clash as they are both LS? Can I just use the debugger and not the other parts?

Thanks for your help.

CppCXY commented 1 week ago

which repository should issues be made -- here https://github.com/EmmyLua/VSCode-EmmyLua/issues ?

Doesn't emmyLua and LuaLS clash as they are both LS? Can I just use the debugger and not the other parts?

Thanks for your help.

Yes, go there. If you are Chinese, you can join the qq group and ask directly. The EmmyLua language server has superior performance, with only one-eighth of the memory usage of LuaLS. However, it has fewer features. If you only want to use the debugger, you can temporarily disable it through the status bar at the bottom.

iandol commented 1 week ago

Thanks, I opened https://github.com/EmmyLua/VSCode-EmmyLua/issues/180 and will close this one.