universal-ctags / ctags

A maintained ctags implementation
https://ctags.io
GNU General Public License v2.0
6.38k stars 618 forks source link

typescript: method not parsed #4004

Closed char101 closed 1 month ago

char101 commented 1 month ago

Hi,

I think the < operator in below code joined with > in the lambda expression is parsed as template, thus making the method below invisible.


The name of the parser: typescript

The command line you used to run ctags:

$ ctags --options=NONE -f - test.ts

The content of input file:

class A {
  constructor() {
    if (1 > 2 && 2 < 1) {
    }
  }

  function1() {
    [].forEach(v => 0);
  }
}

The tags output you are not satisfied with:

A               test.ts /^class A {$/;" c
constructor     test.ts /^  constructor() {$/;" m       class:A

The tags output you expect:

A               test.ts /^class A {$/;" c
constructor     test.ts /^  constructor() {$/;" m       class:A
function1       test.ts /^  function1() {$/;"   m       class:A

The version of ctags:

Universal Ctags 6.1.0(8904e85), Copyright (C) 2015-2023 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: May 16 2024, 01:59:36
  URL: https://ctags.io/
  Output version: 0.0
  Optional compiled features: +win32, +wildcards, +regex, +gnulib_regex, +internal-sort, +unix-path-separator, +iconv, +option-directory, +xpath, +json, +interactive, +yaml, +case-insensitive-filenames, +packcc, +optscript, +pcre2

How do you get ctags binary: ctags-win32

char101 commented 1 month ago

Actually I just realized that this is the same issue as the other typescript issue so I will be closing it.