public async Task <DafnyDocument> LoadAsync(TextDocumentItem textDocument, bool verify, CancellationToken cancellationToken) { var errorReporter = new BuildErrorReporter(); var program = await _parser.ParseAsync(textDocument, errorReporter, cancellationToken); var compilationUnit = await _symbolResolver.ResolveSymbolsAsync(textDocument, program, cancellationToken); var symbolTable = _symbolTableFactory.CreateFrom(program, compilationUnit, cancellationToken); var serializedCounterExamples = await VerifyIfEnabledAsync(textDocument, program, verify, cancellationToken); return(new DafnyDocument(textDocument, errorReporter, program, symbolTable, serializedCounterExamples)); }
/****************** ORIGINAL METHODS **************/ private async Task <DafnyDocument> GenerateProgram(TextDocumentItem textDocument, CancellationToken cancellationToken) { var errorReporter = new BuildErrorReporter(); var program = await _parser.ParseAsync(textDocument, errorReporter, cancellationToken); var compilationUnit = await _symbolResolver.ResolveSymbolsAsync(textDocument, program, cancellationToken); var symbolTable = _symbolTableFactory.CreateFrom(program, compilationUnit, cancellationToken); _notificationPublisher.Started(textDocument); var serializedCounterExamples = await _verifier.VerifyAsync(program, cancellationToken); // DocumentPrinter.OutputErrorInfo(errorReporter); _notificationPublisher.Completed(textDocument, serializedCounterExamples == null); // DocumentPrinter.OutputErrorInfo(errorReporter); return(new DafnyDocument(textDocument, errorReporter, program, symbolTable, serializedCounterExamples)); }