Add support for jsdoc properties with hyphen (#32631)

This commit is contained in:
Zixiang Li
2019-08-20 14:49:40 -07:00
committed by Nathan Shively-Sanders
parent 5ac450510a
commit 24201cfe6e
2 changed files with 25 additions and 1 deletions
+1 -1
View File
@@ -2182,7 +2182,7 @@ namespace ts {
if (isIdentifierStart(ch, languageVersion)) {
let char = ch;
while (pos < end && isIdentifierPart(char = codePointAt(text, pos), languageVersion)) pos += charSize(char);
while (pos < end && isIdentifierPart(char = codePointAt(text, pos), languageVersion) || text.charCodeAt(pos) === CharacterCodes.minus) pos += charSize(char);
tokenValue = text.substring(tokenPos, pos);
if (char === CharacterCodes.backslash) {
tokenValue += scanIdentifierParts();
@@ -0,0 +1,24 @@
///<reference path="fourslash.ts" />
// @allowJs: true
// @Filename: dummy.js
//// /**
//// * @typedef Product
//// * @property {string} title
//// * @property {boolean} h/*1*/igh-top some-comments
//// */
////
//// /**
//// * @type {Pro/*2*/duct}
//// */
//// const product = {
//// /*3*/
//// }
verify.quickInfoAt('1', '(property) high-top: boolean', 'some-comments');
verify.quickInfoAt('2', 'type Product = {\n title: string;\n high-top: boolean;\n}');
verify.completions({
marker: ['3'],
includes: ['"high-top"']
});