Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript: tags not found #2488

Closed
sparkcanon opened this issue Apr 4, 2020 · 3 comments
Closed

Typescript: tags not found #2488

sparkcanon opened this issue Apr 4, 2020 · 3 comments
Assignees

Comments

@sparkcanon
Copy link

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,�scene�3,33
const cubeArr = new three.Group();�cubeArr�6,125
const setupScene = (): void => {�setupScene�9,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

@ksamborski
Copy link
Member

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

ksamborski pushed a commit to ksamborski/ctags that referenced this issue Apr 4, 2020
Better handling of NL characters and fixed regex matching.
ksamborski added a commit that referenced this issue Apr 7, 2020
@masatake
Copy link
Member

masatake commented Apr 7, 2020

@ksamborski, thank you.

@sparkcanon
Copy link
Author

Thanks, @ksamborski @masatake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants