Clarify usage of sourceModified flag
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 20/100
- Issue 类型
- 文档
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- vscode
调研方向
首先查看此 issue 中引用的 sourceModified 定义,以及链接的 VS Code 讨论和 issue。将文档所述行为与 request logs 进行比较,然后明确保存后的预期语义和客户端行为;当规范解决究竟是 flag 还是 request 时序不正确时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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
setBreakpointsrequest with the attributesourceModifiedset to false is issued immediately.- source is dirty, all breakpoint modifications are tracked but no
setBreakpointsrequests are issued until the next save of the source. In the meantime breakpoints are shown as unverified. After the save a singlesetBreakpointrequest with the attributesourceModifiedset to true is issued.In both cases the result status returned from the
setBreakpointsrequest 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?).
- 主要语言
- HTML
- 星标
- 1.8k
- 派生
- 173
- 平均合并
- 7 天 7 小时
- 30 天内合并 PR
- 2
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/debug-adapter-protocol 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 5/5 一周以上 新手友好度 35/100
microsoft/debug-adapter-protocol#633 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 42/100
-
难度 5/5 一周以上 新手友好度 35/100
microsoft/debug-adapter-protocol#599 · 8 个 reaction ·
-
under-discussion
难度 2/5 1-3 小时 新手友好度 48/100
microsoft/debug-adapter-protocol#596 · 9 条评论 ·
查看 microsoft/debug-adapter-protocol 的全部 Issue
相似的 Issue
-
app documentation remote windows-os
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
librepods-org/librepods#802 ·
维护者通常 1 天内回复
-
area:lint-tooling found-by:critic kind:docs-drift
难度 2/5 1-3 小时 新手友好度 76/100
InauguralSystems/EigenScript#1335 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 94/100
维护者通常 1 天内回复
-
technical-improvement
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 4 天内回复