-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: Warn if a hook function forgets return when it is of pipe mode #9519
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
base: master
Are you sure you want to change the base?
Conversation
|
Confirmed: linonetwo has already signed the Contributor License Agreement (see contributing.md) |
📊 Build Size Comparison:
|
| Branch | Size |
|---|---|
| Base (master) | 2451.4 KB |
| PR | 2451.8 KB |
Diff: ⬆️ Increase: +0.4 KB
⚠️ Change Note Status
This PR appears to contain code changes but doesn't include a change note.
Please add a change note by creating a .tid file in editions/tw5.com/tiddlers/releasenotes/<version>/
📚 Documentation: Release Notes and Changes
💡 Note: If this is a documentation-only change, you can ignore this message.
✅ Deploy Preview for tiddlywiki-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@linonetwo ... Can you provide a screenshot of the dev console warning, that will be created with your PR? |
|
I think warning like this could reduce debug time, but I'm not sure console.warn like this is good enough. I can't get the plugin name here. If I'm gonna write a plugin/MOD based game, I will require adding plugin-name metadata when registering anything, so I can log them.
Might be an add-on to #6345 |
|
(new screenshots) Seems I can click on But I still think, instead of const diagnostic = new vscode.Diagnostic(
range,
'This is an error message from my extension',
vscode.DiagnosticSeverity.Error // Or Warning, Information, Hint
);
const diagnostics: vscode.Diagnostic[] = [];
diagnostics.push(diagnostic);
const uri = vscode.window.activeTextEditor.document.uri; // file URI, or our tiddler title if we want it
const diagnosticCollection = vscode.languages.createDiagnosticCollection('myExtension');
diagnosticCollection.set(uri, diagnostics);This will allow user to debug plugin problem inside wiki, without using devtool console. While we still need other mechanism to get plugin-name in this case. plugin-name is only view from source code comment in devtool. |
|
Hi @linonetwo this is a good idea, and reasonable to merge given that the modest size of the code. |




Plugin author could forget to return value when calling hook. I'd like to discuss if it is necessary to warn them (in this case, it is me, my streams-outliner-lib plugin (based on @saqimtiaz's streams) forget to return the value).
Otherwise it will cause error on other authors' plugin (in this case, error is from my external-attachment-plugin)
https://github.com/saqimtiaz/streams/blob/main/plugins/streams/delete-hook/hook.js