···6868 // SubRepositories is a path => sub repository map.
6969 SubRepositories map[string]*zoekt.Repository
70707171+ // DisableCTags disables the generation of ctags metadata.
7272+ DisableCTags bool
7373+7174 // Path to exuberant ctags binary to run
7275 CTags string
7376···9194 hasher.Write([]byte(fmt.Sprintf("%t", o.CTagsMustSucceed)))
9295 hasher.Write([]byte(fmt.Sprintf("%d", o.SizeMax)))
9396 hasher.Write([]byte(fmt.Sprintf("%q", o.LargeFiles)))
9797+ hasher.Write([]byte(fmt.Sprintf("%t", o.DisableCTags)))
94989599 return fmt.Sprintf("%x", hasher.Sum(nil))
96100}
···239243 finishedShards: map[string]string{},
240244 }
241245246246+ if b.opts.DisableCTags {
247247+ b.opts.CTags = ""
248248+ }
249249+242250 if b.opts.CTags == "" && b.opts.CTagsMustSucceed {
243251 return nil, fmt.Errorf("ctags binary not found, but CTagsMustSucceed set")
244252 }
···251259252260 b.parser = parser
253261 }
262262+254263 if _, err := b.newShardBuilder(); err != nil {
255264 return nil, err
256265 }
+10-8
cmd/flags.go
···3838}
39394040var (
4141- sizeMax = flag.Int("file_limit", 128*1024, "maximum file size")
4242- trigramMax = flag.Int("max_trigram_count", 20000, "maximum number of trigrams per document")
4343- shardLimit = flag.Int("shard_limit", 100<<20, "maximum corpus size for a shard")
4444- parallelism = flag.Int("parallelism", 4, "maximum number of parallel indexing processes.")
4545- indexDir = flag.String("index", build.DefaultDir, "directory for search indices")
4646- version = flag.Bool("version", false, "Print version number")
4747- ctags = flag.Bool("require_ctags", false, "If set, ctags calls must succeed.")
4848- largeFiles = largeFilesFlag{}
4141+ sizeMax = flag.Int("file_limit", 128*1024, "maximum file size")
4242+ trigramMax = flag.Int("max_trigram_count", 20000, "maximum number of trigrams per document")
4343+ shardLimit = flag.Int("shard_limit", 100<<20, "maximum corpus size for a shard")
4444+ parallelism = flag.Int("parallelism", 4, "maximum number of parallel indexing processes.")
4545+ indexDir = flag.String("index", build.DefaultDir, "directory for search indices")
4646+ version = flag.Bool("version", false, "Print version number")
4747+ disableCTags = flag.Bool("disable_ctags", false, "If set, ctags will not be called.")
4848+ ctags = flag.Bool("require_ctags", false, "If set, ctags calls must succeed.")
4949+ largeFiles = largeFilesFlag{}
4950)
50515152func init() {
···6465 SizeMax: *sizeMax,
6566 ShardMax: *shardLimit,
6667 IndexDir: *indexDir,
6868+ DisableCTags: *disableCTags,
6769 CTagsMustSucceed: *ctags,
6870 LargeFiles: largeFiles,
6971 TrigramMax: *trigramMax,
+9-1
cmd/zoekt-sourcegraph-indexserver/main.go
···141141 // LargeFiles is a slice of glob patterns where matching files are
142142 // indexed regardless of their size.
143143 LargeFiles []string
144144+145145+ // Symbols is a boolean that indicates whether to generate ctags metadata or not
146146+ Symbols bool
144147}
145148146149func (o *IndexOptions) toArgs() []string {
147147- args := make([]string, 0, len(o.LargeFiles)*2)
150150+ args := make([]string, 0, len(o.LargeFiles)*2+1)
151151+ if o.Symbols {
152152+ args = append(args, "-require_ctags")
153153+ } else {
154154+ args = append(args, "-disable_ctags")
155155+ }
148156 for _, a := range o.LargeFiles {
149157 args = append(args, "-large_file", a)
150158 }
+3-2
toc.go
···2727// 13: content checksums
2828// 14: languages
2929// 15: rune based symbol sections
3030-// 16: store ctags metadata
3030+// 16: ctags metadata
3131const IndexFormatVersion = 16
32323333// FeatureVersion is increased if a feature is added that requires reindexing data
···3939// 6: Include '#' into the LineFragment template
4040// 7: Record skip reasons in the index.
4141// 8: Record source path in the index.
4242-const FeatureVersion = 8
4242+// 9: Store ctags metadata
4343+const FeatureVersion = 9
43444445type indexTOC struct {
4546 fileContents compoundSection