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 @@ -770,25 +770,9 @@ export const shouldOpenInExistingInstance = async (args: UserProvidedArgs): Prom
770
770
* Convert our arguments to VS Code server arguments.
771
771
*/
772
772
export const toVsCodeArgs = async ( args : DefaultedArgs ) : Promise < CodeServerLib . ServerParsedArgs > => {
773
- let workspace = ""
774
- let folder = ""
775
- if ( args . _ . length ) {
776
- const lastEntry = path . resolve ( args . _ [ args . _ . length - 1 ] )
777
- const entryIsFile = await isFile ( lastEntry )
778
- if ( entryIsFile && path . extname ( lastEntry ) === ".code-workspace" ) {
779
- workspace = lastEntry
780
- } else if ( ! entryIsFile ) {
781
- folder = lastEntry
782
- }
783
- // Otherwise it is a regular file. Spawning VS Code with a file is not yet
784
- // supported but it can be done separately after code-server spawns.
785
- }
786
-
787
773
return {
788
774
"connection-token" : "0000" ,
789
775
...args ,
790
- workspace,
791
- folder,
792
776
"accept-server-license-terms" : true ,
793
777
/** Type casting. */
794
778
help : ! ! args . help ,
Original file line number Diff line number Diff line change @@ -726,29 +726,6 @@ describe("toVsCodeArgs", () => {
726
726
it ( "should convert empty args" , async ( ) => {
727
727
expect ( await toVsCodeArgs ( await setDefaults ( parse ( [ ] ) ) ) ) . toStrictEqual ( {
728
728
...vscodeDefaults ,
729
- folder : "" ,
730
- workspace : "" ,
731
- } )
732
- } )
733
-
734
- it ( "should convert with workspace" , async ( ) => {
735
- const workspace = path . join ( await tmpdir ( testName ) , "test.code-workspace" )
736
- await fs . writeFile ( workspace , "foobar" )
737
- expect ( await toVsCodeArgs ( await setDefaults ( parse ( [ workspace ] ) ) ) ) . toStrictEqual ( {
738
- ...vscodeDefaults ,
739
- workspace,
740
- folder : "" ,
741
- _ : [ workspace ] ,
742
- } )
743
- } )
744
-
745
- it ( "should convert with folder" , async ( ) => {
746
- const folder = await tmpdir ( testName )
747
- expect ( await toVsCodeArgs ( await setDefaults ( parse ( [ folder ] ) ) ) ) . toStrictEqual ( {
748
- ...vscodeDefaults ,
749
- folder,
750
- workspace : "" ,
751
- _ : [ folder ] ,
752
729
} )
753
730
} )
754
731
@@ -757,8 +734,6 @@ describe("toVsCodeArgs", () => {
757
734
await fs . writeFile ( file , "foobar" )
758
735
expect ( await toVsCodeArgs ( await setDefaults ( parse ( [ file ] ) ) ) ) . toStrictEqual ( {
759
736
...vscodeDefaults ,
760
- folder : "" ,
761
- workspace : "" ,
762
737
_ : [ file ] ,
763
738
} )
764
739
} )
You can’t perform that action at this time.
0 commit comments