@@ -214,7 +214,7 @@ public void allowsHoverWhenThereAreUnknownTraits() throws Exception {
214214 }
215215
216216 @ Test
217- public void hoverOnBrokenShapeShowsErrorMessage () throws Exception {
217+ public void hoverOnBrokenShapeAppendsValidations () throws Exception {
218218 Path baseDir = Paths .get (getClass ().getResource ("ext/models" ).toURI ());
219219 String modelFilename = "unknown-trait.smithy" ;
220220 Path modelFilePath = baseDir .resolve (modelFilename );
@@ -227,7 +227,10 @@ public void hoverOnBrokenShapeShowsErrorMessage() throws Exception {
227227 TextDocumentIdentifier tdi = new TextDocumentIdentifier (hs .file (modelFilename ).toString ());
228228 Hover hover = tds .hover (hoverParams (tdi , 10 , 13 )).get ();
229229 MarkupContent hoverContent = hover .getContents ().getRight ();
230- assertTrue (hoverContent .getValue ().startsWith ("Can't display shape" ));
230+ assertEquals (hoverContent .getKind (),"markdown" );
231+ assertTrue (hoverContent .getValue ().startsWith ("```smithy" ));
232+ assertTrue (hoverContent .getValue ().contains ("structure Foo {}" ));
233+ assertTrue (hoverContent .getValue ().contains ("WARNING: Unable to resolve trait `com.external#unknownTrait`" ));
231234 }
232235 }
233236
@@ -553,9 +556,9 @@ public void hoverV1() throws Exception {
553556
554557 // Resolves via resource read.
555558 Hover readHover = tds .hover (hoverParams (mainTdi , 76 , 12 )).get ();
556- correctHover ( mainHoverPrefix , "@http(\n method: \" PUT\" \n uri: \" /bar \" \n code: 200 \n ) \n @readonly \n "
557- + "operation MyOperation { \ n input: MyOperationInput \n output: MyOperationOutput \n "
558- + " errors: [\n MyError\n ]\n }" , readHover );
559+ assertTrue ( readHover . getContents (). getRight (). getValue (). contains ( "@http(\n method: \" PUT\" \n "
560+ + "uri: \" /bar \" \ n code: 200 \n ) \n @readonly \n operation MyOperation { \n input: "
561+ + "MyOperationInput \n output: MyOperationOutput \n errors: [\n MyError\n ]\n }" ) );
559562
560563 // Does not correspond to shape.
561564 Hover noMatchHover = tds .hover (hoverParams (mainTdi , 0 , 0 )).get ();
@@ -666,9 +669,9 @@ public void hoverV2() throws Exception {
666669
667670 // Resolves via resource read.
668671 Hover readHover = tds .hover (hoverParams (mainTdi , 78 , 12 )).get ();
669- correctHover ( mainHoverPrefix , "@http(\n method: \" PUT\" \n uri: \" /bar \" \n code: 200 \n ) \n @readonly \n "
670- + "operation MyOperation { \ n input: MyOperationInput \n output: MyOperationOutput \n "
671- + " errors: [\n MyError\n ]\n }" , readHover );
672+ assertTrue ( readHover . getContents (). getRight (). getValue (). contains ( "@http(\n method: \" PUT\" \n "
673+ + "uri: \" /bar \" \ n code: 200 \n ) \n @readonly \n operation MyOperation { \n input: "
674+ + "MyOperationInput \n output: MyOperationOutput \n errors: [\n MyError\n ]\n }" ) );
672675
673676 // Does not correspond to shape.
674677 Hover noMatchHover = tds .hover (hoverParams (mainTdi , 0 , 0 )).get ();
0 commit comments