Malformed `compile_commands.json` causes crash
z2oh opened this issue · comments
Jeremy Day commented
tryLoadCompilationDatabase
fails aggressively if it finds a compile_commands.json
but fails to parse it:
SKCore/CompilationDatabase.swift:84: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Foundation.JSONError.unexpectedEndOfFile)))
Simple repro:
touch A.swift
touch compile_commands.json
code .
The language server crashes on startup.
Alex Hoppen commented
Tracked in Apple’s issue tracker as rdar://120804823