-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTables.rtf
272 lines (219 loc) · 7.51 KB
/
Tables.rtf
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
{\fonttbl\f0\fnil\fcharset0 Verdana;\f1\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\deftab360
\pard\pardeftab360\ql\qnatural\pardirnatural
\f0\fs28 \cf0 This file describes the tables used by the object-model databases associated with each directory editor. The tables are built using a thread which recursively searches the directory for assemblies, uses Cecil to open them, and updates the table if new information is found. Information associated with old or missing assemblies is also removed by the thread.\
\
Note that the table schema is very important: the responsiveness of important UI actions like auto-complete is driven by how fast we can query the database for the information we need. We also want to keep the database size as small as possible so that as much of the tables as possible fits into the sqlite and file-system caches (these sizes can be rather large, for example Continuum.db is 17M).\
\
Times are in System.DateTime ticks. Field names appended with # are part of the primary key. Field names appended with $ are foreign keys. \
\
Type names are as generated by Cecil and a bit complex. By convention these are categorized using three groups:\
\
1) root_names are the types in the Types table and the name may include a generic argument count (e.g. "System.Int32" or "System.Collections.Dictionary`2"). \
\
2) special_names are in the SpecialTypes table and are normally arrays, instantiated generics, or pointers (e.g. "System.Int32[]", "System.Collections.Dictionary`2<System.Int32, System.String>", or "System.Int32*").\
\
3) type_names may be root or special names. Note that this name may not be in either of Types or SpecialTypes if it is a root type declared in an assembly which couldn't be found (or hasn't been parsed yet).\
\
\b\fs48 Assemblies
\b0\fs28 \
\b path#
\b0 \
Full path to the assembly.\
\
\b name
\b0 \
The name of the assembly, eg "mcocoa".\
\
\b culture
\b0 \
The culture the assembly was compiled against, eg "neutral" or "en-us".\
\
\b version
\b0 \
The version of the assembly as major.minor.build.revision, eg "0.4.44.0".\
\
\b write_time
\b0 \
The time at which the assembly was generated.\
\
\b assembly
\b0 \
Integer identifying the assembly. Will not be zero (but may be reused if another assembly is deleted).\
\
\b in_use
\b0 \
1 if the assembly is in the Types table. 0 if not.\
\
\b\fs48 Namespaces
\b0\fs28 \
\b parent#
\b0 \
The name of a namespace, e.g. "System" or "System.Collections".\
\
\b assembly#$
\b0 \
The assembly used to generate this tuple.\
\
\b children
\b0 \
Semi-colon separated list of namespace children, e.g. "CodeDom;CodeDom.Compiler;Collections;Collections.Generic;..." or "Generic".\
\
\b\fs48 Types
\b0\fs28 \
\b root_name#
\b0 \
Full name of the type as generated by Cecil.\
\
\b assembly$
\b0 \
Assemblies foreign key.\
\
\b namespace
\b0 \
The namespace the type was declared within, eg "System.Collections" or empty if the type is within the global namespace.\
\
\b name
\b0 \
Completely undecorated type name: does not include namespace, outer type, or generic argument counts.\
\
\b base_root_name
\b0 \
Types foreign key or empty if the type has no base (eg if it's "System.Object" or an interface).\
\
\b interface_root_names
\b0 \
Colon terminated list of the root names of each interface directly implemented by the type. Empty if the type implementes no interfaces.\
\
\b generic_arg_count
\b0 \
Number of generic arguments for the type.\
\
\b generic_arg_names
\b0 \
Semi-colon separated list of the generic argument names for the type. Note that these are all the unbound type names. Empty if the type is not generic.\
\
\b visibility
\b0 \
0 for public, 1 for family, 2 for internal, and 3 for private.\
\
\b attributes
\b0 \
Bitmask where if 0x01 is set the type is abstract, 0x02 sealed, 0x04 an interface, 0x08 a value type, 0x10 an enum, 0x20 nested, or 0x40 delegate.\
\
This table will contain only the types for the most recent version of an assembly name where the version is determined first by the version and, if those are equal, the write time. If the assembly is deleted then its types are also deleted and those of the next most recent assembly are added. The methods and Fields tables are also updated in this way.\
\
Note that it is technically possible for two completely different assemblies to declare types with the same full names. But this is tough for us to handle because when we do lookups we have the type's name but don't know which assembly it is in. So, rather than try to deal with this we simply punt and add only one of the types to our table.\
\
\b\fs48 SpecialTypes
\b0\fs28 \
\b special_name#$
\b0 \
The full type name generated by Cecil.\
\
\b element_type_name
\b0 \
Types or SpecialTypes foreign key or empty. For arrays this will be the element type, for generic instances the type sans generic arguments (i.e. "System.IEquatable`1"), for pointers the type being pointed to, and for other empty.\
\
\b rank
\b0 \
The number of dimensions in the array, or zero if the type is not an array.\
\
\b generic_type_names
\b0 \
Colon terminated list of the type names of the instantiated generic arguments. Empty if the type is not an instantiated generic.\
\
\b kind
\b0 \
0 for array, 1 for generic instance, 2 for pointer, and 3 for other (function pointer, modifier, pinned, reference, sentinel).\
\
\b kind_name
\b0 \
For arrays this will be "array-type", for generic instances it will be something like "System.IEquatable`1", for pointers "pointer-type", and for other types "other-type".\
\
Note that unlike the other tables the rows in this table are not pruned.\
\
\b\fs48 Methods
\b0\fs28 \
\b display_text#
\b0 \
Formatted as return-type:declaring-type:name:generic-args:arg-types:arg-names where generic-args and arg-types/arg-names may be empty. All arguments are separated by ';' characters. Types are not special or root types: they are human readable versions of the type. generic-args is empty if the method is not generic or if the generic arguments can be deduced.\
\
\b name
\b0 \
Undecorated method name.\
\
\b return_type_name
\b0 \
Types or SpecialTypes foreign key.\
\
\b declaring_root_name$
\b0 \
Types foreign key. \
\
\b params_count
\b0 \
Number of parameters used by the method (not including the implicit this).\
\
\b generic_arg_count
\b0 \
Number of generic arguments for the method.\
\
\b assembly$
\b0 \
Assemblies foreign key.\
\
\b extend_type_name
\b0 \
If the method is an extension method then this is the name of the type it extends, otherwise it is empty.\
\
\b access
\b0 \
0 for public, 1 for family, 2 for internal, and 3 for private.\
\
\b static
\b0 \
1 if the method is static, 0 if not.\
\
\b file_path
\b0 \
Full path of the file the method is declared within. Empty if the assembly was compiled without debug info.\
\
\b line
\b0 \
The 1-based line number of the start of the method. May be -1.\
\
\b kind
\b0 \
0 for normal, 1 for property getter, 2 for property setter, 3 for indexer getter, 4 for indexer setter, 5 for event (add, remove, or fire), 6 for constructor, 7 for operator, 8 for extension method, or 9 for finalizer.\
\
\b\fs48 Fields
\b0\fs28 \
\b name#
\b0 \
Name of the field, eg "m_customer".\
\
\b declaring_root_name#$
\b0 \
Types foreign key. \
\
\b type_name
\b0 \
Types or SpecialTypes foreign key.\
\
\b assembly$
\b0 \
Assemblies foreign key.\
\
\b access
\b0 \
0 for public, 1 for family, 2 for internal, and 3 for private.\
\
\b static
\b0 \
1 if the field is static, 0 if not.\
\
\pard\pardeftab360\ql\qnatural\pardirnatural
\f1\fs24 \cf0 }