How to find out which Eclipse Validator caused a warning? - eclipse

The Eclipse project I just imported has a lot of warnings (and even errors) and I want to find out from which validation component they are. Short of clicking through all the warnings and errors, is there a way to get quickly from the warning to the preferences so I can change them?
Here is an example. It just says "Validation Message". How can I find the location in the preferences to disable this and make it a warning instead?
Clarification: I am looking for a general solution not this one in particular. I want to be able to configure the warning level of each issue as I work through the issues. Not by clicking through preferences until I hit the right preference.

For example for Java problems, there are Configure problem serverity Quick Fixes (Ctrl+1) for that.
Unfortunately, in your case, there are no Quick Fixes at all, as you can see from the missing light bulb. Also, the type "Validation Message" is too general to be helpful here. Here only the error message and the type/extension of the file containing the error give hints where the validator can be deactivated.
Please report this as a feature request to Eclipse if it hasn't been done yet.

Related

Find origin of language warnings and errors in VSCode

Visual Studio Code will sometimes give you warnings or errors for your code, usually indicated by:
as "Problems" in the respective pane (the "Focus on Problems View")
yellow or red squiggly lines under the offending code
in tooltips when hovering the offending code
inline when you click "View Problem" or use ALT+F8
None of these UI features seem to tell me: how to find the origin of such warnings and errors? Which extension or rule or linter or built-in feature is responsible for that specific problem?
Often the warnings and errors make sense, or you can deduce what must be the originator. But sometimes this is not so obvious, and to find the right documentation for said error (to get more information on the reason, rationale, potential fixes, etc.) I'd need to know what caused the warning or error.
For example the "Unkown rule" error from my screenshot presumably comes from stylelint since they have a specific rule around that. I want to know how I can find this out from within VSCode?
My current workarounds include "fiddling around until the error disappears", and "Googling error messages to inevitably find a Stack Overflow post that explains things", but I want to understand what's going on, and what the root of the errors is.

Turning off Eclipse's guidance

So basically I want to drive myself crazy while disciplining myself learning to program. I want to kick it old school and really understand what I'm doing. I don't want Eclipse to hold my hand and tell me that I have a syntax error or that I have any errors except for when I run my code and the console tells me something is wrong. I have searched and searched and searched online and I cannot find where you disable anything. I've been to the editor/compiler preferences and changed everything to ignore instead of warning, but eclipse is still holding my hand.
I'm using Eclipse Luna for Java. Any suggestions or help at all would be greatly appreciated!!!
The closest I think you'll get is to disable the automatic, incremental compilation (menu Project > Build Automatically). But that doesn't disable the Java editor's natural tendency to highlight obvious syntactical errors as you type.
To be honest, if you really want to avoid all of the guidance that an IDE like Eclipse gives you, you'd probably be better off using a "plain" text editor (possibly with simple syntax coloring), such as TextPad or Notepad++, along with command-line javac. But I don't think that will actually help you learn better; it certainly doesn't help with the exploratory/discovery part of learning.

Exclude ReSharper error for "Resource not found" inside Views

I have an MVC2 application and use ReSharper 6.1 - I've heavily customised the Code Inspection Severity and edited what it decides to show as errors, warnings, suggestions and hints, but I cannot seem to stop it from telling me that a specific resource is missing when utilising a HTMLHelper.
So, for instance:
<img src="<%:Url.Content("~/Resources/Image12345.jpg")%>" />
I get an error on every line similar to the above telling me that the path above does not exist - which at design time it does not, but during the build process all of these views are XCOPY'd to a location which contains all of the resources, such as the images, so at the point of running the application all of this path resolution is correct. Because of working in a team of people, some of which are new to ReSharper, I wanted to exclude this error from appearing as it may cause colleagues of mine to start fiddling with something that isn't broken.
ReSharper obviously doesn't know that this isn't an issue and it has no way of knowing which is why I want to turn off this specific bit of analysis. I've found on the whole that ReSharper is massively customizable and in version 6.1 under Inspection Severity there are some new MVC options, which have proved useful - but I can see no way of turning off the inspection for this.
Anybody have any ideas?
There are few options, press ALT+ENTER.
Suppress inspection "Path Error" with comment. You can suppress whole block of code, not only each of tag.
Suppress inspection "Path Error" at all at whole project.
There is new feature of 6.1 - path mapping, but it seems broken in conjunction with MVC.
Set to ignore that specific error by:
Open Soultion Errors Window by ReSharper->Windows->Soultion Errors Window.
Right-click annoying error and select Ignore Error.
See answer for another error for more explanation.
Well - It seems that this particular type of inspection is not currently catered for. I'll see if I can request it with JetBrains and hopefully more granular MVC inspection will be included in the future.
Cheers guys

Method listings when typing '.' after an object

