| Summary: | Need ability to exclude specific JavaScript files from validation | ||
|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Alex Pogrebnyak <alex-pub.eclipse> |
| Component: | General | Assignee: | Project Inbox <jsdt.javascript-inbox> |
| Status: | RESOLVED INVALID | QA Contact: | Nitin Dahyabhai <thatnitind> |
| Severity: | normal | ||
| Priority: | P3 | CC: | adib, cmjaun, mauromol, vladnc |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Alex Pogrebnyak
Standalone files are validated through our own builder; it's not related to the Validation Framework. Putting those files into a separate Library Folder on the Include Path may help, or just using the already-existing Exclusion Patterns available on Source Folders to keep them out of the JavaScript model altogether. (In reply to comment #1) Thanks Nitin, Include Path is the functionality that I was looking for. However, based on many forum questions this feature is not in the most intuitive place. Many people give the advice of turning off semantic validation all together or, much worse, even disabling JavaScript Validator builder. I think somebody should add a paragraph ( or link to Include Path ) on 'JavaScript->Validation' property page that explains how to exclude individual files from validation. I have a similar problem, in my case I am not able to disable JavaScript validation at all. I tried anything I could think of. Disable it at project level. Disable it globally. Suspend all validators at project level, suspend them globally, add the directory with the problem files to an Exclude group for the JavaScript validator, cleaning the project, rebuilding the project, closing / reopening the project, disabling JavaScript semantic validation. Nothing works. Setting the directory as derived seemed reduced the number of errors and warnings, but thousands still remain. Using Indigo Service Release 1, m2e 1.0.100, Subversive 2.2.2 on Windows 8 Developer Preview. (In reply to comment #3) Vladimir, if you need to exclude all JavaScript files, just add '**/*' to the `Exclusion patterns` Just to clarify, I am talking about Project Properties -> JavaScript -> Include Path -> Source Tab I've documented detailed steps here -> http://stackoverflow.com/a/7931839/185722 As I've told in my previous comment, it's not clear at all where to find this functionality. Some link to here with explanation is needed through either QuickFix or Validation page. Once you know the trick, it all makes sense. Thanks Alex, that fixed my issue. Previously I lost four hours trying to fix it. *** Bug 368900 has been marked as a duplicate of this bug. *** Is there a bug here yet? Why is it in the "reopened" state? (In reply to comment #7) > Is there a bug here yet? Why is it in the "reopened" state? Maybe not a bug per se, but definitely a usability problem, so that users who encounter JavaScript validation warnings for the first time do not know that they can control this behavior through JavaScript->Include Path setting. I think the right solution would be to add action to fix Include Path in Quick Fix view. (In reply to comment #8) > I think the right solution would be to add action to fix Include Path in Quick > Fix view. I agree with this. However maybe the summary should be updated accordingly then? What the JSDT devs plan to do here? (In reply to comment #9) > I agree with this. However maybe the summary should be updated accordingly > then? I agree, but I think somebody on JSDT dev team should update the summary. (In reply to comment #8) > (In reply to comment #7) > > Is there a bug here yet? Why is it in the "reopened" state? > > Maybe not a bug per se, but definitely a usability problem, so that users who > encounter JavaScript validation warnings for the first time do not know that > they can control this behavior through JavaScript->Include Path setting. > > I think the right solution would be to add action to fix Include Path in Quick > Fix view. JavaScript-> include Path does not work with dojo, I tried to put Dojo into my dynamic web project and use the JavaScript-->Include Path it did not work. I had to create a dojo dynamic web project and tun off JavaScript completely from that project to get dojo into workspace without having to get errors and warnings. (In reply to comment #8) > I think the right solution would be to add action to fix Include Path in Quick > Fix view. Fix it in what way? (In reply to comment #11) > JavaScript-> include Path does not work with dojo, I tried to put Dojo into my > dynamic web project and use the JavaScript-->Include Path it did not work. I > had to create a dojo dynamic web project and tun off JavaScript completely from > that project to get dojo into workspace without having to get errors and > warnings. I'm not sure what "does not work", but you can also try placing Dojo itself into a Library folder, instead of a Source folder and then ignoring parts of it. (In reply to comment #12) > (In reply to comment #8) > > I think the right solution would be to add action to fix Include Path in Quick > > Fix view. > > Fix it in what way? When you see errors on a JS file in the Problems view or a warning you should be able to use the CTRL+1 shortcut to quick fix the problem by adding the file to the list of files that should be ignored by the validator. > (In reply to comment #11) > > JavaScript-> include Path does not work with dojo, I tried to put Dojo into my > > dynamic web project and use the JavaScript-->Include Path it did not work. I > > had to create a dojo dynamic web project and tun off JavaScript completely from > > that project to get dojo into workspace without having to get errors and > > warnings. > > I'm not sure what "does not work", but you can also try placing Dojo itself > into a Library folder, instead of a Source folder and then ignoring parts of > it. "What does not work" is that there is no way to have dojo in the WebContent/ folder of a Dynamic Java Project without having errors and warnings from the JavaScript compiler and validators. On my team we have a policy that projects should have zero warnings and zero errors and it is very frustrating to have third party code from a high quality project like Dojo which does not validate and has warnings when I include it in my project. Dojo has to be in a Dynamic Web Project otherwise you can not serve it out to the browser. My understanding is that adding dojo as JavaScript library means things like content assist work better, but how does adding it as a library help get the files to the browser via tomcat or some other app server? (In reply to comment #13) > Dojo has to be in a Dynamic Web Project otherwise you can not serve it out to > the browser. My understanding is that adding dojo as JavaScript library means > things like content assist work better, but how does adding it as a library > help get the files to the browser via tomcat or some other app server? Set that folder as an exclusion on the existing Source Folder and you can then add it as a Library. Nitin's comments have addressed this issue. The ability to exclude files already exists. |