Bug 245495 - [UI] [validation] An error isn't indicated in the problem view even if there is an error in JavaScript in the HTML file on Web Page Editor.
Summary: [UI] [validation] An error isn't indicated in the problem view even if there ...
Status: RESOLVED WORKSFORME
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: Future   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2008-08-28 03:43 EDT by Hajime Katayama CLA
Modified: 2010-06-28 13:09 EDT (History)
4 users (show)

See Also:


Attachments
patch (789 bytes, patch)
2009-11-24 05:11 EST, Jacek Pospychala CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hajime Katayama CLA 2008-08-28 03:43:45 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. An HTML file is opened on the Web page editor.
2. JavaScript is described.
<script> - </script>
3. A defect is described with JavaScript. (The variable of the undefined is described.)

Though an error marker is set up, nothing is indicated in the problem view. 


More information:
Comment 1 Nitin Dahyabhai CLA 2008-11-11 14:18:20 EST
On the Validation preference page (or the Validation property page for your project, if project specific settings are enabled), is "JavaScript Syntax Validation" enabled?
Comment 2 Hajime Katayama CLA 2008-11-13 02:38:32 EST
> On the Validation preference page (or the Validation property page for your
> project, if project specific settings are enabled), is "JavaScript Syntax
> Validation" enabled?
Yes.

The marker of the error of Javascript/HTML comes out at the side of the Web Page editor.
But, it isn't indicated in the problem view.
Comment 3 Nitin Dahyabhai CLA 2009-05-11 11:17:38 EDT
And you had automatic builds enabled?  The Problems view would not be updated until the file was both saved and Validation run, either manually or as part of the Build.
Comment 4 Chris Jaun CLA 2009-09-15 10:56:48 EDT
Categorizing JSDT bugzillas for planning purposes.
Comment 5 Jacek Pospychala CLA 2009-11-23 10:30:37 EST
I'm not able to reproduce this kindof. 
I'm never getting any JavaScript errors for javascript code inside HTML, however validation works fine for .js files.
JavaScript Syntax Validator preference is enabled.

This happens with JSDT plugins from R3_1_maintenance branch. Maybe I'm missing some plug-in that does this job? Which one is responsible for that?
Comment 6 Jacek Pospychala CLA 2009-11-24 05:06:19 EST
Ok, now I'm getting validation errors. To enable javascript validation you have to:
1. Enable "JavaScript Syntax Validation" in Window->Preferences on Validation page
2. Enable "JavaScript semantic validation" in Window->Preferences on Web >JavaScript > Validator > Errors/Warnings page

I can reproduce the bug as well.
Markers don't appear in Problems view (as well as in Project Explorer) for files with ".js" extension, however file is validated and problems are visible in editor via red/yellow squiggles and icons on the editor's ruler.

If I add ".js" extension to "JavaScript Syntax Validation" validator (on Window->Preferences, Validation page), then markers are visible in Problems view and Project Explorer view.
Comment 7 Jacek Pospychala CLA 2009-11-24 05:11:52 EST
Created attachment 152930 [details]
patch

An obvious patch is to add ".js" to list of files extensions supported by jsValidator.

If js is intentionally not on the list, please comment what is intended workflow so I'll be able to write a better patch :-)
Comment 8 Chris Jaun CLA 2009-11-24 10:28:00 EST
I thought the problem described by this bug is that problems in html or jsp pages were not showing up in problems view, but that things in .js files are.

Are you seeing different behavior Jacek?

My understanding is that the jsValidator is only for web pages.
Comment 9 Jacek Pospychala CLA 2009-11-25 10:43:01 EST
Ok, I'm getting closer.
if you enable JavaScript semantic validation (on Web >JavaScript > Validator > Errors/Warnings preference page), then both JavaScript editor and HTML editor will be decorating javaScript code with all problems. But:
- no markers are added. So there's no Problems in problems view and no decorations in Script Explorer for any files (for HTML but for .js AS WELL)
- in HTML editor, icons on left ruler are missing (original reporter had this different)

Now if I enable JavaScript Syntax Validator, then:
- markers are added. Problems view and Script Explorer shows problems (e.g. for html and js files)
- in HTML editor, icons on left ruler are back

I still see that JavaScript files (.js) sometimes have and sometimes miss the problem markers - no problems in problems view or decorations in ScriptExplorer. But this seems to be more related to where is my file located, e.g. under JavaScript source folder, or in regular folder. Not sure yet.

So I suppose, the fix for this problem is to enable "JavaScript Syntax Validator" in Window->Preferences on Validation
page.
Comment 10 Jacek Pospychala CLA 2009-11-25 10:44:51 EST
Hajime,
are you still following us on this bug? In case you still see this problem recurring (altough you may well not after 1 year), could you check if JavaScript Syntax Validation is enabled in Window->Preferences on Validation page?
Comment 11 Chris Jaun CLA 2009-11-25 11:03:26 EST
I think you are right Jacek.

I think the validator is off by default because we were surfacing a lot of invalid problem message.

That is less of a problem now in 3.2 and if semantic validation is disabled.

At some point we may consider turning that validator back on by default.
Comment 12 Jacek Pospychala CLA 2009-12-04 08:02:31 EST
Comment on attachment 152930 [details]
patch

I'll mark this patch obsolete based on further comments.
Comment 13 Jacek Pospychala CLA 2009-12-04 08:03:38 EST
not "futher", I meant based on above comments - mainly comment 8
Comment 14 Nitin Dahyabhai CLA 2010-06-28 13:09:38 EDT
Works in 3.2.