Normally when you put the '.' after an object and wait you get a list of methods/fields/classes that one can access. My eclipse no longer does this for me. I spent 10-15 minutes searching for a way to turn it back on and I came up empty. How can I turn this back on?
You can try mucking around in
Preferences > Java > Editor > Content Assist
and see what you get. I've had this once before; eclipse got into a bad state and wouldn't code complete for a given project. Reverting changes in the project got rid of some errors and it started working again.
Assuming you're using Java you need to look at setting Java -> Editor -> Content Assist. You want to make sure that "Enable auto activation" is checked and the other options are set to your taste. The auto activation trigger should be the period.
It may not work if you have an error in your code.

JavaScript validator throws NullPointerException in Eclipse

I'm coding some PHP files on Eclipse IDE, and I keep getting an error that says "Building Workspace has encountered a problem" -- Workspace is the name of my project area.
When I click on the "details" link I get this
Errors occurred during the build.
Errors running builder 'JavaScript Validator' on project 'Ullman'.
java.lang.NullPointerException
As mentioned, I'm working in PHP so I don't know why it's trying to set up JavaScript Validator. I can't figure out how to stop it from doing these things. Anyone know?
I'm not experienced, so please provide a detailed answer if you can.
I just ran into this problem myself and the previous accepted answer was not helpful. The problem is not the validator, it is the build. To fix go to Project -> Properties -> Builders, then disable ‘JavaScript Validator’. Since you are working with PHP your build is getting confused when you try and validate a PHP file with a JavaScript validator.
The error message doesn't really do anything it just gets annoying really fast.
http://blindcoder.wordpress.com/2011/03/04/javascript-validator-problem-in-eclipse/
Project->Properties->Builders then disable 'Javascript Validator
http://blindcoder.wordpress.com/2011/03/04/javascript-validator-problem-in-eclipse/
UPDATE: Cleanshooter's answer is the better one for PHP-specific projects. I'm leaving this answer since it is useful for people who run across the error on JavaScript files because of crashes in the JavaScript parser.
You can disable part of the JavaScript validator with Eclipse -> Preferences -> JavaScript -> Validator -> Errors/Warnings and unchecking Enable JavaScript semantic validation
I am using the Spring Source Tool Suit IDE and i have fixed this issue by following the below steps :
select the Project and choose the properties option.
Select JavaScript > Include Path option and then choose the Source tab.
Click on Edit button and Click Add button.
Now enter the value for Inclusion Pattern as *.js then click on Ok button and Finish.
I have solved my problem in this way. Please let me know if any one have any other way to solve this problem.
Just go to Project -> Build Automatically and disable this option.. you won't need it anyway with PHP.. because there is nothing to be build.. but this solves the NPE thrown at each save or f5 action
For those of you who are having trouble with 'dynamic web projects', you may find that none of the other answers work.
I tried all the options stated here and found that disabling the 'Faceted Project Validation Builder' solved the problem..
right click project --> Builders --> uncheck the 'Faceted Project Validation Builder'
I ran into the same problem and the above suggestions would not resolved it completely unless until I came across to this post # How do I remove javascript validation from my eclipse project?
But even then after doing all (as given the other post url), had to manually removed the "Problems" tab statements like 'Errors' and 'warning' then only it goes away completely at least in Eclipse Juno.
Hope it helps someone.
This is a problem that has happened to me on some Web Dynamic projects. Every time the project is built, I get this error:
Errors occurred during the build.
Errors running builder ‘JavaScript Validator’ on project ‘some-project’.
java.lang.NullPointerException
At a first sight it seems that a Javascript validator is throwing a NullPointerException, so probably you will try to disable Client-side Javascript validation from Project->Properties->Validation… but I tell you that the problem is not there, you must go to
Project->Properties->Builders
then disable Javascript Validator.
Problem solved.
Project->Properties->Builders then disable 'Javascript Validator,
this fixed my problem:
Errors occurred during the build.
Errors running builder 'JavaScript Validator' on project 'xxx'.
29
This is a problem that has happened to me on some Web Dynamic projects. Every time the project is built, I get this error:
“Errors occurred during the build. Errors running builder ‘JavaScript
Validator’ on project ‘some-project’. java.lang.NullPointerException”
At a first sight it seems that a Javascript validator is throwing a NullPointerException, so probably you will try to disable ‘Client-side Javascript’ validation from Project->Properties->Validation… but I tell you that the problem is not there,
you must go to Project->Properties->Builders then disable ‘Javascript
Validator’.
Problem solved. Indeed is not a real problem, but the message is a bit annoying because it happens in every build
in my case, right clicking on project -> "Project->Properties->Builders then disable 'Validation" worked for me.
I had the same error. It happened after adding the D3 js libraries.
My solution to get rid of it:
-I moved the libraries to a server and the html page gets them from there.
-Removed the libraries from the project as they weren't needed there.
Problem solved for me.
Recommandation:
- remove the latest added libraries from your project and see if the error message disappears.
- get the libraries dynamically (in the html) from a server but do not have them in your project.
It doesn't solve the root of the problem but it does help to get rid of immediate frustrations.
Good luck.
Disabling ‘Javascript Validator’ is not the ideal solution. It is just hiding the problem.
What worked for me is this:
Switch to a new or a different workspace from File >Switch Workspace
and then import your existing project into this new workspace.
Problem solved.