Skip to content

Develop new function to show the content of problem #127

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

Closed
wants to merge 8 commits into from

Conversation

qyazhang
Copy link

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)

@qyazhang qyazhang marked this pull request as ready for review February 15, 2019 11:53
@jdneo
Copy link
Member

jdneo commented Feb 15, 2019

@qyazhang Thank you for contribution, would you mind to fix the CI failure first?

@qyazhang
Copy link
Author

Thanks, I will fix it later (I'm sorry that I'm not so familiar with Typescript and this testing tool)

@jdneo
Copy link
Member

jdneo commented Feb 15, 2019

Actually, I prefer creating an issue before sending out the PR.

In the issue, we can discuss the implementation first. Also this could be a chance to get feedback from the community.

@qyazhang
Copy link
Author

I'm sorry I may need further time to solve the problem of "vsce package", I will close it and issue/PR again. Sorry for troubling

@qyazhang qyazhang closed this Feb 17, 2019
@jdneo
Copy link
Member

jdneo commented Feb 18, 2019

@qyazhang Don't worry, it's fine.

What kind of problem are you meeting with. I'm willing to help if I can.

@qyazhang
Copy link
Author

Thanks for your kind.
I searched the error message and few solutions are found. I will try to debug it these days to find which changes lead to this error (the error message didn't indicate which parts lead to this error), if faced the same error again, I will try to solve it with you.

@jdneo
Copy link
Member

jdneo commented Feb 21, 2019

@qyazhang What error message were you get?

@qyazhang
Copy link
Author

It show the error message like this

Executing prepublish script 'npm run vscode:prepublish'...
ERROR Command failed: npm run vscode:prepublish
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] compile: tsc -p ./
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/zhang/.npm/_logs/2019-02-25T03_23_53_058Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] vscode:prepublish: npm run compile
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] vscode:prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/zhang/.npm/_logs/2019-02-25T03_23_53_083Z-debug.log

And the details in log is shown like this

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'compile' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'precompile', 'compile', 'postcompile' ]
5 info lifecycle [email protected]precompile: [email protected]
6 info lifecycle [email protected]
compile: [email protected]
7 verbose lifecycle [email protected]compile: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
compile: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/zhang/git/vscode-leetcode/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/zhang/git/vscode-leetcode/node_modules/.bin:/Users/zhang/perl5/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/git/bin:/usr/local/sbin:/usr/local/git/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/zhang/.rvm/bin:/Users/zhang/.rvm/bin
9 verbose lifecycle [email protected]compile: CWD: /Users/zhang/git/vscode-leetcode
10 silly lifecycle [email protected]
compile: Args: [ '-c', 'tsc -p ./' ]
11 silly lifecycle [email protected]compile: Returned: code: 2 signal: null
12 info lifecycle [email protected]
compile: Failed to exec compile script
13 verbose stack Error: [email protected] compile: tsc -p ./
13 verbose stack Exit status 2
13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/zhang/git/vscode-leetcode
16 verbose Darwin 17.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "compile"
18 verbose node v10.13.0
19 verbose npm v6.8.0
20 error code ELIFECYCLE
21 error errno 2
22 error [email protected] compile: tsc -p ./
22 error Exit status 2
23 error Failed at the [email protected] compile script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

(I'm sorry I'm busy at other things and didn't get further developement)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants