ctags icon indicating copy to clipboard operation
ctags copied to clipboard

TypeScript: extract a member with no type

Open masatake opened this issue 5 months ago • 1 comments

[yamato@dev64 ts-class-member-with-props.d]$ cat input2.ts 
cat input2.ts 
class C {
      a
      b
}
[yamato@dev64 ts-class-member-with-props.d]$ tsc input2.ts 
tsc input2.ts 
[yamato@dev64 ts-class-member-with-props.d]$ ~/bin/ctags -o - input2.ts 
~/bin/ctags -o - input2.ts 
C	input2.ts	/^class C {$/;"	c
b	input2.ts	/^      b$/;"	p	class:C

a is not extracted.

masatake avatar Oct 14 '25 22:10 masatake

diff --git a/parsers/typescript.c b/parsers/typescript.c
index f168de622..db470742e 100644
--- a/parsers/typescript.c
+++ b/parsers/typescript.c
@@ -1813,6 +1813,7 @@ static void parseClassBody (const int scope, tokenInfo *const token)
 				case TOKEN_COLON:
 					uwiUngetC (':');
 					parsePropertyType (token);
+				case TOKEN_NL:
 				case TOKEN_SEMICOLON:
 					if (member)
 					{

masatake avatar Nov 08 '25 02:11 masatake