Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Clarify usage of sourceModified flag

Abierto
#376 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
20/100
Tipo de issue
Documentación
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
vscode

Línea de trabajo

Comienza revisando la definición de sourceModified citada en este issue y la discusión y el issue vinculados de VS Code. Compara el comportamiento documentado con los registros de requests y, después, aclara la semántica prevista y el comportamiento esperado del cliente después de guardar; se considera terminado cuando la especificación resuelve si el flag o el momento de los requests es incorrecto.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I'm trying to improve handling of breakpoints when there are modified files. There's a sourceModified flag but the spec is not very detailed about what it means:

  /**
   * A value of true indicates that the underlying source has been modified
   * which results in new breakpoint locations.
   */

There's a little more info from @weinand at https://github.com/microsoft/vscode/issues/8077#issuecomment-230244837 which says:

If breakpoints are changed and ...

  • source is not dirty then a setBreakpoints request with the attribute sourceModified set to false is issued immediately.
  • source is dirty, all breakpoint modifications are tracked but no setBreakpoints requests are issued until the next save of the source. In the meantime breakpoints are shown as unverified. After the save a single setBreakpoint request with the attribute sourceModified set to true is issued.

In both cases the result status returned from the setBreakpoints request is applied immediately.

However, this doesn't seem to match what I'm seeing when testing, because sourceModified is false even when my file is modified:

// Add a breakpoint on line 1
[10:52:44] [DAP] [Info] ==> {"command":"setBreakpoints","arguments":{"source":{"name":"main.dart","path":"/.../main.dart"},"lines":[1],"breakpoints":[{"line":1}],"sourceModified":false},"type":"request","seq":8}

// Modify file (append text to a comment on line 1) but do not save

// Add a breakpoint on line 2
[10:52:58] [DAP] [Info] ==> {"command":"setBreakpoints","arguments":{"source":{"name":"main.dart","path":"/.../main.dart"},"lines":[1,2],"breakpoints":[{"line":1},{"line":2}],"sourceModified":false},"type":"request","seq":11}

// Save file

// Add a breakpoint on line 3
[10:53:09] [DAP] [Info] ==> {"command":"setBreakpoints","arguments":{"source":{"name":"main.dart","path":"/.../main.dart"},"lines":[1,2,3],"breakpoints":[{"line":1},{"line":2},{"line":3}],"sourceModified":false},"type":"request","seq":15}

I'm also a little sure about the intended use of sourceModified. What I was hoping would happen is that VS Code would set sourceModified: true any time it sends breakpoints but the source file is dirty (if it chooses to send them). This means a DA could choose to completely ignore setBreakpoint requests when this flag is true to avoid setting breakpoints in invalid locations. However, for this to work, it would also require the client to send a setBreakpoints (with sourceModified: false) after any save, if breakpoints had been modified.

With the current behaviour logged above, sourceModified is never set. I've filed https://github.com/microsoft/vscode/issues/175872 about this, but without the spec being very explicit about how this should work, it's hard to describe exactly what the expected behaviour is (is the flag wrong, or should VS Code not have called setBreakpoints until the file was saved?).

Lenguaje dominante
HTML
Estrellas
1.8k
Forks
173
Merge medio
7 d 7 h
PR fusionados (30 d)
2

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/debug-adapter-protocol

Todos los issues de microsoft/debug-adapter-protocol

Issues similares

Más issues de Documentation

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.