question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable suggestions filter

See original GitHub issue

I want to have autocompletion that doesn’t necessarily require the completion item to start with the same letter as the word so far, e.g. I type foo and my CompletionItemProvider provides bar and baz. Since neither of these start foo no suggestions appear for the user. Basically I recognized that since the user typed foo they most likely meant either bar or baz.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yoanthiebaultcommented, Jun 11, 2020

@shmish111 I got exactly the same issue.

In case it would help you, here the workaround I used:

Monaco extracts the string matching your CompletionItem.range and keeps the suggestion only if its CompletionItem.label or CompletionItem.filterText match it. As I wanted to keep the label, I just defined CompletionItem.filterText attribute with the string matching CompletionItem.range.

With your previous example, we have:

{
      label: '"express"',
      kind: monaco.languages.CompletionItemKind.Function,
      insertText: '"express": "*"',
      range: {
            startLineNumber: position.lineNumber,
            endLineNumber: position.lineNumber,
            startColumn: (position.column - 1), // this starts before the cursor
            endColumn: position.column,
      },
      filterItem: "y"
}

Hope it will help!

1reaction
shmish111commented, Apr 2, 2020

Awesome, thanks @alexdima , I’ll try and get that done and post a link to it here, however that’s quite an undertaking for me as I have not used the VSCode API.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable filtering options in material-ui Autocomplete?
The filterOptions method is intended to give you the freedom to decide which options will be available and which will be hidden.
Read more >
How To Turn Off Autocomplete for Input
Learn how to disable autocomplete of an input field. Turn Off Autocomplete. Use the autocomplete attribute to turn off autocomplete for input fields: ......
Read more >
Changing filter suggestions | Looker
Enabling or disabling filter suggestions. This section describes the following LookML parameters that let you enable or disable filter ...
Read more >
Disable internal filter on Autocomplete | JavaScript - EJ 2 ...
I need to use the autocomplete, but not filter on the text entered, while still passing the entered characters to the server to...
Read more >
How to disable autocomplete feature for DataGrid filter row
I don't want that because it automatically filters records. I set autocomplete: 'off' in onEditorPreparing, which appears in the attributes ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found