diff --git a/build/e2e_test.go b/build/e2e_test.go index 0d96e2550..b2f25b4e6 100644 --- a/build/e2e_test.go +++ b/build/e2e_test.go @@ -1015,13 +1015,24 @@ type aStruct struct {} `), query: &query.Substring{Content: true, Pattern: "aStruct"}, wantLanguage: "Go", - // 7000 (full base match) + 900 (Go interface) + 500 (word) + 10 (file order) + // 7000 (full base match) + 900 (Go struct) + 500 (word) + 10 (file order) wantScore: 8410, }, { fileName: "src/net/http/client.go", content: []byte(` package http +func aFunc() bool {} +`), + query: &query.Substring{Content: true, Pattern: "aFunc"}, + wantLanguage: "Go", + // 7000 (full base match) + 800 (Go function) + 500 (word) + 10 (file order) + wantScore: 8310, + }, + { + fileName: "src/net/http/client.go", + content: []byte(` +package http func Get() { panic("") } diff --git a/contentprovider.go b/contentprovider.go index 86e33cae2..f4db1f710 100644 --- a/contentprovider.go +++ b/contentprovider.go @@ -669,10 +669,8 @@ func scoreKind(language string, kind string) float64 { factor = 9 case "interface": factor = 8 - case "function", "func": + case "function", "func", "method": factor = 7 - case "method": - factor = 6 case "member", "field": factor = 5.5 case "constant", "const": @@ -730,9 +728,7 @@ func scoreKind(language string, kind string) float64 { // for each case a description of the fields in ctags in the comment case "type": // interface struct talias factor = 10 - case "method": // methodSpec - factor = 8.5 - case "function": // func + case "method", "function": // methodSpec factor = 8 case "variable": // var member factor = 7