Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit 56fb790

Browse files
authored
Merge pull request #304 from windwp/customize_label_for_path
add customize label for path
2 parents 194c7ef + 949de53 commit 56fb790

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/completion/source/path.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ local vim = vim
33
local loop = vim.loop
44
local api = vim.api
55
local util = require 'completion.util'
6+
local opt = require 'completion.option'
67

78
M.items = {}
89
M.callback = false
@@ -36,12 +37,14 @@ local fileTypesMap = setmetatable({
3637

3738
M.getCompletionItems = function(prefix)
3839
local complete_items = {}
40+
local kind = 'Path'
41+
kind = opt.get_option('customize_lsp_label')[kind] or kind
3942
for _, val in ipairs(M.items) do
4043
local score = util.fuzzy_score(prefix, val.name)
4144
if score < #prefix/3 or #prefix == 0 then
4245
table.insert(complete_items, {
4346
word = val.name,
44-
kind = 'Path',
47+
kind = kind,
4548
menu = fileTypesMap[val.type],
4649
score = score,
4750
icase = 1,

0 commit comments

Comments
 (0)