Develop new function to show the content of problem #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is started from the consideration that when I use this extension to solve leetcode problem, I always want to first check the description of the problem and then consider whether I will start to solve it or not. But right now "show problem" function only assume I want to solve it and create a source code file, and I could only see the problem description in that.
So I start to create a new "show problem" function to replace the original one, which could get the context of problem description and show it in a new window instead of creating a source code file.
What have done:
create new "showProblem" function
rename original "showProblem" function to "showToSolveProblem"
send post request to leetcode's graphql and open a WebView to show the description content referring to leetcode-cli
add "show problem" to right-click menu, and rename original "show problem" to "solve problem"
What haven't done:
Haven't add the "showProblem" support for "leetcode-cn.com"
Haven't add the left-click event to problem items to directly open the description content when we left-click (I've tried to implement it, and inherit LeetCodeNode from TreeItem and give command to each LeetCodeNode, but it didn't work. It may need further discussion)