Skip to content

Instantly share code, notes, and snippets.

@isao
Forked from jb55/.ctags
Last active January 29, 2018 21:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isao/e939470887b13df98de5 to your computer and use it in GitHub Desktop.
Save isao/e939470887b13df98de5 to your computer and use it in GitHub Desktop.
TypeScript ctags config. Based on https://github.com/jb55/typescript-ctags with 1. `variables` removed, 2. members changed to only match methods, 3. added protected for TypeScript v1.4+
--langdef=TypeScript
--langmap=typescript:.ts
--regex-typescript=/^[ \t]*(export)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\2/c,classes/
--regex-typescript=/^[ \t]*(export)?[ \t]*module[ \t]+([a-zA-Z0-9_]+)/\2/n,modules/
--regex-typescript=/^[ \t]*(export)?[ \t]*function[ \t]+([a-zA-Z0-9_]+)/\2/f,functions/
--regex-typescript=/^[ \t]*var[ \t]+([a-zA-Z0-9_]+)[ \t]*=[ \t]*function[ \t]*\(\)/\1/v,varlambdas/
--regex-typescript=/^[ \t]*(public|protected|private)?[ \t]*(static)?[ \t]*([a-zA-Z0-9_]+)\(.*\).+{$/\3/f,members/
--regex-typescript=/^[ \t]*(export)?[ \t]*interface[ \t]+([a-zA-Z0-9_]+)/\2/i,interfaces/
--regex-typescript=/^[ \t]*(export)?[ \t]*enum[ \t]+([a-zA-Z0-9_]+)/\2/e,enums/
@isao
Copy link
Author

isao commented Apr 28, 2016

@dylan-chong
Copy link

Does this work with properties? e.g. class X { y: number; private z = {}; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment