mirror of https://github.com/golang/go.git
internal/lsp/source: remove the unused source.DetectLanguage
Change-Id: If146b609f7dbf019cb11b27c73d685bcaf5a5075 Reviewed-on: https://go-review.googlesource.com/c/tools/+/382236 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Peter Weinberger <pjw@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
3e30e21b53
commit
962260a678
|
|
@ -178,25 +178,6 @@ func FileKindForLang(langID string) FileKind {
|
|||
}
|
||||
}
|
||||
|
||||
func DetectLanguage(langID, filename string) FileKind {
|
||||
// use the langID if the client sent it
|
||||
if kind := FileKindForLang(langID); kind != UnknownKind {
|
||||
return kind
|
||||
}
|
||||
// Detect the language based on the file extension.
|
||||
switch ext := filepath.Ext(filename); ext {
|
||||
case ".mod":
|
||||
return Mod
|
||||
case ".sum":
|
||||
return Sum
|
||||
case ".go":
|
||||
return Go
|
||||
default:
|
||||
// (for instance, before go1.15 cgo files had no extension)
|
||||
return Go
|
||||
}
|
||||
}
|
||||
|
||||
func (k FileKind) String() string {
|
||||
switch k {
|
||||
case Go:
|
||||
|
|
|
|||
Loading…
Reference in New Issue