Skip to content

Commit

Permalink
Fix broken CSSAssistProcessor and dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
nullterminated committed Jan 2, 2025
1 parent 0c35ef0 commit f6c3ba6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
10 changes: 10 additions & 0 deletions wolips.targetplatform/wolips.targetplatform.target
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,15 @@
<repository location="https://spotbugs.github.io/eclipse/"/>
<unit id="com.github.spotbugs.plugin.eclipse.feature.group" version="4.8.6.r202406180231-6cf7b2c"/>
</location>
<location includeDependencyDepth="infinite" includeDependencyScopes="compile" includeSource="true" label="ph-css parser" missingManifest="generate" type="Maven">
<dependencies>
<dependency>
<groupId>com.helger</groupId>
<artifactId>ph-css</artifactId>
<version>7.0.3</version>
<type>jar</type>
</dependency>
</dependencies>
</location>
</locations>
</target>
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ Require-Bundle: org.eclipse.ui.editors,
org.objectstyle.wolips.preferences,
org.objectstyle.wolips.bindings,
org.objectstyle.wolips.variables;bundle-version="1.0.6",
org.eclipse.e4.core.contexts;bundle-version="1.3.0"
org.eclipse.e4.core.contexts;bundle-version="1.3.0",
com.helger.ph-css;bundle-version="7.0.3",
com.helger.commons.ph-commons;bundle-version="11.1.8"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-21
Bundle-ClassPath: lib/xercesImpl.jar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.helger.css.ECSSVersion;
import com.helger.css.decl.CSSSelectorSimpleMember;
import com.helger.css.decl.CascadingStyleSheet;
import com.helger.css.decl.ICSSSelectorMember;
import com.helger.css.reader.CSSReader;

import jp.aonir.fuzzyxml.FuzzyXMLAttribute;
Expand Down Expand Up @@ -145,13 +146,19 @@ private void processStylesheet(String css) {
CascadingStyleSheet styles = CSSReader.readFromString(css, ECSSVersion.LATEST);
styles.getAllStyleRules().stream().forEach(stylerule ->{
stylerule.getAllSelectors().forEach(sel ->{
//FIXME add to _rules here
sel.getAllMembers().stream().forEach(mem ->{
//add to _rules here
String currentTag = "*";
ArrayList<String> currentClasses = _rules.computeIfAbsent(currentTag, k -> new ArrayList<>());
for(ICSSSelectorMember mem: sel.getAllMembers()) {
if(mem instanceof CSSSelectorSimpleMember m) {
if(m.isElementName()) {
currentTag = m.getValue();
currentClasses = _rules.computeIfAbsent(currentTag, k -> new ArrayList<>());
} else if(m.isClass()) {
currentClasses.add(m.getValue().substring(1));
}
}
});
}
});
});
}
Expand Down
6 changes: 0 additions & 6 deletions wolips/plugins/org.objectstyle.wolips.tkhtmleditor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
</parent>
<packaging>eclipse-plugin</packaging>
<artifactId>org.objectstyle.wolips.tkhtmleditor</artifactId>
<dependencies>
<dependency>
<groupId>com.helger</groupId>
<artifactId>ph-css</artifactId>
</dependency>
</dependencies>
<build>
<sourceDirectory>java</sourceDirectory>
<resources>
Expand Down

0 comments on commit f6c3ba6

Please sign in to comment.