fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

scoring: score methods and funcs the same (#666)

I don't remember if there was a good reason to score methods and
functions differently, but I have found examples where the difference
between the two scores causes the better result to be lower ranked,
although it has better file-order boost.

Scip-ctags distinguishes between methods and functions, universal-ctags
does not.

Test plan:
updated score tests

+14 -7
+12 -1
build/e2e_test.go
··· 1015 1015 `), 1016 1016 query: &query.Substring{Content: true, Pattern: "aStruct"}, 1017 1017 wantLanguage: "Go", 1018 - // 7000 (full base match) + 900 (Go interface) + 500 (word) + 10 (file order) 1018 + // 7000 (full base match) + 900 (Go struct) + 500 (word) + 10 (file order) 1019 1019 wantScore: 8410, 1020 + }, 1021 + { 1022 + fileName: "src/net/http/client.go", 1023 + content: []byte(` 1024 + package http 1025 + func aFunc() bool {} 1026 + `), 1027 + query: &query.Substring{Content: true, Pattern: "aFunc"}, 1028 + wantLanguage: "Go", 1029 + // 7000 (full base match) + 800 (Go function) + 500 (word) + 10 (file order) 1030 + wantScore: 8310, 1020 1031 }, 1021 1032 { 1022 1033 fileName: "src/net/http/client.go",
+2 -6
contentprovider.go
··· 669 669 factor = 9 670 670 case "interface": 671 671 factor = 8 672 - case "function", "func": 672 + case "function", "func", "method": 673 673 factor = 7 674 - case "method": 675 - factor = 6 676 674 case "member", "field": 677 675 factor = 5.5 678 676 case "constant", "const": ··· 730 728 // for each case a description of the fields in ctags in the comment 731 729 case "type": // interface struct talias 732 730 factor = 10 733 - case "method": // methodSpec 734 - factor = 8.5 735 - case "function": // func 731 + case "method", "function": // methodSpec 736 732 factor = 8 737 733 case "variable": // var member 738 734 factor = 7