This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 217485 - missing class rule gives warning but not hint to create rule
Summary: missing class rule gives warning but not hint to create rule
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: CSS Visual Tools (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-27 20:44 UTC by John Jullion-ceccarelli
Modified: 2012-09-13 02:11 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Jullion-ceccarelli 2012-08-27 20:44:34 UTC
Build 567 and on:

1. Open EaselDemo and enter <footer class="footer"></footer>
2. Open styles.css and delete .footer {}
3. Go back to index.html. File is marked with warning but there is no action in the tip to create the rule in the CSS file.
Comment 1 Marek Fukala 2012-08-28 16:02:23 UTC
in web-main#85a9900cf669 I did:

1) implement 'create rule xxx in stylesheet yyy' hintfix if the there's already linked stylesheet in the html file - the fix creates the rule in the stylesheet.

2) implement 'create rule xxx and import stylesheet yyy' hintfix for all stylesheets from the project which are not linked to the edited file - creates the rule in the stylesheet and add a link to it.

3) what is missing (and I'll add tomorrow) is: add 'create rule xxx in new stylesheet yyy' if there's no stylesheet in the project - it will create a stylesheet with some default name in the same folder, add link to it and put the rule inside.

!!!!! READ !!!!!! IMPORTANT !!!!!

The current implementation however have quite nasty problem - the currently edited file is not reindexed upon modifications, but only after save. So if the hintfixgenerate a link, the hint will remain until you save the file. 

The hint relies on a file references graph I create based on the index data.

I've tried some ways via parsing.api to workaround this, but then I run to different issues I need to discuss with Tomas Zezula.

So for now, please save the file once the hint do the import to get rid of the warning.
Comment 2 Quality Engineering 2012-09-03 13:03:31 UTC
Integrated into 'main-golden', will be available in build *201209031048* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/85a9900cf669
User: Marek Fukala <mfukala@netbeans.org>
Log: #217485 - missing class rule gives warning but not hint to create rule
Comment 3 Marek Fukala 2012-09-12 06:39:32 UTC
> The current implementation however have quite nasty problem - the currently
> edited file is not reindexed upon modifications, but only after save. So if the
> hintfixgenerate a link, the hint will remain until you save the file. 
> 
> The hint relies on a file references graph I create based on the index data.
> 
> I've tried some ways via parsing.api to workaround this, but then I run to
> different issues I need to discuss with Tomas Zezula.

Tomas has already created a fix, which requires an API change: Bug 218148 - QuerySupport not refreshed in embedded languages
Comment 4 Marek Fukala 2012-09-12 14:54:41 UTC
changeset:   232821:3518ff242c1a
summary:     #217485  - adding a hintfix "create rule xxx in new stylesheet style.css" for the last missing case: no refered rule found, no stylesheet in the project.
Comment 5 Quality Engineering 2012-09-13 02:11:25 UTC
Integrated into 'main-golden', will be available in build *201209130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3518ff242c1a
User: Marek Fukala <mfukala@netbeans.org>
Log: #217485  - adding a hintfix "create rule xxx in new stylesheet style.css" for the last missing case: no refered rule found, no stylesheet in the project.