Skip to content

Centralize the logic about wsl #55

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

Merged
merged 5 commits into from
Aug 9, 2018
Merged

Centralize the logic about wsl #55

merged 5 commits into from
Aug 9, 2018

Conversation

jdneo
Copy link
Member

@jdneo jdneo commented Aug 7, 2018

fix #48
fix #54

@jdneo jdneo added this to the 0.8.0 milestone Aug 7, 2018
@jdneo
Copy link
Member Author

jdneo commented Aug 7, 2018

Hi @purocean,

As we have discussed before. We can have some further improvement about the WSL support.

During my own experience, the main problems of current implementation are:

  • WSL related logics separate in several different files
  • The leetCodeBinaryPath will be wrong if the setting of enableWSL is switched by users.
  • We are using IO blocking method (execFileSync) to parse the WSL path.

So this is the reason I create a new class: leetCodeExecutor, and try to put WSL related logic into this class as much as possible.

Very appreciated if you can help review this PR if you have time. Since this feature is originally contributed by you. 😄

@purocean
Copy link
Contributor

purocean commented Aug 8, 2018

@jdneo OK, I'll take a look.

@purocean
Copy link
Contributor

purocean commented Aug 8, 2018

@jdneo
Have you tested with enable useWsl?

LeetCode extension need Node.js installed in environment path.

It occurs an error in my machine.

https://github.com/jdneo/vscode-leetcode/blob/8c52f42f37bcc48b0f79210545169e629ec456d3/src/utils/nodeUtils.ts#L10
https://github.com/jdneo/vscode-leetcode/blob/8c52f42f37bcc48b0f79210545169e629ec456d3/src/utils/cpUtils.ts#L11

Looks like have no specific treatment for WSL.

@jdneo
Copy link
Member Author

jdneo commented Aug 8, 2018

@purocean Nice finding! I'll fix it.

@jdneo
Copy link
Member Author

jdneo commented Aug 8, 2018

@purocean Updated. Please have a try when you have time.

@purocean
Copy link
Contributor

purocean commented Aug 9, 2018

@jdneo
Work fine for me.
Just a little wrong text.

Submitting to LeetCode

https://github.com/jdneo/vscode-leetcode/blob/526cedd1eb52c6383fe1342c9d3b744bde784b39/src/leetCodeExecutor.ts#L109

@jdneo
Copy link
Member Author

jdneo commented Aug 9, 2018

@purocean Emm, I'm sorry. Anything wrong with "Submitting to LeetCode..."?

@purocean
Copy link
Contributor

purocean commented Aug 9, 2018

@jdneo
Copy link
Member Author

jdneo commented Aug 9, 2018

Haha, got it.

We can revisit the wording issue if we get user feedbacks in the future.

@jdneo jdneo merged commit 45bd545 into master Aug 9, 2018
@jdneo jdneo deleted the cs/wsl-improve branch August 9, 2018 12:28
ringcrl pushed a commit to ringcrl/vscode-leetcode that referenced this pull request Apr 21, 2019
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.

The path of leetcode binary is wrong when switch between enable/disable wsl. Abstract leetcode command
2 participants