Add TODO to investigate index or import issue

This commit is contained in:
Jacob Dufault 2017-04-13 01:21:24 -07:00
parent d6123bd861
commit 151505dadf
5 changed files with 59 additions and 3 deletions

View File

@ -859,6 +859,7 @@ void QueryDbMainLoop(
// - start at spelling but end at extent for better mouse tooltip
// - goto declaration while in definition of recursive type
// TODO: Goto definition broken on Buffer::CreateSharedBuffer.
optional<QueryableLocation> def_loc = GetDefinitionSpellingOfSymbol(db, ref.idx);
// We use spelling start and extent end because this causes vscode
@ -888,7 +889,9 @@ void QueryDbMainLoop(
if (def_loc)
PushBack(&response.result, GetLsLocation(db, working_files, *def_loc));
break;
if (!response.result.empty())
break;
}
}

View File

@ -28,10 +28,10 @@ using namespace std::experimental;
template <typename T>
struct Id {
uint64_t id;
size_t id;
Id() : id(0) {} // Needed for containers. Do not use directly.
explicit Id(uint64_t id) : id(id) {}
explicit Id(size_t id) : id(id) {}
bool operator==(const Id<T>& other) const { return id == other.id; }

View File

@ -365,6 +365,7 @@ QueryTypeId IdMap::ToQuery(IndexTypeId id) const {
return QueryTypeId(cached_type_ids_.find(id.id)->second);
}
QueryFuncId IdMap::ToQuery(IndexFuncId id) const {
if (id.id == -1) return QueryFuncId(-1);
assert(cached_func_ids_.find(id.id) != cached_func_ids_.end());
return QueryFuncId(cached_func_ids_.find(id.id)->second);
}

View File

@ -0,0 +1,47 @@
#include "static.h"
void Buffer::CreateSharedBuffer() {}
/*
OUTPUT: static.h
{
"types": [{
"id": 0,
"usr": "c:@S@Buffer",
"short_name": "Buffer",
"qualified_name": "Buffer",
"definition_spelling": "3:8-3:14",
"definition_extent": "3:1-5:2",
"funcs": [0],
"uses": ["*3:8-3:14"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Buffer@F@CreateSharedBuffer#S",
"short_name": "CreateSharedBuffer",
"qualified_name": "Buffer::CreateSharedBuffer",
"declarations": ["4:15-4:33"],
"declaring_type": 0
}]
}
OUTPUT: static.cc
{
"dependencies": ["C:/Users/jacob/Desktop/superindex/indexer/tests/multi_file/static.h"],
"types": [{
"id": 0,
"usr": "c:@S@Buffer",
"funcs": [0],
"uses": ["3:6-3:12"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Buffer@F@CreateSharedBuffer#S",
"short_name": "CreateSharedBuffer",
"qualified_name": "Buffer::CreateSharedBuffer",
"definition_spelling": "3:14-3:32",
"definition_extent": "3:1-3:37",
"declaring_type": 0
}]
}
*/

View File

@ -0,0 +1,5 @@
#pragma once
struct Buffer {
static void CreateSharedBuffer();
};