mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add support for jsdoc properties with hyphen (#32631)
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
5ac450510a
commit
24201cfe6e
@@ -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"']
|
||||
});
|
||||
Reference in New Issue
Block a user