Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// comment see CommonModule1.NonExists1
// also see CommonModule1.NonExists8 another
//
// Parameters:
// param - String - see CommonModule1.NonExists2 another
//
// Returns:
// - string - some string see CommonModule1.NonExists2 another
//
// Example:
// see CommonModule1.NonExists9
//
Function Proc1(param)

var Value; // number - it is an inline doc comment see CommonModule1.NonExists4

// free comment in procedure body see CommonModule1.NonExists5
//
// see CommonModule1.NonExists6

// doc comment see CommonModule1.NonExists7

return Value;

EndFunction
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,25 @@ public void testInvalidLinks() throws Exception

assertEquals(Set.of("5", "7"), lines);
}

/**
* Сhecks for invalid links in the method body and documenting comment
*
* @throws Exception the exception
*/
@Test
public void testInvalidLinksInMethodComments() throws Exception
{
updateModule(FOLDER_RESOURCE + "doc-comment-method-ref-link.bsl");

List<Marker> markers = getModuleMarkers();
assertEquals(9, markers.size());

Set<String> lines = markers.stream()
.map(marker -> marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY))
.collect(Collectors.toSet());

Set<String> expected = Set.of("1", "2", "5", "8", "11", "15", "17", "19", "21");
assertEquals(expected, lines);
}
}