This commit is contained in:
Fangrui Song 2019-03-02 18:18:02 -08:00
parent 7e752c1901
commit ba68f49861
3 changed files with 5 additions and 5 deletions

View File

@ -41,7 +41,6 @@ cquery has system include path detection (through running the compiler driver) w
# >>> [Getting started](../../wiki/Home) (CLICK HERE) <<< # >>> [Getting started](../../wiki/Home) (CLICK HERE) <<<
* [Build](../../wiki/Build) * [Build](../../wiki/Build)
* [Client feature table](../../wiki/Client-feature-table)
* [FAQ](../../wiki/FAQ) * [FAQ](../../wiki/FAQ)
ccls can index itself (~180MiB RSS when idle, noted on 2018-09-01), FreeBSD, glibc, Linux, LLVM (~1800MiB RSS), musl (~60MiB RSS), ... with decent memory footprint. See [wiki/compile_commands.json](../../wiki/compile_commands.json) for examples. ccls can index itself (~180MiB RSS when idle, noted on 2018-09-01), FreeBSD, glibc, Linux, LLVM (~1800MiB RSS), musl (~60MiB RSS), ... with decent memory footprint. See [wiki/compile_commands.json](../../wiki/compile_commands.json) for examples.

View File

@ -473,7 +473,8 @@ public:
info.usr = HashUsr(USR); info.usr = HashUsr(USR);
if (auto *ND = dyn_cast<NamedDecl>(D)) { if (auto *ND = dyn_cast<NamedDecl>(D)) {
info.short_name = ND->getNameAsString(); info.short_name = ND->getNameAsString();
info.qualified = ND->getQualifiedNameAsString(); llvm::raw_string_ostream OS(info.qualified);
ND->printQualifiedName(OS, GetDefaultPolicy());
SimplifyAnonymous(info.qualified); SimplifyAnonymous(info.qualified);
} }
} }

View File

@ -88,14 +88,14 @@ REFLECT_STRUCT(DocumentLink, range, target);
void MessageHandler::textDocument_documentLink(TextDocumentParam &param, void MessageHandler::textDocument_documentLink(TextDocumentParam &param,
ReplyOnce &reply) { ReplyOnce &reply) {
auto [file, wf] = FindOrFail(param.textDocument.uri.GetPath(), reply); auto [file, wf] = FindOrFail(param.textDocument.uri.GetPath(), reply);
if (!wf) { if (!wf)
return; return;
}
std::vector<DocumentLink> result; std::vector<DocumentLink> result;
int column;
for (const IndexInclude &include : file->def->includes) for (const IndexInclude &include : file->def->includes)
if (std::optional<int> bline = if (std::optional<int> bline =
wf->GetBufferPosFromIndexPos(include.line, nullptr, false)) { wf->GetBufferPosFromIndexPos(include.line, &column, false)) {
const std::string &line = wf->buffer_lines[*bline]; const std::string &line = wf->buffer_lines[*bline];
auto start = line.find_first_of("\"<"), end = line.find_last_of("\">"); auto start = line.find_first_of("\"<"), end = line.find_last_of("\">");
if (start < end) if (start < end)