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

Commit769f7fa

Browse files
committed
refactor minor actions
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent9672565 commit769f7fa

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

‎src/actions/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ export { default as onTutorialContinueConfig } from './onTutorialContinueConfig'
44
export{defaultasonValidateSetup}from'./onValidateSetup'
55
export{defaultasonRunReset}from'./onRunReset'
66
export{defaultasonErrorPage}from'./onErrorPage'
7-
export{defaultasonTestPass}from'./onTestPass'
7+
export{onRunTest,onTestPass}from'./onTest'
88
export{onSetupActions,onSolutionActions}from'./onActions'
9+
export{onOpenLogs}from'./onOpenLogs'

‎src/actions/onOpenLogs.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import*asTfrom'typings'
2+
import{showOutput}from'../services/testRunner/output'
3+
4+
exportconstonOpenLogs=async(action:T.Action)=>{
5+
constchannel=action.payload.channel
6+
awaitshowOutput(channel)
7+
}
8+
9+
exportdefaultonOpenLogs

‎src/actions/onTestPass.tsrenamed to‎src/actions/onTest.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import*asgitfrom'../services/git'
22
import*asTfrom'typings'
3+
import*asvscodefrom'vscode'
4+
import{COMMANDS}from'../commands'
35
importContextfrom'../services/context/context'
46

5-
constonTestPass=(action:T.Action,context:Context)=>{
7+
exportconstonTestPass=(action:T.Action,context:Context)=>{
68
consttutorial=context.tutorial.get()
79
if(!tutorial){
810
thrownewError('Error with current tutorial. Tutorial may be missing an id.')
@@ -13,4 +15,6 @@ const onTestPass = (action: T.Action, context: Context) => {
1315
git.saveCommit('Save progress')
1416
}
1517

16-
exportdefaultonTestPass
18+
exportconstonRunTest=(action?:T.Action)=>{
19+
vscode.commands.executeCommand(COMMANDS.RUN_TEST,action?.payload)
20+
}

‎src/channel.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import*asTfrom'typings'
22
import*asvscodefrom'vscode'
3-
import{setupActions,solutionActions}from'./actions/onActions'
43
import{COMMANDS}from'./commands'
54
importContextfrom'./services/context/context'
65
importloggerfrom'./services/logger'
76
import{openWorkspace}from'./services/workspace'
8-
import{showOutput}from'./services/testRunner/output'
97
import*asactionsfrom'./actions'
108

119
interfaceChannel{
@@ -69,18 +67,17 @@ class Channel implements Channel {
6967
awaitvscode.commands.executeCommand(COMMANDS.SET_CURRENT_POSITION,action.payload.position)
7068
awaitactions.onSolutionActions({actions:action.payload.actions,send:this.send})
7169
// run test following solution to update position
72-
vscode.commands.executeCommand(COMMANDS.RUN_TEST)
70+
actions.onRunTest()
7371
return
7472
case'EDITOR_SYNC_PROGRESS':
7573
// update progress when a level is deemed complete in the client
7674
awaitthis.context.progress.syncProgress(action.payload.progress)
7775
return
7876
case'EDITOR_OPEN_LOGS':
79-
constchannel=action.payload.channel
80-
awaitshowOutput(channel)
77+
actions.onOpenLogs(action)
8178
return
8279
case'EDITOR_RUN_TEST':
83-
vscode.commands.executeCommand(COMMANDS.RUN_TEST,action?.payload)
80+
actions.onRunTest(action)
8481
return
8582
case'EDITOR_RUN_RESET':
8683
actions.onRunReset(this.context)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp