mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #18016 from ahoppen/003-incremental-syntax-coloring
[libSyntax] Incremental syntax colouring
This commit is contained in:
@@ -242,7 +242,8 @@ static bool emitLoadedModuleTraceIfNeeded(ASTContext &ctxt,
|
||||
std::string stringBuffer;
|
||||
{
|
||||
llvm::raw_string_ostream memoryBuffer(stringBuffer);
|
||||
json::Output jsonOutput(memoryBuffer, /*PrettyPrint=*/false);
|
||||
json::Output jsonOutput(memoryBuffer, /*UserInfo=*/{},
|
||||
/*PrettyPrint=*/false);
|
||||
json::jsonize(jsonOutput, trace, /*Required=*/true);
|
||||
}
|
||||
stringBuffer += "\n";
|
||||
@@ -289,7 +290,7 @@ static bool emitSyntax(SourceFile *SF, LangOptions &LangOpts,
|
||||
auto os = getFileOutputStream(OutputFilename, SF->getASTContext());
|
||||
if (!os) return true;
|
||||
|
||||
json::Output jsonOut(*os, /*PrettyPrint=*/false);
|
||||
json::Output jsonOut(*os, /*UserInfo=*/{}, /*PrettyPrint=*/false);
|
||||
auto Root = SF->getSyntaxRoot().getRaw();
|
||||
jsonOut << *Root;
|
||||
*os << "\n";
|
||||
|
||||
Reference in New Issue
Block a user