Skip to content

Commit

Permalink
Merge pull request #394 from marhali/fix/illegal-dependency-usage
Browse files Browse the repository at this point in the history
Fix/illegal dependency usage
  • Loading branch information
marhali authored Apr 13, 2024
2 parents 4475823 + 6b5ac27 commit 30fa22b
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## [Unreleased]

### Fixed

- Remove JavaScript usage on non-js-compliant platforms

## [4.5.0] - 2024-04-10

### Added
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginGroup = de.marhali.easyi18n
pluginName = easy-i18n
pluginRepositoryUrl = https://github.com/marhali/easy-i18n
# SemVer format -> https://semver.org
pluginVersion = 4.5.0
pluginVersion = 4.5.1

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 223
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package de.marhali.easyi18n.assistance.folding;

import com.intellij.lang.ASTNode;
import com.intellij.openapi.util.Pair;
import com.intellij.psi.PsiElement;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.xml.XmlAttributeValue;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;
import java.util.stream.Collectors;

public class XmlFoldingBuilder extends AbstractFoldingBuilder {
@Override
@NotNull List<Pair<String, PsiElement>> extractRegions(@NotNull PsiElement root) {
return PsiTreeUtil.findChildrenOfType(root, XmlAttributeValue.class)
.stream()
.map((attributeValue -> Pair.pair(attributeValue.getValue(), (PsiElement) attributeValue)))
.collect(Collectors.toList());
}

@Override
@Nullable String extractText(@NotNull ASTNode node) {
XmlAttributeValue attributeValue = node.getPsi(XmlAttributeValue.class);
return attributeValue.getValue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extensions defaultExtensionNs="com.intellij">
<lang.foldingBuilder
language="HTML"
implementationClass="de.marhali.easyi18n.assistance.folding.JsFoldingBuilder"
implementationClass="de.marhali.easyi18n.assistance.folding.XmlFoldingBuilder"
/>

<lang.documentationProvider
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<depends optional="true" config-file="de.marhali.easyi18n-kotlin.xml">org.jetbrains.kotlin</depends>
<depends optional="true" config-file="de.marhali.easyi18n-javascript.xml">JavaScript</depends>
<depends optional="true" config-file="de.marhali.easyi18n-html.xml">com.intellij.modules.xml</depends>
<depends optional="true" config-file="de.marhali.easyi18n-xml.xml">com.intellij.modules.xml</depends>
<depends optional="true" config-file="de.marhali.easyi18n-java.xml">com.intellij.java</depends>
<depends optional="true" config-file="de.marhali.easyi18n-php.xml">com.jetbrains.php</depends>

Expand Down

0 comments on commit 30fa22b

Please sign in to comment.