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 233501 - CSS styles window giving incorrect sass source information
Summary: CSS styles window giving incorrect sass source information
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Project (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-26 15:00 UTC by lxlyons
Modified: 2013-08-01 20:15 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample project (1.02 MB, application/octet-stream)
2013-07-26 15:00 UTC, lxlyons
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lxlyons 2013-07-26 15:00:59 UTC
Created attachment 137865 [details]
Sample project

I have a sample JET project including a custom theme that extends the JET Alta theme according to recommended best practice (see the t1 settings and aggregator files in scss/t1).  I created this file to test the use of the lightness function.  If you run index.html and select a link or header, for example, you'll note that the sass source being referenced in the CSS Styles window incorrectly points to various alta scss files, and not my settings.scss file where the colors and function are actually defined.  This misleading information is very confusing -- better to simply leave it with the css that be incorrect.
Comment 1 Vladimir Riha 2013-07-26 15:25:54 UTC
Reproducible. I also tried Chrome Developer Tools with source maps and it behaves the same way. It points to declaration of rule but in this case it is really not helpful

Product Version: NetBeans IDE Dev (Build 201307252300)
Java: 1.7.0_40-ea; Java HotSpot(TM) Client VM 24.0-b52
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-ea-b33
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb
Comment 2 Marek Fukala 2013-07-29 08:45:16 UTC
I'm not sure who exactly owns this are. I believe David can at least reassign to proper owner.
Comment 3 David Konecny 2013-07-29 23:33:01 UTC
Without first implementing issue 229525 ("Basic property sheets for visually editing SASS files") there is not much we can do with this issue for now - I will add a note to issue 229525 with this usecase. I'm surprised that CDT is as bad as us - the article which Liza posted a week ago claimed that CDT does understand mixins/variables/etc and is able to take user to place of mixing declaration.

However there is an editor bug which if fixed could helped Liza a bit - goto to declaration does not work in SASS files if mixin/variable is defined in an included files. Try this: inspect "A link" link and open SASS file for "a:visited" applied style. Your editor will shows:

  a:visited {
      @include oj-link-visited;
  }

Now holding Ctrl and hovering mouse above "oj-link-visited" turns it into a link but clicking it does nothing. It should open _oj.alta.mixins.tags.scss on lines where the mixin is defined:

  @mixin oj-link-visited {
      color: $linkTextColorVisited; // todo: lightness thing
  }

That would help user to see how color property is defined. Now, again, press Ctrl and hover mouse over "$linkTextColorVisited" and click it and nothing happens. The same problem as before. There is, however, one more issue here: which definition of $linkTextColorVisited should be opened? The variable is declared and assigned a value in three difference files: _oj.alta.settings.scss, _oj.jq.settings.scss, and _t1-settings.scss. If HTML page is rendered in browser we perhaps could figure out which definition of variable takes precedence and use it in visual SASS property sheets (eg. by analyzing in which order SASS files were loaded??) but in general it will not work. Perhaps actions like GoTo Declaration should just show popup with all available variable declaration files for user to choose from?
Comment 4 Marek Fukala 2013-07-31 07:30:54 UTC
> However there is an editor bug which if fixed could helped Liza a bit - goto to
> declaration does not work in SASS files if mixin/variable is defined in an
> included files. Try this: inspect "A link" link and open SASS file for
It does Davide. The problem is just I need to extend the css.editor's CssEditorModule SPI to allow to return alternative locations. Now the SPI allows to return just one. I'll fix that and then it will behave the same way as for example css class/id navigation where a small popup appears if there's more possible declarations and we are not sure which one is the right one.

s1.scss:
=============
@import "s2.scss";
.clz {
    color: $global_s2;
}
=============

_s2.scss
=============
$global_s2: 10; 
=============

=> the hyperling to the $global_s2 var works well.

If it doesn't work in you case file a separate issue w/ exact steps to reproduce. Thank you.

I've filed a new bug for the missing alternative locations:
Bug 233694 - Can't go to declaration of variable/mixin if there're more possible declarations

Passing back to David as this issue is not about editing but about an (inherent?) problem with source map.
Comment 5 David Konecny 2013-07-31 21:30:02 UTC
> => the hyperling to the $global_s2 var works well.

Have you tested this on Liza's test case? For example on oj-link-visited it did not work. If it works then there is not much else we can do for NB 74.

Future improvements are tracked as issue 229525.
Comment 6 Marek Fukala 2013-08-01 09:01:09 UTC
(In reply to comment #5)
> Have you tested this on Liza's test case? For example on oj-link-visited it did
> not work. If it works then there is not much else we can do for NB 74.
No, I haven't, I'm sorry. 

My point was that the go to declaration for mixins/vars does work in general also for included files. 

However in this particular case It doesn't work because of the dependency type - the elements in partial files refers to each other but the partial files don't import each other, the dependency is via another file which imports them both. 

pretty simple fix:

changeset:   259994:3e9f590885a9
summary:     fixing wrong dependency type

-br

Marek
Comment 7 David Konecny 2013-08-01 20:15:12 UTC
Cool, thanks.