@@ -48,13 +48,6 @@ function brackets.add_brackets(filetype, item)
48
48
if brackets .has_brackets_in_front (text_edit , brackets_for_filetype [1 ]) then
49
49
return ' skipped' , text_edit , # brackets_for_filetype [1 ]
50
50
end
51
- -- check if configuration incidates we should skip
52
- if not brackets .should_run_resolution (filetype , ' kind' ) then return ' check_semantic_token' , text_edit , 0 end
53
- -- not a function, skip
54
- local CompletionItemKind = require (' blink.cmp.types' ).CompletionItemKind
55
- if item .kind ~= CompletionItemKind .Function and item .kind ~= CompletionItemKind .Method then
56
- return ' check_semantic_token' , text_edit , 0
57
- end
58
51
59
52
-- if the item already contains the brackets, conservatively skip adding brackets
60
53
-- todo: won't work for snippets when the brackets_for_filetype is { '{', '}' }
@@ -63,6 +56,14 @@ function brackets.add_brackets(filetype, item)
63
56
return ' skipped' , text_edit , 0
64
57
end
65
58
59
+ -- check if configuration incidates we should skip
60
+ if not brackets .should_run_resolution (filetype , ' kind' ) then return ' check_semantic_token' , text_edit , 0 end
61
+ -- not a function, skip
62
+ local CompletionItemKind = require (' blink.cmp.types' ).CompletionItemKind
63
+ if item .kind ~= CompletionItemKind .Function and item .kind ~= CompletionItemKind .Method then
64
+ return ' check_semantic_token' , text_edit , 0
65
+ end
66
+
66
67
text_edit = vim .deepcopy (text_edit )
67
68
-- For snippets, we add the cursor position between the brackets as the last placeholder
68
69
if item .insertTextFormat == vim .lsp .protocol .InsertTextFormat .Snippet then
0 commit comments