[Feature] React Native debug configuration completion inserts an extra comma after comments in launch.json
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 75/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- react-native, typescript, vscode
- Domínio
- devtools
Direção de pesquisa
Comece lendo LaunchJsonCompletionHelper.isCommaImmediatelyBeforeCursor() e o scanner JSONC existente mencionado na issue; confira os testes próximos sobre a inserção de conclusões em torno de comentários. Reproduza as etapas com o launch.json fornecido e, em seguida, verifique se a nova configuração é inserida sem uma vírgula extra e se o documento continua sendo JSONC válido.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
Accepting the React Native completion item in launch.json and completing the configuration wizard can insert an extra comma when a comment separates the cursor from an existing comma.
This turns an otherwise valid launch.json into invalid JSONC.
Steps to Reproduce
-
Open a React Native project in VS Code with React Native Tools enabled.
-
Set
.vscode/launch.jsonto the following:{ "version": "0.2.0", "configurations": [ { "name": "Debug Android Hermes", "request": "launch", "type": "reactnativedirect", "cwd": "${workspaceFolder}", "platform": "android" }, // Add another debug configuration here ] } -
Place the cursor on the blank line immediately below the comment, inside the
configurationsarray. -
Open the Command Palette and run Trigger Suggest.
-
Select the React Native completion item.
-
Complete the extension's configuration wizard.
-
Inspect the inserted configuration.
Note: Use Trigger Suggest → React Native, not the Add Configuration… button. In the tested case, the button relocates the insertion point and does not reproduce this issue.
Expected Behavior
The extension should recognize the existing comma after the preceding configuration and insert the new configuration without adding another comma.
},
// Add another debug configuration here
{
"name": "..."
}
The document should remain valid JSONC.
Actual Behavior
An additional comma is inserted before the new configuration:
},
// Add another debug configuration here
,{
"name": "..."
}
There are now two commas between the configuration objects, separated by a comment, making the document invalid.
Possible Cause
LaunchJsonCompletionHelper.isCommaImmediatelyBeforeCursor() checks preceding lines using trim().endsWith(",") and stops at the first non-empty line.
It does not skip comments to identify the preceding significant JSON token. It also treats a comma at the end of a comment as an actual JSON comma.
Using the existing JSONC scanner to ignore comments and whitespace when identifying the preceding token may address both cases.
- Linguagem predominante
- TypeScript
- Estrelas
- 2.7k
- Forks
- 303
- Merge médio
- 22h 52min
- PRs com merge (30d)
- 36
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoft/vscode-react-native
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
microsoft/vscode-react-native#3062 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
microsoft/vscode-react-native#3055 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
microsoft/vscode-react-native#3053 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
microsoft/vscode-react-native#3037 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
microsoft/vscode-react-native#3036 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de microsoft/vscode-react-native
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
earendil-works/pi-claude-code#36 ·
Mantenedores costumam responder em até 6 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
Resources: New work of jabodetabekTalvez já em andamento @rmt-svc assumiu hoje. Abertaresources
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
railmapgen/rmp-gallery#4167 ·
Mantenedores costumam responder em até 2 dias
-
documentation p1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
microsoft/monaco-editor#5577 ·
Mantenedores costumam responder em até 1 dia