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 218380 - Parsing and indexing of remote files [was:Getting hint "No CSS class rule found", when using external CSS files]
Summary: Parsing and indexing of remote files [was:Getting hint "No CSS class rule fou...
Status: REOPENED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 8.1
Hardware: PC Windows 10 x64
: P3 normal with 1 vote (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
: 255869 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-14 14:14 UTC by dusty
Modified: 2016-05-18 07:47 UTC (History)
8 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dusty 2012-09-14 14:14:34 UTC
The HTML editaor does not parse CSS resources hosted on CDN , for example when using an include of this type:

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0-beta.1/jquery.mobile-1.2.0-beta.1.min.css">

I have to copy the css file locally to make the hints disappear
Comment 1 Marek Fukala 2012-09-17 11:53:07 UTC
hmmm, that's true.

I may possibly index such remote files as well and use the result as they were local. Then there's a question when to refresh.

In case there would be a resource we cannot reach the error checks could be disabled.

I wonder if anyone else hasn't addressed such issue in netbeans. Davide or Tomasi, any idea/s?
Comment 2 David Konecny 2012-09-17 21:40:45 UTC
I do agree that HTML editor must parse remote files. The web.clientproject.api module has RemoteFileCache API which we are using for JavaScript files from JS debugger. The API basically downloads a remote file into local cache and gives you local FileObject. As for the refreshing we were thinking about adding a "Refresh" action on nodes under "Remote Files" node in client project. I would not worry too much about refreshing as remote files should be most of the time readonly and static, for example files from a CDN server.

RemoteFileCache API is generic and should be moved into web.common if you would want to use it from HTML editor.

Another question is how JavaScript guys are solving this problem?
Comment 3 Marek Fukala 2012-09-18 07:26:48 UTC
I believe the RemoteFileCache API should be moved to web.common and possibly implemented not just for static project (lower priority).

I need the files in some local context folder so I can include the files to the html/css indexing.
Comment 4 David Konecny 2012-09-18 20:21:26 UTC
(In reply to comment #3)
> I believe the RemoteFileCache API should be moved to web.common

issue 217838
Comment 5 Petr Pisl 2012-09-19 12:36:40 UTC
> Another question is how JavaScript guys are solving this problem?

I don't know what you mean. If the remote js files are on the project classpath and I expect that they are, then are treated as other js files. There shouldn't be a problem.
Comment 6 David Konecny 2012-09-19 19:46:05 UTC
(In reply to comment #5)
> > Another question is how JavaScript guys are solving this problem?
> 
> I don't know what you mean. If the remote js files are on the project classpath
> and I expect that they are, then are treated as other js files. There shouldn't
> be a problem.

So do you download remote js from internet to some local cache? and if you do how do you keep them up to date? Marek needs something similar for remote CSS and I offered him to use RemoteFileCache API.
Comment 7 ungars 2014-09-15 15:06:16 UTC
There is the same problem with the identification of CSS file in the directory "ressources/css/" :

1) Universal Class Selector are recognized only inside JSF tags, for example :

<h:dataTable value="#{xxxx.yyyy}" var="zzzz"
                                 width="100%"
                                 styleClass="zoneDb2"
                                 headerClass="db2Header"
                                 rowClasses="oddRow,evenRow"
                                 columnClasses="CelluleCenter,
                                 CelluleLeft">

2) But there is the warning "No CSS rule class found" into the Editor of HTML pages for the same Universal Selector outside JSF tags (into "normal" HTML tags):

<tr class="oddRow">

My .css file :

.Table {
    vertical-align:top;
    background-color: #FFFFFF;
    display:inline;
    font-family:verdana,arial,helvetica,sans-serif;
}
.TableHeader {
    font-family:verdana,arial,helvetica,sans-serif;
    font-weight:bold;
    text-align:center;
    background-color:#33CCFF;
    padding-top:4px;
    padding-bottom:4px;
    font-size:12px;
}
.ColumnHeader{
    font-family:verdana,arial,helvetica,sans-serif;
    font-size:12px;
    font-weight:bold;
    background-color:yellow;
    padding-top:2px;
    padding-bottom:2px;
}
.PageTitle {
    font-family:verdana,arial,helvetica,sans-serif;
    font-size:14px;
    color:#222299;
    font-weight:bold;
    padding-left:5px;
}
.evenRow {
    background-color: #F5F5DC;
}
.oddRow {
    background-color: #FFE4C4;
}
.CelluleLeft {
    font-family:verdana,arial,helvetica,sans-serif;
    font-size:13px;
    text-align: left;
    text-transform: uppercase;
}
.CelluleRight {
    font-family:verdana,arial,helvetica,sans-serif;
    font-size:13px;
    text-align: right;
}
.CelluleCenter {
    font-family:verdana,arial,helvetica,sans-serif;
    font-size:13px;
    text-align: center;
    text-transform: uppercase;
}
.zoneParametres {
    border: thin solid black;
    text-align: center;
}
.zoneDb2 {
    border: thin solid black;
    text-align: center;
}
.zoneFichiers {
    border: thin solid black;
    text-align: center;
}
.bordDrapeau {
    font-family:verdana,arial,helvetica,sans-serif;
    border: thin solid black;
    text-align: center;
    background-color: aqua;
}
.db2Header {
    font-family:verdana,arial,helvetica,sans-serif;
    font-size:13px;
    text-align: center;
    font-style: normal;
    background: yellow;
    padding-top:2px;
    padding-bottom:2px;
}
.erreursSaisie {
    font-family:verdana,arial,helvetica,sans-serif;
    font-size:13px;
    text-align: left;
}

I use http://csslint.net to validate the CSS file...Everything is good.
Comment 8 riksoft 2015-10-22 10:04:14 UTC
On the same line: I set the use of CDN or not in a php config file. The paths are also different on production or development and are automatically detected/set. So in the HTML files I only have this:

<head>
  <title>title</title>
  <?= APP_HEAD_BASE ?>
</head>

And Netbeans sees nothing of my CSS, so, no code completion and tons of hints complaining "Class xxx not found" on every bootstrap class, etc.

What about rem directives for the editor like:
/**
*@css-include ./css/main.css
*@css-include ./css//bootstrap.css
*/
?

There is already such stuff for other things...e.g. I'm already using
/**
 * @var mysqli
 */
public $connection

/**
 * @var mysqli_stmt statement
 */
public $stm;

etc. in php to have code completion on the built in mysqli library, so it wouldn't be strange to have the same trick for CSS etc. to help the IDE when it can't understand stuff by itself.
Comment 9 riksoft 2015-10-22 17:36:46 UTC
Errata Corrige and mitigation factor: the code completion works in any case. The problem is only about hints complaining "Class not found".
Comment 10 Maiakaat 2016-03-23 12:30:29 UTC
I'm getting this with the npm package manager using twitter bootstrap. 

code-autocomplete works, and Netbeans can present a list of files which contain the definition, but it still says class definition not found, even if you select one.

The CSS files are contained in the node_modules path
Comment 11 Maiakaat 2016-03-23 12:31:59 UTC
I should add this is on Netbeans 8.1 on Windows 10 x64
Comment 12 lolka_bolka 2016-05-18 07:46:35 UTC
(In reply to Maiakaat from comment #11)
> I should add this is on Netbeans 8.1 on Windows 10 x64

You should but you did not :)

This issue is still in latest:

Product Version: NetBeans IDE Dev (Build 201604110001)
Java: 1.8.0_66; Java HotSpot(TM) 64-Bit Server VM 25.66-b18
Runtime: Java(TM) SE Runtime Environment 1.8.0_66-b18
System: Windows 10 version 10.0 running on amd64; Cp1250; hu_HU (nb)
Comment 13 lolka_bolka 2016-05-18 07:47:54 UTC
*** Bug 255869 has been marked as a duplicate of this bug. ***