mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 05:41:22 -06:00
Fixed JSDoc with only one asterisk in comment
This commit is contained in:
parent
995023c2a7
commit
98e9e77255
@ -7602,15 +7602,8 @@ namespace ts {
|
||||
if (state === JSDocState.BeginningOfLine) {
|
||||
// leading asterisks start recording on the *next* (non-whitespace) token
|
||||
state = JSDocState.SawAsterisk;
|
||||
|
||||
if (lookAhead(() => nextTokenJSDoc() === SyntaxKind.AsteriskToken)) {
|
||||
pushComment(scanner.getTokenText());
|
||||
tok = nextTokenJSDoc();
|
||||
}
|
||||
else {
|
||||
indent += 1;
|
||||
break;
|
||||
}
|
||||
indent += 1;
|
||||
break;
|
||||
}
|
||||
// record the * as a comment
|
||||
// falls through
|
||||
@ -7695,13 +7688,14 @@ namespace ts {
|
||||
skipWhitespaceOrAsterisk();
|
||||
|
||||
const { name, isBracketed } = parseBracketNameInPropertyAndParamTag();
|
||||
skipWhitespace();
|
||||
const indentText = skipWhitespaceOrAsterisk();
|
||||
|
||||
if (isNameFirst) {
|
||||
typeExpression = tryParseTypeExpression();
|
||||
}
|
||||
|
||||
const comment = parseTagComments(indent + scanner.getStartPos() - start);
|
||||
const comment = parseTrailingTagComments(indent + scanner.getStartPos() - start, getNodePos(), indent, indentText);
|
||||
|
||||
const nestedTypeLiteral = target !== PropertyLikeParse.CallbackParameter && parseNestedTypeLiteral(typeExpression, name, target, indent);
|
||||
if (nestedTypeLiteral) {
|
||||
typeExpression = nestedTypeLiteral;
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
//// function f1(var1, var2) { }
|
||||
////
|
||||
//// /**
|
||||
//// * @param {number} var1 *This asterisk gets trimmed unfortunatelly
|
||||
//// * @param {number} var1 *Regular text with an asterisk
|
||||
//// * @param {string} var2 Another *Regular text with an asterisk
|
||||
//// */
|
||||
//// function f2(var1, var2) { }
|
||||
@ -57,10 +57,10 @@ verify.signatureHelp({
|
||||
});
|
||||
verify.signatureHelp({
|
||||
marker: "2",
|
||||
parameterDocComment: "This asterisk gets trimmed unfortunatelly",
|
||||
parameterDocComment: "*Regular text with an asterisk",
|
||||
tags: [{
|
||||
name: "param",
|
||||
text: "var1 This asterisk gets trimmed unfortunatelly"
|
||||
text: "var1 *Regular text with an asterisk"
|
||||
}, {
|
||||
name: "param",
|
||||
text: "var2 Another *Regular text with an asterisk"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user