Shows a visual indicator when a function has the `throw` keyword inside of it. This extension cannot determine whether a function might throw any error, it'll only tell you whether a function might throw a **manual** error.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
imightthrow is a VSCode extension for TypeScript/JavaScript that shows a configurable decorator next to functions that might throw-- or more specifically, functions that contain the throw keyword. All this does is fix a really specific problem I had.
This extension contributes the following settings:
imightthrow.enable: Enable/disable this extension.
imightthrow.decoration: Set the decoration to any string of your choosing.
imightthrow.highlightColor: Set the color of the decoration.
imightthrow.showOnCalls: Whether to show the decoration on function calls (default: true).
imightthrow.showOnDeclarations: Whether to show the decoration on function declarations (default: false).
Known Issues
Doesn't parse declaration files (.d.ts) at the moment, so this plugin doesn't work for functions from external libraries (e.g., those defined in node_modules). Maybe I'll add an optional symbol for whether it is unknown that a function might throw.