@@ -3,6 +3,7 @@ import * as TT from 'typings/tutorial'
33import * as vscode from 'vscode'
44import { COMMANDS } from '../editor/commands'
55import * as git from '../services/git'
6+ import { DISABLE_AUTOSAVE } from '../environment'
67
78interface TutorialConfigParams {
89config :TT . TutorialConfig
@@ -53,21 +54,23 @@ const tutorialConfig = async ({ config, alreadyConfigured }: TutorialConfigParam
5354
5455await vscode . commands . executeCommand ( COMMANDS . CONFIG_TEST_RUNNER , config . testRunner )
5556
56- // verify if file test should run based on document saved
57- const shouldRunTest = ( document :vscode . TextDocument ) :boolean => {
58- // must be a file
59- if ( document . uri . scheme !== 'file' ) {
60- return false
57+ if ( ! DISABLE_AUTOSAVE ) {
58+ // verify if file test should run based on document saved
59+ const shouldRunTest = ( document :vscode . TextDocument ) :boolean => {
60+ // must be a file
61+ if ( document . uri . scheme !== 'file' ) {
62+ return false
63+ }
64+ return true
6165}
62- return true
63- }
6466
65- // setup onSave hook
66- vscode . workspace . onDidSaveTextDocument ( ( document :vscode . TextDocument ) => {
67- if ( shouldRunTest ( document ) ) {
68- vscode . commands . executeCommand ( COMMANDS . RUN_TEST )
69- }
70- } )
67+ // setup onSave hook
68+ vscode . workspace . onDidSaveTextDocument ( ( document :vscode . TextDocument ) => {
69+ if ( shouldRunTest ( document ) ) {
70+ vscode . commands . executeCommand ( COMMANDS . RUN_TEST )
71+ }
72+ } )
73+ }
7174}
7275
7376export default tutorialConfig