directory_indexer: follow the Kythe schema; don't emit language VName components for files
Reviewers: #core_team, zarko
Subscribers: #core_team
@@ -117,9 +117,6 @@ func emitPath(path string, info os.FileInfo, err error) error {
digest := sha256.Sum256(contents)
vName.Signature = hex.EncodeToString(digest[:])
- if vName.Language == "" {
- vName.Language = sourceLanguage(path)
- }
if vName.Path == "" {
vName.Path = path
}
@@ -158,17 +155,3 @@ func main() {
}
}
}
-
-func sourceLanguage(path string) string {
- ext := strings.TrimPrefix(strings.ToLower(filepath.Ext(path)), ".")
- switch ext {
- case "java", "go":
- return ext
- case "py":
- return "python"
- case "cc", "cpp", "h":
- return "c++"
- default:
- return ""
- }
-}
