Skip to content

Commit b69fcbf

Browse files
authored
Merge pull request #320 from cedricziel/php-storm
2 parents 7408800 + 015de72 commit b69fcbf

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cache:
1818
matrix:
1919
include:
2020
- env: IDEA_VERSION="IU-2019.3.4" PHP_PLUGIN_VERSION="193.6911.15" PSI_VIEWER_PLUGIN_VERSION="193-SNAPSHOT" GRAMMAR_KIT_PLUGIN_VERSION="2019.3" SINCE_BUILD="193" UNTIL_BUILD="193.*"
21-
- env: IDEA_VERSION="IU-2020.1" PHP_PLUGIN_VERSION="201.6668.153" PSI_VIEWER_PLUGIN_VERSION="201-SNAPSHOT" GRAMMAR_KIT_PLUGIN_VERSION="2020.1" SINCE_BUILD="201" UNTIL_BUILD="201.*"
21+
- env: IDEA_VERSION="IU-2020.1.1" PHP_PLUGIN_VERSION="201.7223.91" PSI_VIEWER_PLUGIN_VERSION="201-SNAPSHOT" GRAMMAR_KIT_PLUGIN_VERSION="2020.1" SINCE_BUILD="201" UNTIL_BUILD="201.*"
2222

2323
before_install:
2424
- "export ORG_GRADLE_PROJECT_ideaVersion=${IDEA_VERSION}"

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ isEAP = false
77
jFlexRelease = 1.7.0-1
88

99
grammarKitPluginVersion = 2020.1
10-
ideaVersion = IU-2020.1
11-
phpPluginVersion = 201.6668.153
10+
ideaVersion = IU-2020.1.1
11+
phpPluginVersion = 201.7223.91
1212
psiViewerPluginVersion = 201-SNAPSHOT
1313
customSinceBuild=201
1414
customUntilBuild=201.*

lang-fluid/src/main/java/com/cedricziel/idea/fluid/viewHelpers/DefaultViewHelpersProvider.java

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@
1212
import com.intellij.psi.xml.XmlTag;
1313
import com.intellij.psi.xml.XmlText;
1414
import gnu.trove.THashMap;
15-
import org.apache.commons.io.IOUtils;
1615
import org.jetbrains.annotations.NotNull;
1716

18-
import java.io.IOException;
19-
import java.io.InputStream;
20-
import java.io.StringWriter;
17+
import java.io.*;
2118
import java.util.Map;
2219

2320
public class DefaultViewHelpersProvider implements ViewHelperProvider {
@@ -55,14 +52,14 @@ private synchronized Map<String, ViewHelper> getStringViewHelperMap(@NotNull Pro
5552

5653
private String readSchema(String schemaLocation) {
5754
InputStream resourceAsStream = DefaultViewHelpersProvider.class.getResourceAsStream(schemaLocation);
58-
StringWriter writer = new StringWriter();
55+
String schema = "";
5956
try {
60-
IOUtils.copy(resourceAsStream, writer);
57+
schema = readFromInputStream(resourceAsStream);
6158
} catch (IOException e) {
6259
e.printStackTrace();
6360
}
6461

65-
return writer.toString();
62+
return schema;
6663
}
6764

6865
private class ViewHelperSchemaRecursiveElementVisitor extends XmlRecursiveElementVisitor {
@@ -137,4 +134,25 @@ String extractDocumentation(XmlTag attributeTag) {
137134
return attributeDocumentation.toString();
138135
}
139136
}
137+
138+
private String readFromInputStream(InputStream inputStream)
139+
throws IOException {
140+
StringBuilder resultStringBuilder = new StringBuilder();
141+
try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream))) {
142+
String line;
143+
while ((line = br.readLine()) != null) {
144+
resultStringBuilder.append(line).append("\n");
145+
}
146+
} finally {
147+
if (inputStream != null) {
148+
try {
149+
inputStream.close();
150+
} catch (IOException e) {
151+
e.printStackTrace();
152+
}
153+
}
154+
}
155+
156+
return resultStringBuilder.toString();
157+
}
140158
}

typo3-cms/src/main/java/com/cedricziel/idea/typo3/provider/AbstractServiceLocatorTypeProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public PhpType complete(String s, Project project) {
2222
}
2323

2424
public Collection<? extends PhpNamedElement> getBySignature(String expression, Set<String> visited, int depth, Project project) {
25-
int endIndex = expression.lastIndexOf("%");
25+
int endIndex = expression.lastIndexOf(TRIM_KEY);
2626
if (endIndex == -1) {
2727
return Collections.emptySet();
2828
}

0 commit comments

Comments
 (0)