File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 8484--- This function calculates the bytes of the entry to display calculating the number
8585--- of character differences instead of just byte difference.
8686ghost_text_view .text_gen = function (self , line , cursor_col )
87- local word = self .entry :get_insert_text ()
87+ local word
88+ local completion_kind = self .entry :get_kind ()
89+ local completion_item = self .entry :get_completion_item ()
90+ -- Check if completion_kind indicates a snippet
91+ -- Handle custom snippet
92+ if completion_kind == 15 and completion_item and completion_item .documentation and completion_item .documentation .value then
93+ local doc_value = completion_item .documentation .value
94+ local pattern = ' ```(.-)\n (.-)\n ```'
95+ _ , word = doc_value :match (pattern )
96+ else
97+ -- Handle built-in snippet and non-snippet completion
98+ word = self .entry :get_insert_text ()
99+ end
88100 if self .entry :get_completion_item ().insertTextFormat == types .lsp .InsertTextFormat .Snippet then
89101 word = tostring (snippet .parse (word ))
90102 end
You can’t perform that action at this time.
0 commit comments