Clarify usage of sourceModified flag
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 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時間
- マージ済み PR(30日)
- 2
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/debug-adapter-protocol のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoft/debug-adapter-protocol#633 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoft/debug-adapter-protocol#599 · リアクション 8 件 ·
-
under-discussion
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
microsoft/debug-adapter-protocol#596 · コメント 9 件 ·
microsoft/debug-adapter-protocol の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
メンテナーはふだん 1 日以内に返信
-
issue-doc-idea needs-triage
難易度 2/5 1〜2日 初心者へのやさしさ 86/100
MicrosoftDocs/PowerShell-Docs#13306 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
coder/coder#29955 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
documentation good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信