Skip to content

Commit a7bb030

Browse files
committed
Fix ServiceStackIDEA to match URL behavior of SSVS
1 parent dc696d9 commit a7bb030

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/ServiceStackIDEA/src/main/java/net/servicestack/idea/BaseNativeTypesHandler.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public URIBuilder getUrl(String baseUrl, Map<String, String> options) throws Mal
4949
if (!path.endsWith(this.getRelativeTypesUrl() + "/")) {
5050
serverUrl += (this.getRelativeTypesUrl() + "/");
5151
}
52+
serverUrl = toParentPath(serverUrl);
5253
URIBuilder builder;
5354

5455
try {
@@ -59,4 +60,11 @@ public URIBuilder getUrl(String baseUrl, Map<String, String> options) throws Mal
5960
}
6061
return builder;
6162
}
63+
64+
public static String toParentPath(String path)
65+
{
66+
int pos = path.lastIndexOf("/");
67+
if (pos == -1) return "/";
68+
return path.substring(0, pos);
69+
}
6270
}

src/ServiceStackIDEA/src/main/resources/META-INF/plugin.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
]]></description>
1010

1111
<change-notes><![CDATA[
12-
1.0.9 - Fix plugin to support Android Studio 2.0.
12+
1.0.10 - Fix issue with resolving URL to match behavior of other extensions. <br />
13+
1.0.9 - Fix plugin to support Android Studio 2.0. <br />
1314
1.0.8 - Add support for Kotlin projects with Add/Update ServiceStack reference. <br />
1415
1.0.7 - Bug fixes and client now gets dependency version from ServiceStack.Java tags, falls back to 1.0.15 if it fails. <br />
1516
1.0.6 - Update client and android dependency versions to 1.0.13. <br />

src/ServiceStackIDEA/src/test/java/AddRefTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public void testCreateUrl() throws MalformedURLException, URISyntaxException {
2828
INativeTypesHandler javaNativeTypesHanlder = new JavaNativeTypesHandler();
2929
INativeTypesHandler kotlinNativeTypesHandler = new KotlinNativeTypesHandler();
3030
URIBuilder javaUriBuilder = javaNativeTypesHanlder.getUrl("techstacks.io", null);
31-
assertEquals(javaUriBuilder.build().toString(),"http://techstacks.io/types/java/");
31+
assertEquals(javaUriBuilder.build().toString(),"http://techstacks.io/types/java");
3232

3333
URIBuilder kotlinUriBuilder = kotlinNativeTypesHandler.getUrl("techstacks.io", null);
34-
assertEquals(kotlinUriBuilder.build().toString(),"http://techstacks.io/types/kotlin/");
34+
assertEquals(kotlinUriBuilder.build().toString(),"http://techstacks.io/types/kotlin");
3535
}
3636
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy