Method
quote_collection_if_needed
(
self,
text: str,
collection: Collection[Any],
text_before_cursor: str,
)
Source from the content-addressed store, hash-verified
| 1248 | return '`' + item + '`' |
| 1249 | |
| 1250 | def quote_collection_if_needed( |
| 1251 | self, |
| 1252 | text: str, |
| 1253 | collection: Collection[Any], |
| 1254 | text_before_cursor: str, |
| 1255 | ) -> Collection[Any]: |
| 1256 | # checking text.startswith() first is an optimization; is_inside_quotes() covers more cases |
| 1257 | if text.startswith('`') or is_inside_quotes(text_before_cursor, len(text_before_cursor)) == 'backtick': |
| 1258 | return [self.maybe_quote_identifier(x) if isinstance(x, str) else x for x in collection] |
| 1259 | return collection |
| 1260 | |
| 1261 | def word_parts_match( |
| 1262 | self, |