src/extension.js
/**
 * Actions to take on opening and saving documents
 * @param {Object} doc vscode document object
 */
Actions to take on opening and saving documents
@param {Object} doc vscode document object
Actions to take on opening and saving documents @param { Object } doc vscode document object
async function onOpenAndSave(doc) {
	if ((doc.languageId == "yaml" || doc.languageId == "json") && doc.uri.scheme === "file") {
		let parse
		if (doc.languageId == "yaml") {
			parse = YAML.parse(doc.getText())
		} else {
			parse = JSON.parse(doc.getText())
		}
		if (parse.swagger || parse.openapi) {
			let result = preCheck(parse, doc)
			if (result.message === '') {
				result = await validateSwagger(doc)
			} 
			return result
		}
	}
}
async function onOpenAndSave ( doc ) { if ( ( doc . languageId == "yaml" || doc . languageId == "json" ) && doc . uri . scheme === "file" ) { let parse if ( doc . languageId == "yaml" ) { parse = YAML . parse ( doc . getText ( ) ) } else { parse = JSON . parse ( doc . getText ( ) ) } if ( parse . swagger || parse . openapi ) { let result = preCheck ( parse , doc ) if ( result . message === '' ) { result = await validateSwagger ( doc ) } return result } } }
Actions to take on opening and saving documents
 @param {Object} doc vscode document object
Actions to take on opening and saving documents @param { Object } doc vscode document object