BridgeJS: Improve diagnostics and fix-its for macros by kateinoigakukun · Pull Request #597 · swiftwasm/JavaScriptKit
Examples added/covered in this change:
- @JSFunction: enforce throws(JSException) (missing or wrong type) with note + fix-it ("Declare throws(JSException)").
- @JSFunction: instance members outside @jsclass emit a clear diagnostic.
- @JSGetter/@JSSetter: members (instance/static/class) outside @jsclass emit a clear diagnostic.
- @JSSetter: invalid setter names (e.g. updateFoo) emit a diagnostic and suggest a rename fix-it (e.g. setFoo).
- @JSSetter: missing value parameter emits a diagnostic and suggests adding a placeholder parameter.
- @jsclass: using @jsclass on non-struct declarations emits a diagnostic; for "class" also suggests "Change 'class' to 'struct'".
approved these changes
krodak
deleted the
katei/b443-bridgejs-macros
branch
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