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 205631 - No CSS Class/Id Rule Found
Summary: No CSS Class/Id Rule Found
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: CSS Visual Tools (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P2 normal with 2 votes (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-29 02:44 UTC by psytek
Modified: 2012-04-25 09:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot showing the css hint (113.36 KB, image/jpeg)
2011-11-29 02:44 UTC, psytek
Details
This is the project, its a typical Django project layout. (2.21 KB, application/octet-stream)
2011-12-02 02:02 UTC, psytek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description psytek 2011-11-29 02:44:00 UTC
Created attachment 113601 [details]
screenshot showing the css hint

No CSS Class Rule Found when loading .html file - has a css file in the path.  

See screenshot http://i39.tinypic.com/16hup90.jpg

Product Version = NetBeans IDE Dev (Build 201111270600)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.6.0_23
Runtime = Java HotSpot(TM) 64-Bit Server VM 19.0-b09
Comment 1 Marek Fukala 2011-11-29 08:21:14 UTC
its likely due to the absolute paths to the stylesheets. Are the files in a project?
Comment 2 psytek 2011-11-29 08:37:53 UTC
No, no luck.  I tried:

http://127.0.0.1:8000/static/css/style.css
static/css/style.css
css/style.css

Tried putting the css file in the same directory as the html and having just
style.css

Each time I modified and saved the program.

Yes the project is a django project with a structure like this

static/css/style.css
templates/index.html

Thanks for looking into this, let me know if there is anything else I can help to fix this, I'd really love to have this feature working.
Comment 3 psytek 2011-11-29 08:59:05 UTC
One thing I just noticed.  If I had the file like href="style.css" and the style.css in the same folder as the index.html, I was able to hotlink (Ctrl + click) and it would open the file, otherwise with the other url configs it did nto hotlink at all.  Either way the hints are still showing up and the selectors are nto hotlinked.
Comment 4 psytek 2011-11-29 09:00:42 UTC
Another thing I might add.  I get this error every time i start up


java.lang.UnsupportedOperationException: This IndexReader cannot make any changes to the index (it was opened with readOnly = true)
	at org.apache.lucene.index.ReadOnlySegmentReader.noWrite(ReadOnlySegmentReader.java:23)
	at org.apache.lucene.index.ReadOnlyDirectoryReader.acquireWriteLock(ReadOnlyDirectoryReader.java:41)
	at org.apache.lucene.index.IndexReader.deleteDocument(IndexReader.java:871)
	at org.apache.lucene.index.IndexReader.deleteDocuments(IndexReader.java:907)
	at org.netbeans.modules.gsfret.source.usages.LuceneIndex.batchStore(LuceneIndex.java:515)
	at org.netbeans.modules.gsfret.source.usages.SourceAnalyser.batchStore(SourceAnalyser.java:171)
	at org.netbeans.modules.gsfret.source.usages.CachingIndexer$LanguageIndex.flush(CachingIndexer.java:159)
	at org.netbeans.modules.gsfret.source.usages.CachingIndexer.flush(CachingIndexer.java:112)
	at org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker.updateFolder(RepositoryUpdater.java:1414)
[catch] at org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker.scanRoots(RepositoryUpdater.java:1132)
	at org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker.access$1900(RepositoryUpdater.java:654)
	at org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker$1.run(RepositoryUpdater.java:841)
	at org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker$1.run(RepositoryUpdater.java:679)
	at org.netbeans.modules.gsfret.source.usages.ClassIndexManager.writeLock(ClassIndexManager.java:110)
	at org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker.run(RepositoryUpdater.java:679)
	at org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker.run(RepositoryUpdater.java:654)
	at org.netbeans.napi.gsfret.source.Source$CompilationJob.run(Source.java:1358)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)


Not sure if that is relates to th is.
Comment 5 Marek Fukala 2011-11-29 11:44:51 UTC
Would you mind to pack and attach your project or create a sample one I can use to reproduce the issue? 

Basically relative links should always work, absolute in the case the files are in a web-like project (provides a web root).
Comment 6 psytek 2011-12-02 02:02:39 UTC
Created attachment 113731 [details]
This is the project, its a typical Django project layout.

I've attached a sample project that will replicate the issue.  Thanks!
Comment 7 mipaaa 2011-12-08 08:32:09 UTC
Embedded styles cause the same warning (No CSS id rule found):

<!DOCTYPE html>
<html>
    <head>
        <title>CSS hint test</title>
        <style type="text/css">
            #content {color: red}
        </style>
    </head>
    <body>
        <div id="content">Header</div>
    </body>
</html>

Product Version: NetBeans IDE Dev (Build 201112070600)
Java: 1.6.0_29; Java HotSpot(TM) Client VM 20.4-b02
System: Windows 7 version 6.1 running on x86; Cp1251; en (nb)
Comment 8 anli 2012-01-16 19:46:17 UTC
There may be plenty different cases when a developer uses this or that kind of templating, layouting and so on, up to own template engines (as at my case). I imagine, it is too strong demand for htm(l) and css files to be in some relation in project tree to avoid cluttering of an editor with lot of warnings. Let's have some relaxing way also (as the simplest one - and opportunity to turn this warning off).
Comment 9 jdbevan 2012-03-29 09:58:33 UTC
The hints are a brilliant feature for finding unused/undeclared variables etc, but when you've got PHP, HTML and CSS all in one file the hints for missing CSS ID rules make the hints much less useful!
Comment 10 Marek Fukala 2012-04-24 09:57:58 UTC
fixed in web-main#862ad9c8119d

There's a new "CSS" subcategory in html hints. "No css class/id rule found" hints are there. No css id rule hint is disabled by default since in many cases the ids are used not just for styling, the missing css class rule is enabled by default with warning level.
Comment 11 Marek Fukala 2012-04-24 15:35:14 UTC
I've discovered two more bugs related to this area and fixed them in web-main#8c4891b8ff32
Comment 12 Quality Engineering 2012-04-25 09:58:48 UTC
Integrated into 'main-golden', will be available in build *201204250400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/862ad9c8119d
User: Marek Fukala <mfukala@netbeans.org>
Log: #205631 - No CSS Class/Id Rule Found