@@ -80,14 +80,16 @@ def pylsp_completions(config, document, position):
80
80
and use_snippets (document , position )
81
81
)
82
82
83
+ escape_path_sep = settings .get ("escape_path_sep" , snippet_support )
84
+
83
85
ready_completions = [
84
86
_format_completion (
85
87
c ,
86
88
markup_kind = preferred_markup_kind ,
87
89
include_params = include_params if c .type in ["class" , "function" ] else False ,
88
90
resolve = resolve_eagerly ,
89
91
resolve_label_or_snippet = (i < max_to_resolve ),
90
- snippet_support = snippet_support ,
92
+ escape_path_sep = escape_path_sep ,
91
93
)
92
94
for i , c in enumerate (completions )
93
95
]
@@ -102,7 +104,7 @@ def pylsp_completions(config, document, position):
102
104
include_params = False ,
103
105
resolve = resolve_eagerly ,
104
106
resolve_label_or_snippet = (i < max_to_resolve ),
105
- snippet_support = snippet_support ,
107
+ escape_path_sep = escape_path_sep ,
106
108
)
107
109
completion_dict ["kind" ] = lsp .CompletionItemKind .TypeParameter
108
110
completion_dict ["label" ] += " object"
@@ -117,7 +119,7 @@ def pylsp_completions(config, document, position):
117
119
include_params = False ,
118
120
resolve = resolve_eagerly ,
119
121
resolve_label_or_snippet = (i < max_to_resolve ),
120
- snippet_support = snippet_support ,
122
+ escape_path_sep = escape_path_sep ,
121
123
)
122
124
completion_dict ["kind" ] = lsp .CompletionItemKind .TypeParameter
123
125
completion_dict ["label" ] += " object"
@@ -227,7 +229,7 @@ def _format_completion(
227
229
include_params = True ,
228
230
resolve = False ,
229
231
resolve_label_or_snippet = False ,
230
- snippet_support = False ,
232
+ escape_path_sep = False ,
231
233
):
232
234
completion = {
233
235
"label" : _label (d , resolve_label_or_snippet ),
@@ -253,7 +255,7 @@ def _format_completion(
253
255
254
256
# Escape to prevent conflicts with the code snippets grammer
255
257
# See also https://github.com/python-lsp/python-lsp-server/issues/373
256
- if snippet_support :
258
+ if escape_path_sep :
257
259
path = path .replace ("\\ " , "\\ \\ " )
258
260
path = path .replace ("/" , "\\ /" )
259
261
0 commit comments