MCPcopy Index your code
hub / github.com/boyter/scc / LoadLanguageFeature

Function LoadLanguageFeature

processor/processor.go:347–372  ·  view source on GitHub ↗

LoadLanguageFeature will load a single feature as requested given the name

(loadName string)

Source from the content-addressed store, hash-verified

345
346// LoadLanguageFeature will load a single feature as requested given the name
347func LoadLanguageFeature(loadName string) {
348 if !isLazy {
349 return
350 }
351
352 // Check if already loaded and if so return because we don't need to do it again
353 LanguageFeaturesMutex.Lock()
354 _, ok := LanguageFeatures[loadName]
355 LanguageFeaturesMutex.Unlock()
356 if ok {
357 return
358 }
359
360 var name string
361 var value Language
362
363 for name, value = range languageDatabase {
364 if name == loadName {
365 break
366 }
367 }
368
369 startTime := makeTimestampNano()
370 processLanguageFeature(loadName, value)
371 printTraceF("nanoseconds to build language %s features: %d", loadName, makeTimestampNano()-startTime)
372}
373
374func processLanguageFeature(name string, value Language) {
375 complexityTrie := &Trie{}

Callers 4

newFileJobFunction · 0.85
TestLoadLanguageFeatureFunction · 0.85
processFileFunction · 0.85

Calls 3

makeTimestampNanoFunction · 0.85
processLanguageFeatureFunction · 0.85
printTraceFFunction · 0.85

Tested by 2

TestLoadLanguageFeatureFunction · 0.68