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

Commit9b9ed40

Browse files
committed
configure tutorial progress
1 parent284e1f7 commit9b9ed40

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

‎src/actions/tutorialConfig.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as G from 'typings/graphql'
22
import*asvscodefrom'vscode'
33
import*asgitfrom'../services/git'
44
importlanguageMapfrom'../editor/languageMap'
5+
import{COMMANDS}from'../editor/commands'
56

67
interfaceTutorialConfigParams{
78
config:G.TutorialConfig,
@@ -19,15 +20,17 @@ const tutorialConfig = async ({config, alreadyConfigured, }: TutorialConfigParam
1920
awaitgit.setupRemote(config.repo.uri)
2021
}
2122

22-
vscode.commands.executeCommand('coderoad.config_test_runner',config.testRunner)
23+
vscode.commands.executeCommand(COMMANDS.CONFIG_TEST_RUNNER,config.testRunner)
2324

2425
constfileFormats=config.testRunner.fileFormats
2526

2627
// verify if file test should run based on document saved
27-
constshouldRun=(document:vscode.TextDocument):boolean=>{
28+
constshouldRunTest=(document:vscode.TextDocument):boolean=>{
29+
// must be a file
2830
if(document.uri.scheme!=='file'){
2931
returnfalse
3032
}
33+
// must configure with file formatss
3134
if(fileFormats&&fileFormats.length){
3235
constfileFormat:G.FileFormat=languageMap[document.languageId]
3336
if(!fileFormats.includes(fileFormat)){
@@ -39,7 +42,7 @@ const tutorialConfig = async ({config, alreadyConfigured, }: TutorialConfigParam
3942

4043
// setup onSave hook
4144
vscode.workspace.onDidSaveTextDocument((document:vscode.TextDocument)=>{
42-
if(shouldRun(document)){
45+
if(shouldRunTest(document)){
4346
vscode.commands.executeCommand('coderoad.run_test')
4447
}
4548
})

‎src/editor/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as vscode from 'vscode'
33
importReactWebViewfrom'./ReactWebView'
44
importcreateTestRunner,{Payload}from'../services/testRunner'
55

6-
constCOMMANDS={
6+
exportconstCOMMANDS={
77
START:'coderoad.start',
88
OPEN_WEBVIEW:'coderoad.open_webview',
99
CONFIG_TEST_RUNNER:'coderoad.config_test_runner',

‎src/services/testRunner/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const createTestRunner = (config: TestRunnerConfig, callbacks: Callbacks) => {
2222

2323
constoutputChannelName='TEST_OUTPUT'
2424

25-
returnasync(payload:Payload,onSuccess?:()=>void)=>{
25+
returnasync(payload:Payload,onSuccess?:()=>void):Promise<void>=>{
2626
console.log('------------------- run test ------------------')
2727

2828
// track processId to prevent multiple

‎src/services/testRunner/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
importTapParserfrom'tap-parser'
1+
constTapParser=require('tap-parser')
22

33
// https://github.com/tapjs/tap-parser#var-p--new-parseroptions-cb
44
constoptions={

‎web-app/src/services/apollo/queries/tutorial.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ export default gql`
1212
}
1313
data {
1414
config {
15-
testRunner
16-
fileFormats
15+
testRunner {
16+
command
17+
fileFormats
18+
}
1719
repo {
1820
uri
1921
branch

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp