feat: Add livegrep and lsp referecnes

This commit is contained in:
TJ DeVries
2020-08-27 22:12:44 -04:00
parent c4dd59ff65
commit 7e9f38a87e
10 changed files with 475 additions and 166 deletions

View File

@@ -1,5 +1,3 @@
local ceil = math.ceil
local log = require('telescope.log')
local util = require('telescope.utils')
@@ -26,8 +24,9 @@ function Sorter:new(opts)
}, Sorter)
end
function Sorter:score(prompt, line)
return self:scoring_function(prompt, line)
function Sorter:score(prompt, entry)
-- TODO: Decide if we actually want to check the type every time.
return self:scoring_function(prompt, type(entry) == "string" and entry or entry.ordinal)
end
function sorters.new(...)
@@ -143,6 +142,10 @@ sorters.get_norcalli_sorter = function()
return -1
end
if #prompt > 2 and denominator < 0.5 then
return -1
end
return 1 / denominator
end
}