Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

105
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda