Disable "Invalid type syntax" inspection, and generally - determining the inspection that caused an error

I'm developing a Google Sheets add-on written in Google Apps Script. For custom functions, Sheets echoes to the user the comment above the function, and I want to echo a string that's helpful to the user, but isn't valid JSDoc:

 

WebStorm correctly highlights that as an error, and finds an “Invalid type syntax” problem.

1. How can I disable this particular inspection for that comment block (disabling it for the next line would cause the `// noinspection` disabling comment to show up in Google Sheets)?

2. More generally, how can the name of an inspection in the Settings UI be determined from the inspection itself? If I right click on “Invalid type syntax”, I don't see a way to navigate to the inspection.

3. How can the // noinspection comment (e.g. “// noinspection JSUnusedGlobalSymbols”) be determined from the inspection in the Settings UI?

0
3 comments

1. Available options are Disable inspection, Suppress for file and Suppress for statement. These options can be accesses by right-clicking the error in the Problems tool window, Show quick fixes, >:

2.  Edit inspection profile setting above can be used to jump directly to the inspection in Settings.

3. You don't need adding these comments manually, the IDE can generate them for you. All you need is choosing the appropriate suppress action from the context actions (Alt+Enter). Please refer to https://www.jetbrains.com/help/phpstorm/disabling-and-enabling-inspections.html#suppress-in-editor for more info.
 

 

0

Thank you Elena Pogorelova. I don't see these options in Problems → Code Analysis (apologies for the poor quality screenshot, had to resort to analog methods).

 

I was also looking for these options in the context menu for the warning tooltip. Maybe it would help to add them there?

WebStorm 2024.2.1
Build #WS-242.21829.43, built on August 19, 2024
Runtime version: 21.0.3+13-b509.11 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.X11.XToolkit
Linux 6.8.9-100.fc38.x86_64
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 20
Registry:
 ide.experimental.ui=true
 i18n.locale=
Non-Bundled Plugins:
 com.github.continuedev.continueintellijextension (0.0.62)
 com.github.copilot (1.5.20.6554)
 mdx.js (242.20224.159)
Current Desktop: KDE
 

0

In looks different in my environment (WS-242.21829.149, built on August 29, 2024). In the Inspections tab of the Problems tool window (that opens when I choose Inspect code from the file right-click menu) all the suppress options are available in the context menu:

In the File tab, I have to choose Show quick fixes to access the options:

 

and in the editor all options are available on Alt+Enter (or via Show Context Actions menu):

Can you see all these options when working with plain JS instead of GS?

0

Please sign in to leave a comment.