Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

108
Views
How to stop autocompletion items to show with any letter

I'm making a vscode extension which involves using vscode.languages.registerCompletionItemProvider I have defined several trigger characters to activate the item providers in my json file (see code below), it works, when i press '?' for instance, I do have the list of items that I expect. However, it also activates with any letter of the alphabet. Would you now how to deactivate this behaviour?

context.subscriptions.push(vscode.languages.registerCompletionItemProvider (
        { language: 'json', scheme: 'file' },
        {

            provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, compContext: vscode.CompletionContext) {
    
                const newItem = (text:string) => {

                    const item = new vscode.CompletionItem(text, vscode.CompletionItemKind.Text);
                    const trigger = document.lineAt(position).text.substring(position.character-1, position.character);
                    item.range = new vscode.Range(position, position);
                    return item;
                };
                
                return [
                    newItem('Riri'),
                    newItem('Fifi'),
                    newItem('Loulou')
                    ];
        },
        '?',
        ',' 
        ));
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!