[Backport 5.2] squirrel: Re-enable code nav for .pcc/.pc files (#58191)

squirrel: Re-enable code nav for .pcc/.pc files (#58148)

(cherry picked from commit d358b35271)

Co-authored-by: Varun Gandhi <varun.gandhi@sourcegraph.com>
This commit is contained in:
sourcegraph-release-guild-bot 2023-11-08 09:17:32 -05:00 committed by GitHub
parent eacf943e32
commit a8607d7afe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -21,6 +21,7 @@ go_library(
deps = [
"//cmd/symbols/types",
"//internal/api",
"//internal/jsonc",
"//internal/search",
"//internal/search/result",
"//internal/types",

View File

@ -51,7 +51,12 @@
"h++",
"hh",
"h",
"hpp"
"hpp",
// For Pro*C/C++ which was requested by a customer
// See: https://github.com/sourcegraph/customer/issues/124
// And https://web.archive.org/web/20231107051418/https://otl.sourceforge.net/otl3_ex59.htm
"pc",
"pcc"
],
"csharp": [
"cs",

View File

@ -2,7 +2,6 @@ package squirrel
import (
_ "embed"
"encoding/json"
"fmt"
"github.com/grafana/regexp"
@ -15,6 +14,8 @@ import (
"github.com/smacker/go-tree-sitter/python"
"github.com/smacker/go-tree-sitter/ruby"
"github.com/smacker/go-tree-sitter/typescript/tsx"
"github.com/sourcegraph/sourcegraph/internal/jsonc"
)
//go:embed language-file-extensions.json
@ -23,7 +24,7 @@ var languageFileExtensionsJson string
// Mapping from langauge name to file extensions.
var langToExts = func() map[string][]string {
var m map[string][]string
err := json.Unmarshal([]byte(languageFileExtensionsJson), &m)
err := jsonc.Unmarshal(languageFileExtensionsJson, &m)
if err != nil {
panic(err)
}