-
Notifications
You must be signed in to change notification settings - Fork 665
Local debugger implementation discussion #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So #130 Should be one of the issues we should address first, which is to solve:
|
I've created a repository for storing these bootstrapper template: Currently it is owned by me (Edit: and temporarily set private), and when the feature is becoming mature, I will move it to @leetcode-tools. |
Cpp boostrapper usage:
|
I am working on a local debugger proposal. For the local debugger, we have something to do: 1. get problem meta dataI have finished it by leetcode-problem-types for free available problems. 2. start debugUsing vscode.debug.startDebugging to start debug session 3. handle input and outputAs we know the types of all parameters according to problem meta data, so we can write all 4. missing definitionWe should add missing definitions for some languages to the problem file when debug, and delete them when submit. 5. judge resultThe same as step 3 for most problems but some specials which have no output. We should write judge function for thest problems if we support them. Hoping get some advice for the proposal, i will finish the first version of javascript in few weeks. |
@wangtao0101 Thanks for your contribution! I've walked through your fork, and appreciate your work of building a debug framework. Here is some of my simple advice: First commit
Second commit
In recent days (after July 11th's university summer camp) I will also start to work on it, wish we could have a nice collaboration! |
|
@Vigilans @jdneo I have finished the debug framework with javascript supported in my repo. You can review it and make some comments. I will make a PR if the debug framework is work. Four key points: |
I have implemented a local debugging framework with c++ supported (repo). I have no experience in open-source projects, so I wonder if you could review it and give me some advice for improvement. About the debugging framework:
About c++ debugger implementation:
Also, I have some problems with future work:
|
@XavierCai1996 Maybe you can publish an extension for debugging leetcode c++ problems I guess? Since the LeetCode supports a lot of different languages. Having a general debug support is not an easy task. |
It looks good to me. |
@jdneo any response ? |
Hi all, Thank you for all of you participating the discussion here. There are a lot of brilliant ideas here. While unfortunately, so far supporting debugging is not in the roadmap, for the following reasons:
So I suggest if anyone has the interest to support debugging, he can just write his own extension and publish it to enable this scenario. Besides, by focusing on a specific language, the problem could be much easier! As the above discussion, we already have some guys having great idea for debugging a certain language! If anyone has problem to make his own extension, just feel free to let me know! |
Insert an AD: Debug LeetCode Currently the extension support js and python, and in few weeks i will support c and c++, next java.... 插一个广告: Debug LeetCode 别打我。。。。 |
Well, actually my intention is, everyone can publish a separate extension which is purely for debugging purpose. And the debugger can communicate with this extension through negotiated APIs (if needed). This solution will benefit users from:
And it also provides more flexibility and extensibility. Anyway, since the project is licensed with MIT, so basically you can do whatever you hope to. |
@jdneo I have come up with an idea about how to strip the debug feature from vscode-leetcode. After i finish cpp debuger soon, i will do this. I agree with that the way will benefit both users and the two extensions. |
What we've got
templateMeta
property from GraphQL API:I've written a bunch of robust code in this gist. To successfully build a solution, we should provide:
solution.h
.meta.h
:The meta code could be generated by
templateMeta
from the extension side.vscode-cpptool-api
package:This is not the
cpptool
extension, but its api package, from which we can provide custom configuration of our currently writing code.e.g., we can force-include
pre-solution.h
in thesolution.h
to provide proper intellisense.What we may need
I suggest we keep everything about leetcode extension in
~/.leetcode
, or somewhere specified by user in settings, rather than an arbitrary workspace. All the files inside the root should be managed by extension, and user intervention should be reduced as little as possible.How to organize the dependency with each other language tools? Users only need a small set of languages to write leetcode solutions.
How to trigger the debugger through a WebView, and feed the testcase data from a WebView textbox?
...
The text was updated successfully, but these errors were encountered: