-
Notifications
You must be signed in to change notification settings - Fork 894
feat(cli): add coder open vscode
#11191
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
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c7dba53
feat(cli): add `coder open vscode`
mafredri 31e21fc
in-workspace detction, explicit api token generation (for printed URIs)
mafredri 2fd2464
handle more abs paths
mafredri b0c3dce
add todo
mafredri bc71c63
fix
mafredri d438c49
win
mafredri 3a69da2
table test
mafredri 8e8e08d
rename
mafredri 9ee8d8f
better path handling
mafredri 257c45f
win
mafredri 3fec654
refactor
mafredri 0d647bd
gen
mafredri 1202b65
allow more abs paths on windows, transform unix
mafredri 7c3f48b
move if to switch
mafredri 747ecad
convert / to \ for abs path check using filepath
mafredri caf84c5
unixToWindowsPath
mafredri 081a006
remove filepath fallbacks on windows, go abs check is stricter
mafredri d09546c
yolo, you aint got nothing on me, misspell
mafredri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
convert / to \ for abs path check using filepath
- Loading branch information
commit 747ecad74d806ebf2ac9a9f528beb2dd07ccbb62
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried
/path/to/something
,\path\to\something
andC:/path/to/something
which also both work in VSCode. Defaults to the drive Windows is installed on if there isn't a drive letter.IDK how paths work in Windows containers either, unsure if they have drive letters or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'll need to play around with this some more. I was actually planning on testing with agents on Windows today, but it turns out our win template is broken atm. I know at least the "expanded directory" resolves to
C:\...
via test runners. I suspected/
might work in VS Code but out of precaution I wanted to transform them.Perhaps we can just make everything slash and only have the logic for detecting abs path on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some handling for the cases you mentioned, and relaxed the abs requirement to include
/
,\
. I know there are more exceptions like\\.UNC\
paths and the like, but I don't know if it's worth adding preemptive handling for that.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I can't seem to make CI happy because Go
filepath.IsAbs
on windows seems to think differently? https://github.com/coder/coder/actions/runs/7262677715/job/19786347550?pr=11191#step:5:496(I kept the fallback to
filepath
vs our impl. on Windows so that we could catch these types of inconsistencies, but I can just remove that if we don't care.)