Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201028153306-37f0764111ff / godoc / analysis / README
1
2 Type and Pointer Analysis to-do list
3 ====================================
4
5 Alan Donovan <adonovan@google.com>
6
7
8 Overall design
9 --------------
10
11 We should re-run the type and pointer analyses periodically,
12 as we do with the indexer.
13
14 Version skew: how to mitigate the bad effects of stale URLs in old pages?
15 We could record the file's length/CRC32/mtime in the go/loader, and
16 refuse to decorate it with links unless they match at serving time.
17
18 Use the VFS mechanism when (a) enumerating packages and (b) loading
19 them.  (Requires planned changes to go/loader.)
20
21 Future work: shard this using map/reduce for larger corpora.
22
23 Testing: how does one test that a web page "looks right"?
24
25
26 Bugs
27 ----
28
29 (*ssa.Program).Create requires transitively error-free packages.  We
30 can make this more robust by making the requirement transitively free
31 of "hard" errors; soft errors are fine.
32
33 Markup of compiler errors is slightly buggy because they overlap with
34 other selections (e.g. Idents).  Fix.
35
36
37 User Interface
38 --------------
39
40 CALLGRAPH:
41 - Add a search box: given a search node, expand path from each entry
42   point to it.
43 - Cause hovering over a given node to highlight that node, and all
44   nodes that are logically identical to it.
45 - Initially expand the callgraph trees (but not their toggle divs).
46
47 CALLEES:
48 - The '(' links are not very discoverable.  Highlight them?
49
50 Type info:
51 - In the source viewer's lower pane, use a toggle div around the
52   IMPLEMENTS and METHODSETS lists, like we do in the package view.
53   Only expand them initially if short.
54 - Include IMPLEMENTS and METHOD SETS information in search index.
55 - URLs in IMPLEMENTS/METHOD SETS always link to source, even from the
56   package docs view.  This makes sense for links to non-exported
57   types, but links to exported types and funcs should probably go to
58   other package docs.
59 - Suppress toggle divs for empty method sets.
60
61 Misc:
62 - The [X] button in the lower pane is subject to scrolling.
63 - Should the lower pane be floating?  An iframe?
64   When we change document.location by clicking on a link, it will go away.
65   How do we prevent that (a la Gmail's chat windows)?
66 - Progress/status: for each file, display its analysis status, one of:
67    - not in analysis scope
68    - type analysis running...
69    - type analysis complete
70      (+ optionally: there were type errors in this file)
71    And if PTA requested:
72    - type analysis complete; PTA not attempted due to type errors
73    - PTA running...
74    - PTA complete
75 - Scroll the selection into view, e.g. the vertical center, or better
76   still, under the pointer (assuming we have a mouse).
77
78
79 More features
80 -------------
81
82 Display the REFERRERS relation?  (Useful but potentially large.)
83
84 Display the INSTANTIATIONS relation? i.e. given a type T, show the set of
85 syntactic constructs that can instantiate it:
86     var x T
87     x := T{...}
88     x = new(T)
89     x = make([]T, n)
90     etc
91     + all INSTANTIATIONS of all S defined as struct{t T} or [n]T
92 (Potentially a lot of information.)
93 (Add this to guru too.)
94
95
96 Optimisations
97 -------------
98
99 Each call to addLink takes a (per-file) lock.  The locking is
100 fine-grained so server latency isn't terrible, but overall it makes
101 the link computation quite slow.  Batch update might be better.
102
103 Memory usage is now about 1.5GB for GOROOT + go.tools.  It used to be 700MB.
104
105 Optimize for time and space.  The main slowdown is the network I/O
106 time caused by an increase in page size of about 3x: about 2x from
107 HTML, and 0.7--2.1x from JSON (unindented vs indented).  The JSON
108 contains a lot of filenames (e.g. 820 copies of 16 distinct
109 filenames).  20% of the HTML is L%d spans (now disabled).  The HTML
110 also contains lots of tooltips for long struct/interface types.
111 De-dup or just abbreviate?  The actual formatting is very fast.