forked from mozsearch/mozsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO
103 lines (82 loc) · 3.24 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Big tasks:
* Autocomplete
* Display links to nearby methods in sidebar
* Better click UI that includes comments, IDL, etc.
* Multiple panes for looking through every reference in a file
* Searching for declarations
UI:
* Crossref result matches in bold
* "Search substring" context menu option
* Allow "locking on" a given highlighted symbol (from Kris)
* Incrementally load search results for less jank
AWS:
! Automatic indexing
! Error reporting
* Better security
* Multiple web hosts for performance
C++ indexing:
* Index specialized types (templated, etc.)
* Better indexing with inheritance (don't just search from root method)
JS indexing:
* Indexing of test files
Other indexing:
* IPDL
* HTML
* WebIDL?
IDL:
* Need to index the name of the IDL class as a type.
== Searching for declarations ==
Perhaps I'll make an index file that can be used to augment the full text search.
This would be similar to augmenting it with filenames.
When doing the analysis, a given decl would generate a fully-qualified name and a line/column number.
This could be a separate kind of analysis line; maybe it could be called "index". I could
also use this for JS, where you could search for ClassName.PropertyName.
The search feature would probably just grep through this file since I want to allow substring searches.
Not sure if that would be fast enough, but it might not be too bad. It would just be defs.
Or I could put in each level of qualification as a separate thing, and they would have to type
a prefix. That way I could do a binary search, which would be much faster.
There are two ways to make this fast:
1. Use codesearch to search through the file. It would probably go in a separate repo.
2. Use binary search. The file would be sorted. For this, though, I would need to include
all levels of qualification. I guess the JS analysis already does this.
3. Just grep through the file. It's hard to see how this would be fast enough though.
Actually, though, I don't want just defs. I also want uses. So this will be a very big file.
I'll start out using binary search. It makes sense to have the crossref code generate this
file I think.
ID table: This will be a map from identifiers (with all levels of
qualification) to symbols. Once we have a symbol, we can look up the
symbol in the crossref file.
== C++ ==
For a given (static type, method) combo, I think I should have one
canonical set of results regardless of whether you're searching from a
def or a use. That set will include:
- all possible method defs that can be dispatched to from that static type
- all possible call sites that might call those methods
- related methods up the inheritance chain?
class A {
virtual void foo() {}
// Result for def:A#foo
// Searches for use:A#foo
};
class B : A {
};
class C : B {
virtual void foo() {}
// Result for def:A#foo, def:B#foo, def:C#foo
// Searches for use:A#foo, use:B#foo, use:C#foo, def:A#foo
};
int main() {
A* a;
B* b;
C* c;
a->foo();
// Searches for def:A#foo, use:A#foo
// Result for use:A#foo
b->foo();
// Searches for def:B#foo, use:A#foo, use:B#foo
// Result for def:B#foo
c->foo();
// Searches for def:C#foo, use:A#foo, use:B#foo, use:C#foo
// Result for use:C#foo
}
What sort of pretty names should I use throughout all this?