tokoro10g / matlab-langserver

Language Server using MATLAB Engine
13 stars 1 forks source link

"Run Code" should be implemented based on DAP (Debug Adapter Protocol) #4

Open tokoro10g opened 5 years ago

tokoro10g commented 5 years ago

Details: https://microsoft.github.io/debug-adapter-protocol/

lsp4j supports DAP: https://github.com/eclipse/lsp4j

minkir014 commented 5 years ago

You can use gdb as a debugger and do like Native Debug extension does

https://marketplace.visualstudio.com/items?itemName=webfreak.debug

tokoro10g commented 5 years ago

@minkir014 No, because MATLAB script can only be executed on MATLAB engine, your suggestion does not apply. The implementation might be a useful reference though.

minkir014 commented 5 years ago

You have two ways for doing that first you could compile matlab to c files and debug it with gdb see here.

You have another solution and it's the hardest that you should debug matlab over the matlab interactive terminal by sending commands to tell it where to stop and if to continue or to step into function. Tell me which one do you prefer??

minkir014 commented 5 years ago

@tokoro10g, Any new news? Have you decided which way of the ways I have mentioned you want to implement????

tokoro10g commented 5 years ago

I have looked at DAP specifications, but it seems not suitable for MATLAB debugging. This is because the common way in MATLAB is out of the scope of DAP.

For example, we often use "Run section", "Run selection", and interactive command window, but DAP only supports executing the entire code. There are several more issues which makes me unwilling to adapt DAP.

Instead, I found an interesting project which aims at providing an alternative to MATLAB IDE using VS Code. https://github.com/marmottetranquille/aMi This is directly implemented on the extension API. It might not be compatible with neither DAP nor LSP, but I think this works for you.

BTW, please do not push me since this project is a kind of hobby hack, and you cannot consider this as a fully-supported software.

On Fri, Jul 19, 2019, 2:23 AM minkir014 notifications@github.com wrote:

@tokoro10g https://github.com/tokoro10g, Any new news? Have you decided which way of the ways I have mentioned you want to implement????

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tokoro10g/matlab-langserver/issues/4?email_source=notifications&email_token=AAEJYYXKUOII2XPDE57SY6TQACRJBA5CNFSM4HYTDLY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2JGFMY#issuecomment-512910003, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEJYYU4GHG4QGN4J5XU6MTQACRJBANCNFSM4HYTDLYQ .