Add ability to use contextual queries to find references when already on a reference

Aberta Para iniciantes
#592 2 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
68/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
typescript
Domínio
devtools

Direção de pesquisa

Comece em extensions/ql-vscode/src/contextual/templateProvider.ts na linha 70, onde os resultados são filtrados em relação à posição selecionada. Rastreie como os resultados de contextual find-references são produzidos para declarações e referências. Está concluído quando selecionar uma referência em um arquivo-fonte Java encontra as mesmas referências que selecionar sua declaração, enquanto o comportamento das declarações permanece intacto.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug enhancement VSCode

I'm not exactly sure whether this is a feature request or a bug report. Regardless, this is behaviour that is not implemented, but I would expect it to be.

When running the find references contextual query, on a token in a database source file, no references will be found if the token represents a reference itself. References will only be found if the selected token is a declaration. For instance:

int /* 1 */ myMethod() {
  /* 2 */ myMethod();
  /* 3 */ myMethod();
}

If you place the caret at 2 or 3, no references will be found. If you place the caret at 1 References will be found at 2 and 3. Most other language servers will find references for 2 and 3 regardless of which reference is selected.

The problem is not related to the queries themselves. Rather, it happens here:
https://github.com/aeisenberg/vscode-codeql/blob/353a87de12ca818293aeb3199d057a23a24cc403/extensions/ql-vscode/src/contextual/templateProvider.ts#L70-L70

This function will take all possible results and filter out results that do not contain the selected position. This makes sense when the selected position is the declaration, but it does not make sense if the position is a reference.

Linguagem predominante
TypeScript
Estrelas
539
Forks
240
Merge médio
2d 6h
PRs com merge (30d)
29

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de github/vscode-codeql

Todas as issues de github/vscode-codeql

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.