Skip to content

Commit

Permalink
language-server: fix formatting of asdoc tags on hover when they cont…
Browse files Browse the repository at this point in the history
…ain tabs before spaces (references #733)
  • Loading branch information
joshtynjala committed Feb 12, 2024
1 parent c5b32fc commit 8b8a495
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,14 @@ public static String getDocumentationForDefinition(IDefinition definition, boole
String paramName = paramTagDescription;
String paramDescription = null;
int spaceIndex = paramName.indexOf(' ');
if (spaceIndex > 0) {
paramDescription = paramName.substring(spaceIndex + 1);
paramName = paramName.substring(0, spaceIndex);
int tabIndex = paramName.indexOf('\t');
int delimiterIndex = spaceIndex;
if (tabIndex < delimiterIndex) {
delimiterIndex = tabIndex;
}
if (delimiterIndex > 0) {
paramDescription = paramName.substring(delimiterIndex + 1);
paramName = paramName.substring(0, delimiterIndex);
}
if (useMarkdown) {
descriptionBuilder.append("`");
Expand Down Expand Up @@ -151,9 +156,14 @@ public static String getDocumentationForDefinition(IDefinition definition, boole
String throwsName = throwsTagDescription;
String throwsDescription = null;
int spaceIndex = throwsName.indexOf(' ');
if (spaceIndex > 0) {
throwsDescription = throwsName.substring(spaceIndex + 1);
throwsName = throwsName.substring(0, spaceIndex);
int tabIndex = throwsName.indexOf('\t');
int delimiterIndex = spaceIndex;
if (tabIndex < delimiterIndex) {
delimiterIndex = tabIndex;
}
if (delimiterIndex > 0) {
throwsDescription = throwsName.substring(delimiterIndex + 1);
throwsName = throwsName.substring(0, delimiterIndex);
}
if (useMarkdown) {
descriptionBuilder.append("`");
Expand Down

0 comments on commit 8b8a495

Please sign in to comment.