Skip to content

Commit

Permalink
fix(ls): provide completion items with proper filtering
Browse files Browse the repository at this point in the history
Before this change, completion items were only
provided if they started by the filtered text.

With this change, completion items are provided
if they include filtered text.

Refs swagger-api/swagger-editor#3216
  • Loading branch information
char0n committed Apr 27, 2023
1 parent d09a82b commit 19a9976
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ export class DefaultCompletionService implements CompletionService {
*/
item.filterText = text.substring(nodeSourceMap.offset, nodeSourceMap.endOffset!);

if (word && word.length > 0 && unquotedOriginalInsertText?.startsWith(word)) {
if (word && word.length > 0 && unquotedOriginalInsertText?.includes(word)) {
collector.add(item);
} else if (!word) {
collector.add(item);
Expand Down

0 comments on commit 19a9976

Please sign in to comment.