We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d23082f commit eaad8a7Copy full SHA for eaad8a7
lib/SymbolGraphGen/Symbol.cpp
@@ -297,12 +297,13 @@ void Symbol::serializeLocationMixin(llvm::json::OStream &OS) const {
297
return;
298
}
299
auto FileName = VD->getASTContext().SourceMgr.getDisplayNameForLoc(Loc);
300
+ if (FileName.empty()) {
301
+ return;
302
+ }
303
OS.attributeObject("location", [&](){
- if (!FileName.empty()) {
- SmallString<1024> FileURI("file://");
- FileURI.append(FileName);
304
- OS.attribute("uri", FileURI.str());
305
- }
+ SmallString<1024> FileURI("file://");
+ FileURI.append(FileName);
306
+ OS.attribute("uri", FileURI.str());
307
serializePosition("position", Loc, Graph->M.getASTContext().SourceMgr, OS);
308
});
309
0 commit comments