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

Commit981f702

Browse files
committed
request empty workspace on startup
1 parent0544c56 commit981f702

File tree

7 files changed

+20
-26
lines changed

7 files changed

+20
-26
lines changed

‎src/channel/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,13 @@ class Channel implements Channel {
114114
if(isEmptyWorkspace){
115115
this.send({type:'IS_EMPTY_WORKSPACE'})
116116
}else{
117-
openWorkspace()
118-
this.send({type:'REQUEST_WORKSPACE'})
117+
this.send({type:'NOT_EMPTY_WORKSPACE'})
119118
}
120119
return
120+
case'EDITOR_REQUEST_WORKSPACE':
121+
console.log('request workspace')
122+
openWorkspace()
123+
return
121124
// load step actions (git commits, commands, open files)
122125
case'SETUP_ACTIONS':
123126
awaitvscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload)

‎src/services/workspace/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import * as vscode from 'vscode'
22
import*asfsfrom'fs'
33

44
exportconstopenWorkspace=()=>{
5-
vscode.commands.executeCommand('vscode.openFolder')
5+
constopenInNewWindow=false
6+
vscode.commands.executeCommand('vscode.openFolder',undefined,openInNewWindow)
67
}
78

89
exportconstcheckWorkspaceEmpty=async(dirname:string)=>{

‎typings/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export interface MachineStateSchema {
7575
Start:{}
7676
CheckEmptyWorkspace:{}
7777
NonEmptyWorkspace:{}
78-
RequestEmptyWorkspace:{}
7978
SelectTutorial:{}
8079
LoadTutorialSummary:{}
8180
Summary:{}

‎web-app/src/Routes.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,7 @@ const Routes = () => {
1515
<Workspace>
1616
<Router>
1717
{/* Setup */}
18-
<Route
19-
path={[
20-
'Setup.Startup',
21-
'Setup.Authenticate',
22-
'Setup.LoadStoredTutorial',
23-
'Setup.CheckEmptyWorkspace',
24-
'Setup.RequestEmptyWorkspace',
25-
]}
26-
>
18+
<Routepath={['Setup.Startup','Setup.Authenticate','Setup.LoadStoredTutorial','Setup.CheckEmptyWorkspace']}>
2719
<LoadingPagetext="Launching..."context={context}/>
2820
</Route>
2921
<Routepath="Setup.Start">

‎web-app/src/containers/Check/SelectWorkspace.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ const SelectWorkspace = (props: Props) => {
1717
constonOpenWorkspace=()=>props.send({type:'REQUEST_WORKSPACE'})
1818
return(
1919
<divcss={styles.container}>
20-
<h3>Select or Create An Empty Workspace</h3>
21-
<p>CodeRoad runs Git commands in the background and will change your workspace files.</p>
20+
<h3>Select An Empty VSCode Workspace</h3>
21+
<p>Start a project in an empty folder.</p>
22+
<p>Once selected, the extension will close and need to be re-started.</p>
2223
<br/>
2324
<Buttontype="secondary"onClick={onOpenWorkspace}>
2425
Open a Workspace

‎web-app/src/services/state/actions/editor.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ export default (editorSend: any) => ({
7575
type:'EDITOR_CHECK_WORKSPACE',
7676
})
7777
},
78-
requestEmptyWorkspace(){
79-
// TODO
80-
console.log('request empty workspace')
78+
requestWorkspaceSelect(){
79+
editorSend({
80+
type:'EDITOR_REQUEST_WORKSPACE',
81+
})
8182
},
8283
})

‎web-app/src/services/state/machine.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,17 @@ export const createMachine = (options: any) => {
7878
CheckEmptyWorkspace:{
7979
onEntry:['checkEmptyWorkspace'],
8080
on:{
81-
REQUEST_WORKSPACE:'RequestEmptyWorkspace',
8281
IS_EMPTY_WORKSPACE:'SelectTutorial',
82+
NOT_EMPTY_WORKSPACE:'NonEmptyWorkspace',
8383
},
8484
},
8585
NonEmptyWorkspace:{
8686
on:{
87-
REQUEST_WORKSPACE:'RequestEmptyWorkspace',
88-
},
89-
},
90-
RequestEmptyWorkspace:{
91-
onEntry:['requestWorkspaceSelection'],
92-
on:{
87+
REQUEST_WORKSPACE:{
88+
target:'NonEmptyWorkspace',
89+
actions:'requestWorkspaceSelect',
90+
},
9391
WORKSPACE_LOADED:'CheckEmptyWorkspace',
94-
CANCEL:'NonEmptyWorkspace',
9592
},
9693
},
9794
SelectTutorial:{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp