File tree 2 files changed +0
-41
lines changed
2 files changed +0
-41
lines changed Original file line number Diff line number Diff line change @@ -751,25 +751,9 @@ export const shouldOpenInExistingInstance = async (args: UserProvidedArgs): Prom
751
751
* Convert our arguments to VS Code server arguments.
752
752
*/
753
753
export const toVsCodeArgs = async ( args : DefaultedArgs ) : Promise < CodeServerLib . ServerParsedArgs > => {
754
- let workspace = ""
755
- let folder = ""
756
- if ( args . _ . length ) {
757
- const lastEntry = path . resolve ( args . _ [ args . _ . length - 1 ] )
758
- const entryIsFile = await isFile ( lastEntry )
759
- if ( entryIsFile && path . extname ( lastEntry ) === ".code-workspace" ) {
760
- workspace = lastEntry
761
- } else if ( ! entryIsFile ) {
762
- folder = lastEntry
763
- }
764
- // Otherwise it is a regular file. Spawning VS Code with a file is not yet
765
- // supported but it can be done separately after code-server spawns.
766
- }
767
-
768
754
return {
769
755
"connection-token" : "0000" ,
770
756
...args ,
771
- workspace,
772
- folder,
773
757
"accept-server-license-terms" : true ,
774
758
/** Type casting. */
775
759
help : ! ! args . help ,
Original file line number Diff line number Diff line change @@ -702,29 +702,6 @@ describe("toVsCodeArgs", () => {
702
702
it ( "should convert empty args" , async ( ) => {
703
703
expect ( await toVsCodeArgs ( await setDefaults ( parse ( [ ] ) ) ) ) . toStrictEqual ( {
704
704
...vscodeDefaults ,
705
- folder : "" ,
706
- workspace : "" ,
707
- } )
708
- } )
709
-
710
- it ( "should convert with workspace" , async ( ) => {
711
- const workspace = path . join ( await tmpdir ( testName ) , "test.code-workspace" )
712
- await fs . writeFile ( workspace , "foobar" )
713
- expect ( await toVsCodeArgs ( await setDefaults ( parse ( [ workspace ] ) ) ) ) . toStrictEqual ( {
714
- ...vscodeDefaults ,
715
- workspace,
716
- folder : "" ,
717
- _ : [ workspace ] ,
718
- } )
719
- } )
720
-
721
- it ( "should convert with folder" , async ( ) => {
722
- const folder = await tmpdir ( testName )
723
- expect ( await toVsCodeArgs ( await setDefaults ( parse ( [ folder ] ) ) ) ) . toStrictEqual ( {
724
- ...vscodeDefaults ,
725
- folder,
726
- workspace : "" ,
727
- _ : [ folder ] ,
728
705
} )
729
706
} )
730
707
@@ -733,8 +710,6 @@ describe("toVsCodeArgs", () => {
733
710
await fs . writeFile ( file , "foobar" )
734
711
expect ( await toVsCodeArgs ( await setDefaults ( parse ( [ file ] ) ) ) ) . toStrictEqual ( {
735
712
...vscodeDefaults ,
736
- folder : "" ,
737
- workspace : "" ,
738
713
_ : [ file ] ,
739
714
} )
740
715
} )
You can’t perform that action at this time.
0 commit comments