-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat(debugger): Update filewatch to look for .map and .js and send /reload to MC #248
Conversation
fe1785c
to
b1caeb3
Compare
src/Session.ts
Outdated
this._sourceMaps.reset(); | ||
}); | ||
|
||
const minReloadDelay = 500; |
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.
It feels weird to me to data drive this but to also have a minimum.
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.
Ok, I'll remove it.
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.
note: We should probably make sure it's not negative :D
@@ -22,6 +22,10 @@ const onShowDiagnosticsPanel = () => { | |||
vscode.postMessage({ type: 'show-diagnostics' }); | |||
}; | |||
|
|||
const onShowSettings = () => { | |||
vscode.postMessage({ type: 'show-settings' }); |
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.
One of these days we should look up how to make these events more type-safe/shared strings.
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.
Only real way is if we publish a package that specifies these, and we generate them from some metadata we spit out from the game. IMO, not worth the effort.
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.
If we converted this to a workspace we could use a shared (unpublished) package right?
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.
oh, I think I misunderstood initially a goal to share with the debugger protocol, but this is between the extension and the webview-ui. Yes you are correct, we can solve it with an intermediate package that way.
const debounce = (func: () => void, wait: number): (() => void) => { | ||
let timeout: NodeJS.Timeout; | ||
return () => { | ||
clearTimeout(timeout); | ||
timeout = setTimeout(func, wait); | ||
}; | ||
}; |
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.
super nit: extra to helper function?
Co-authored-by: Raphael Landaverde <[email protected]>
Co-authored-by: Raphael Landaverde <[email protected]>
Similar to this PR here but leans into VSCode settings for added flexibility. By using VSCode settings, users can choose to save settings globally or per workspace and it also gives us a place for documentation.
Thanks for the general glob pattern idea Dingsel. Will this solve your use cases?
localRoot
is defined (nosourceMapRoot
), the file watch pattern is *.js files fromlocalRoot
sourceMapRoot
is defined, the file watch pattern is for *.js and *.map fromsourceMapRoot
globPattern
is specified, the root is the workspace.Added a button to the home panel to open Settings UI directly to the debugger page.
Addresses issue #130