From 462e1d71b6ce2094f5d828560b172462c58e217f Mon Sep 17 00:00:00 2001 From: nsingh Date: Wed, 25 Oct 2017 16:33:09 -0700 Subject: [PATCH] Show full URL in request mapping live hover --- .../requestmapping/RequestMappingHoverProvider.java | 3 +-- .../test/RequestMappingLiveHoverTest.java | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/headless-services/boot-java-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RequestMappingHoverProvider.java b/headless-services/boot-java-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RequestMappingHoverProvider.java index bd092c22a..76af42453 100644 --- a/headless-services/boot-java-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RequestMappingHoverProvider.java +++ b/headless-services/boot-java-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RequestMappingHoverProvider.java @@ -160,9 +160,8 @@ public class RequestMappingHoverProvider implements HoverProvider { String host = method.app.getHost(); String url = UrlUtil.createUrl(host, port, path); - builder.append("Path: "); builder.append("["); - builder.append(path); + builder.append(url); builder.append("]"); builder.append("("); builder.append(url); diff --git a/headless-services/boot-java-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/RequestMappingLiveHoverTest.java b/headless-services/boot-java-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/RequestMappingLiveHoverTest.java index c5012cf58..0ad9bd216 100644 --- a/headless-services/boot-java-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/RequestMappingLiveHoverTest.java +++ b/headless-services/boot-java-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/RequestMappingLiveHoverTest.java @@ -62,7 +62,7 @@ public class RequestMappingLiveHoverTest { harness.intialize(directory); Editor editor = harness.newEditorFromFileUri(docUri, LanguageId.JAVA); - editor.assertHoverContains("@RequestMapping(\"/hello-world\")", "Path: [/hello-world](http://cfapps.io:1111/hello-world)\n" + + editor.assertHoverContains("@RequestMapping(\"/hello-world\")", "[http://cfapps.io:1111/hello-world](http://cfapps.io:1111/hello-world)\n" + "\n" + "Process ID: 22022\n" + "\n" + @@ -94,13 +94,13 @@ public class RequestMappingLiveHoverTest { harness.intialize(directory); Editor editor = harness.newEditorFromFileUri(docUri, LanguageId.JAVA); - editor.assertHoverContains("@RequestMapping(\"/hello\")", "Path: [/hello](http://cfapps.io:999/hello)\n" + + editor.assertHoverContains("@RequestMapping(\"/hello\")", "[http://cfapps.io:999/hello](http://cfapps.io:999/hello)\n" + "\n" + "Process ID: 76543\n" + "\n" + "Process Name: test-request-mapping-live-hover"); - editor.assertHoverContains("@RequestMapping(\"/goodbye\")", "Path: [/goodbye](http://cfapps.io:999/goodbye)\n" + + editor.assertHoverContains("@RequestMapping(\"/goodbye\")", "[http://cfapps.io:999/goodbye](http://cfapps.io:999/goodbye)\n" + "\n" + "Process ID: 76543\n" + "\n" + @@ -179,7 +179,7 @@ public class RequestMappingLiveHoverTest { harness.intialize(directory); Editor editor = harness.newEditorFromFileUri(docUri, LanguageId.JAVA); - editor.assertHoverContains("@RequestMapping(\"/hello\")", "Path: [/hello](http://cfapps.io:1000/hello)\n" + + editor.assertHoverContains("@RequestMapping(\"/hello\")", "[http://cfapps.io:1000/hello](http://cfapps.io:1000/hello)\n" + "\n" + "Process ID: 70000\n" + "\n" + @@ -187,7 +187,7 @@ public class RequestMappingLiveHoverTest { "\n" + "---\n" + "\n" + - "Path: [/hello](http://cfapps.io:1001/hello)\n" + + "[http://cfapps.io:1001/hello](http://cfapps.io:1001/hello)\n" + "\n" + "Process ID: 80000\n" + "\n" + @@ -195,7 +195,7 @@ public class RequestMappingLiveHoverTest { "\n" + "---\n" + "\n" + - "Path: [/hello](http://cfapps.io:1002/hello)\n" + + "[http://cfapps.io:1002/hello](http://cfapps.io:1002/hello)\n" + "\n" + "Process ID: 90000\n" + "\n" +