-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[vscode-lldb] Restart server when the lldb-dap binary's modification time has changed #159481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
royitaqi
wants to merge
2
commits into
llvm:main
from
royitaqi:lldb-dap-restart-server-when-modified
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use the builtin method for this:
vscode.workspace.createFileSystemWatcher
that will be more reliable
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(The following is probably more for my learning.)
I did a Google search and it said this:
It seems it's because the underlying
fs.watch
is "not always reliable".--
FWIW, I have a local implementation using the
createFileSystemWatcher
but somehow it's not triggering when Itouch
the lldb-dap binary. Still trying to figure out why.The code is very simple:
The callback is never executed when I do
touch <absoluteDapPath>
.It seems there is a bunch of reasons where
createFileSystemWatcher
might not work.--
What reliability issue did you have in mind about the "modification time" approach?
I might have been naive and missed something important. Currently, it appears to me that checking the file modification time is better in terms of simplicity (only depend on the FS supporting modification time), debuggability (user can verify the modification time), and consistency (as long as the modification time changed, it should be detected).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I used
createFileSystemWatcher
for a few extensions that are being shipped in the marketplace already and never got a complaint.Can you share with me the correct link for
a bunch of reasons
and"not always reliable".
? The links seem to take me to google and not actual pages where you got the info you mentionAlso, could you share the snippet of your own local copy of
createFileSystemWatcher
?What I believed so far is that
createFileSystemWatcher
is used internally by vscode to identify when files change, and because it's a crucial feature of the IDE, I assumed it was thoroughly tested in all platforms.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wrong. What my extensions were using is https://www.npmjs.com/package/chokidar
Try using that one