Ctags: Typescript: tags not found

Created on 4 Apr 2020  ·  3Comments  ·  Source: universal-ctags/ctags

The name of the parser: Typescript

The command line you used to run ctags:

$ ctags --options=NONE -e src/index.ts

The content of input file:

import * as three from "three";

let scene: three.Scene,
  camera: three.PerspectiveCamera,
  renderer: three.WebGLRenderer;
const cubeArr = new three.Group();

// TODO: Add lighting
const setupScene = (): void => {
  scene = new three.Scene();
  camera = new three.PerspectiveCamera(
    75,
    window.innerWidth / window.innerHeight,
    0.1,
    1000
  );

  renderer = new three.WebGLRenderer();
  renderer.setSize(window.innerWidth, window.innerHeight);
  document.body.appendChild(renderer.domElement);
  camera.position.z = 20;
};

// TODO: Position the cubes in the center of the screen
const createCubeArr = (): void => {
  let cubes;

  for (let i = 0; i < 5; i++) {
    for (let r = 1; r < 5; r++) {
      cubes = createCube();
      cubes.position.set(i * 3, r * 2, 0);
      cubeArr.add(cubes);
    }
  }
  cubeArr.position.set(-5, -5, 0);
  scene.add(cubeArr);
};

// TODO: Receive shadow
const createWall = (): void => {
  const geometry = new three.PlaneGeometry(20, 20, 20);
  const material = new three.MeshBasicMaterial({
    color: 0x0000ff,
    side: three.DoubleSide,
  });
  const mesh = new three.Mesh(geometry, material);
  scene.add(mesh);
};

const createCube = (): three.Mesh => {
  const geometry, material;
  geometry = new three.BoxGeometry(1, 1, 1);
  material = new three.MeshBasicMaterial({
    color: 0x00ff00,
    side: three.DoubleSide,
  });
  const cube = new three.Mesh(geometry, material);
  return cube;
};

const animate = (): void => {
  requestAnimationFrame(animate);
  renderer.render(scene, camera);
};

setupScene();
createCubeArr();
createWall();
animate();

The tags output you are not satisfied with:


src/index.ts,134
let scene: three.Scene,scene3,33
const cubeArr = new three.Group();cubeArr6,125
const setupScene = (): void => {setupScene9,183

Expected tags:

All the other consts should be detected.

The version of ctags:

$ ctags --version
Universal Ctags 0.0.0(6dd6c735), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Apr  4 2020, 01:05:26
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +case-insensitive-filenames, +packcc

How do you get ctags binary:

binary taken from Universal-ctags/homebrew-universal-ctags project

Parser buenhancement

Most helpful comment

Thank you for reporting this. I will take a look.

All 3 comments

Thank you for reporting this. I will take a look.

@ksamborski, thank you.

Thanks, @ksamborski @masatake.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lvc picture lvc  ·  8Comments

cweagans picture cweagans  ·  8Comments

blackb1rd picture blackb1rd  ·  8Comments

JulienPivard picture JulienPivard  ·  16Comments

lvc picture lvc  ·  3Comments