How do I resolve JetBrains WebStorm 'Unresolved variable webServ' warning? - node.js

I'm utilizing WebStorm IDE for node.js development and I'm trying to cleanup all the WebStorm warnings and errors.
The remaining error is a 'Unresolved variable webServ' warning, but the use of the req.params.webServ is correct.
I don't want to just remove the WebStorm 'Unresolved variable...' warning.
How do I resolve this WebStorm IDE warning?

As webServ is not defined anywhere in your code (except for root path string passed to delete()), it can't be resolved using static code analysis. You can suppress such warnings for statement using comments (hit Alt+Enter, then hit Right, choose Suppress for statement).
See also https://youtrack.jetbrains.com/issue/WEB-17419#comment=27-1058451, https://intellij-support.jetbrains.com/hc/en-us/community/posts/206349469-disable-unresolved-variable-on-json-object-received-by-ajax-call for other possible workarounds

Related

Only partial syntax highlighting in Kotlin script file

I opened a folder in Android Studio which contains a Kotlin script file (.kts). I configured a JDK as SDK in Project Structure (but I added no gradle files), and running the file as Kotlin script works fine. However the syntax highlighting is only PARTIALLY working, see below example (Linux Mint 19.3 and AS 4.1.3):
Some of the stuff missing:
unused variable should be gray (val unused)
to/forEach keyword should be yellow and italic
misspelled variable names should be red
bad style such as extra spaces should be underlined
etc.
What's even going on here? Is this some sort of "fallback" mode?
Any way to use the "full" syntax highlighting from normal Android projects, so I can spot mistakes earlier?
For reference, this is what it "should" look like (pasted into a random Android project):
Renaming the file to end in *.main.kts (scriptname.main.kts) enabled full highlighting for me!
I get this type of issues from time to time with IntelliJ IDEA. I haven't found the reason why it happens, neither do I know the 100% working solution. But here are the options that usually help me solve it:
Restart IDE
Invalidating caches: File > Invalidate Caches...
Re-import the project. Remove the .idea folder and the project.iml file and try to import the project again.
Update the IDE. Last time I had this issue, nothing helped but updating IDEA to 2021.1.
I hope some of these options will help.

PyCharm IDE doesn't highlight undeclared variables

I am using pyCharm 2018.1 community edition, is there a way for pyCharm to detect when I accidentally used a variable that does not exist ? I get other inspection highlighting but just not unresolved reference and it is really annoying when I find these small mistakes during compile time.
for example
print(doesnotexist) will not be highlighted in pycharm
I have enabled inspections and left defaults as is.
is this normal ?
Check your .idea folder and see if the inspection folder has been recently changed. I had to delete and let Pycharm recreate my profile.

Require function is marked as error in Brackets ide

The native function require of NodeJS is marked as error in Brackets IDE. I don't know what I have to do to change that. Thanks.

Have you used JustCode?

Has anyone used JustCode from Telerik lately? This question has been asked about two years ago, but I'm sure the issues must have been resolved by now. Especially referring to running it side by side with ReSharper.
I have been using Resharper for a while now. I decided to try JustCode to see how it behave.
After a week of using JustCode, I am uninstalling it and returning to Resharper.
What I like about JustCode:
A single window indicating all warnings/errors in entire solution.
Performance seemed to be a bit better than Resharper.
Refactoring is easier to get to.
Projects can be excluded, or type of file
Language can be excluded (such as XAML)
What I did not like about JustCode:
Sometimes the underline used to open the option for fixing or refactoring is frustratingly hard to click since VS also puts an underline at the same spot (and it is the context menu of the latter that pops up).
Cannot change an hint to be a warning instead.
Saw some minor bugs
JustCode was giving hundreds of false positive warnings in the XAML code (luckily I could turn the inspection of XAML off)
What I was missing from Resharper:
Warnings about method parameter missing/mismatch from the documentation
Hints to transform an expression into a Linq expression.
When writing an opening bracket, resharper automatically adds the closing one and puts you on an empty line in between the two.
When completing a method, Resharper adds the first parentheses. It also adds the last one if that method is parameterless.
I am sure there is a bunch of other stuff that I can't remember now
You can install both Resharper and JustCode alongside. I first suspended Resharper before installing JustCode and used JustCode fine. When I resumed Resharper and restarted VS, both were running together without error.
Together, Resharper was finding more than JustCode.
For example, JustCode did not give a warning for the following: "Value assigned is not used in any execution path."
It even missed an error: "Cannot convert type 'int' to 'bool'." The expression was:
if ((bool)CanDoIt) // Here CanDoIt is a property of type int.
{
...
}
All in all, the tool is not bad. I recommend it over not having any. But if you have the choice between Resharper and JustCode, go with Resharper... for the moment; JustCode is still young.
You can change the size of JustCode's smart tag or turn off Visual Studio's smart tag in JustCode's options menu. I prefer to access VS's smart tag by using ctrl+., so it hasn't been an issue for me.

Is there a way I can get Intellij to underline Groovy errors?

With some groovy errors, Intellij reports the errors in the messages window, but doesn't underline the code in red in the editor. Is there a way to get it to do this?
Example:
static boolean example(){ x = 5 }
With that code, when I try to compile the messages window gives an error Apparent variable 'x' was found in a static scope but doesn't refer to a local variable, static field or class.
Is it possible for IntelliJ to also underline the error in the editor (and maybe the project window to show what file the error is in too)?
While IDEA on-the-fly code analyzer can detect 99% errors in the Java code without even running a compiler, it's much harder to do for dynamic languages like Groovy. So, you have to actually build your project in order to see all the compilation errors (use Build | Make).
Analyzer may be improved and will start to detect more errors in the future updates.
I use customize highlight level to suppress some warnings on my android layout files.
P.S I love Intellij for android development :)

Resources