Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fixed use wsl feature (issue#509)#510

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jdneo merged 7 commits intoLeetCode-OpenSource:masterfromLNKLEO:master
Feb 22, 2020
Merged

fixed use wsl feature (issue#509)#510

jdneo merged 7 commits intoLeetCode-OpenSource:masterfromLNKLEO:master
Feb 22, 2020

Conversation

LNKLEO
Copy link
Contributor

@LNKLEOLNKLEO commentedFeb 13, 2020
edited
Loading

convert path wsl after full path constructed
resolve problem cased by wslpath conversion

leetCodeRootPathInWsl no longer used
getLeetCodeRootPath function removed since it has only one reference after the bug fixed

#509

convert path wsl after full path constructedleetCodeRootPathInWsl no longer usedgetLeetCodeRootPath function removed since it has only one reference after the bug fixed
add missing signature
@lgtm-com
Copy link

This pull requestintroduces 1 alert when mergingf3ad33f into1c4a39e -view on LGTM.com

new alerts:

  • 1 for Yield in non-generator function

this.leetCodeRootPathInWsl = `${await wsl.toWslPath(this.leetCodeRootPath)}`;
}
return `${this.leetCodeRootPathInWsl}`;
return `${yield wsl.toWslPath(`"${path.join(yield`"${this.leetCodeRootPath}"`, "bin", "leetcode")}"`)}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

No need to haveyield here


public async getLeetCodeBinaryPath(): Promise<string> { // wrapped by ""
return `"${path.join(await this.getLeetCodeRootPath(), "bin", "leetcode")}"`;
return `"${path.join(yield`"${this.leetCodeRootPath}"`, "bin", "leetcode")}"`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

No need to haveyield here

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Orz
i'm not too much familiar with ts, maybe you should take over this fix if i keep failed the build

patch to solve wslpath fail when path not exists
@LNKLEO
Copy link
ContributorAuthor

when open new problem, wslpath conversion to windows fails as the target path under wsl doesn't exists yet, I tried fixed this and append to this same PR

@LNKLEOLNKLEO mentioned this pull requestFeb 13, 2020
@jdneo
Copy link
Member

Thank you @LinkeyLeo,

Sorry I have no Windows machine right now (it's in my office, and given the current situation, It's not easy to get it).

Could you please help me to understand the change? You have mentioned:

when open new problem, wslpath conversion to windows fails as the target path under wsl doesn't exists yet

What's the path you mentioned here?

@LNKLEO
Copy link
ContributorAuthor

Thank you @LinkeyLeo,

Sorry I have no Windows machine right now (it's in my office, and given the current situation, It's not easy to get it).

Could you please help me to understand the change? You have mentioned:

when open new problem, wslpath conversion to windows fails as the target path under wsl doesn't exists yet

What's the path you mentioned here?

the workflow for open problem for coding is looks like following:
1.fetchting problem
2.parsing problem title etc.
3.create new file with default codes
4.open code file and problem description in vscode

in step 3, we need to create a new source file for writing default codes, due to using node under wsl, the target file path reported by node is a wsl path, but the extension host is running under windows and need a windows path for creating and open the file, thus we need wslpath to convert the path, then the problem appeared.

wslpath will finish the path conversion only if the path is valid and the path is exists, or it rise a path doesn't exist error and won't do the path conversion.

considering other path may need to be conversion and have the same problem in the future, I fixed this problem by modified toWinPath function, making it only process the prefix of whole path and manually reconstruct the complete path

Copy link
Member

@jdneojdneo left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@LinkeyLeo My apologize for the late reply, sorry!

The PR looks good to me overall. Just one question, when will the path does not start with"\\mnt\\". we have this:return (await executeCommand("wsl", ["wslpath", "-w", "/"])).trim() + path;

Could you explain more about this?

Thanks.

@LNKLEO
Copy link
ContributorAuthor

LNKLEO commentedFeb 21, 2020
edited
Loading

@jdneo

i divide wsl paths into two parts, mounted drive root from windows which located in /mnt/ and other path located in / except /mnt/

for the after ones, we need to map /{WSL PATH} to \wsl${distor name}{WSL PATH}
actually, simply use "wsl wslpath -w {WSL PATH}" would work too, but that need to replace \ with / in path manually first.

Copy link
Member

@jdneojdneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM, thanks!

@jdneojdneo added this to the0.16.1 milestoneFeb 22, 2020
@jdneojdneo merged commitd7e4c10 intoLeetCode-OpenSource:masterFeb 22, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jdneojdneojdneo approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
0.16.1
Development

Successfully merging this pull request may close these issues.

2 participants
@LNKLEO@jdneo

[8]ページ先頭

©2009-2025 Movatter.jp