Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #7996 - space after comma (css) #8051

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wumpz
Copy link
Contributor

@wumpz wumpz commented Dec 14, 2024

Those CSS rule names were separated by a linefeed

.css_one,
.css_two {
}

The linefeed was not displayed and since breadcrumbs are displayed in a single line, it transformed to .css_one,.css_two.

So this PR simply replaces linefeeds with a space.

@mbien mbien added the Editor label Dec 17, 2024
@matthiasblaesing
Copy link
Contributor

Can you describe how to reproduce the problem? I built from master and there it works without any change:

grafik

So what is different in your case?

@wumpz
Copy link
Contributor Author

wumpz commented Dec 21, 2024

The issue was, that multiple rules in breadcrumbs are better readable if there is an additional space between them. In your screenshot it's not.

E.g.

.rule,.rule2
to
.rule, .rule2

Like the issue described.

@matthiasblaesing
Copy link
Contributor

Ok, I thought your problem was, that the rendering was

.rule,
.rule2

with only the first one visible. Then I suggest to indeed push this down into the css module as that is a general problem in the structure scanner there. As you can see in my screenshot, the same issue is present in the navigator view. Given the origin of the two trees is the same it is not to surprising.

@mbien mbien added the CSS [ci] enable web job label Dec 22, 2024
@mbien mbien linked an issue Dec 22, 2024 that may be closed by this pull request
@wumpz
Copy link
Contributor Author

wumpz commented Dec 22, 2024

Ok, I thought your problem was, that the rendering was

.rule,
.rule2

with only the first one visible. Then I suggest to indeed push this down into the css module as that is a general problem in the structure scanner there. As you can see in my screenshot, the same issue is present in the navigator view. Given the origin of the two trees is the same it is not to surprising.

The structure parser delivers the list of rules separated by a linefeed like in the editor view and the breadcrumb module simple removes this linefeed with no addition (displayed as HTML I suppose), hence no space between the rules in the list. The same problem is within the navigator view.

I am not familiar with the structure scanner. So how should this rule list delivered so that all displaying parts still work. Now it's quite convenient because it's just a string.

So wouldn't it be the easiest way to simply do the same change in the node factory for a css file?

@matthiasblaesing
Copy link
Contributor

@wumpz

I am not familiar with the structure scanner. So how should this rule list delivered so that all displaying parts still work. Now it's quite convenient because it's just a string.

So wouldn't it be the easiest way to simply do the same change in the node factory for a css file?

Well kind of. The intermediate structure we need to focus on is the StructureItem. The CSL API processes this to generate the navigator structure view and the breadcrumbs for example. The results from a usages search ("Find All Subtype") for that class gives a list, that seems to be manageable (round about 10 subclasses). I think the one you are looking for is org.netbeans.modules.css.editor.module.main.CssRuleStructureItem. Modifiying the name should be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS [ci] enable web job Editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSS breadcrumbs - Add space after a comma for better readability
3 participants