swift-book icon indicating copy to clipboard operation
swift-book copied to clipboard

Generate a tags file for navigation while editing

Open amartini51 opened this issue 1 year ago • 0 comments

The output uses using the POSIX ctags syntax, and enables "jump to definition" for DocC links and for syntactic categories in the formal grammar. From testing with a few different editors, here's what I saw:

  • In Vim, you have to configure setlocal iskeyword+=#,:,- to allow those characters as part a tag. Then both links and grammar works. Classic vi supports tag files, but doesn't have iskeyword, so other vi-like editors might not be able to follow tags.
  • In BBedit, links work without configuration changes. I wasn't able to get grammar to work, likely because it doesn't consider - as part of a tag.
  • Emacs has support for tags files, but it seems to need a module or configuration change to handle the ctags syntax instead of its preferred etags syntax.
  • Xcode uses its own indexing for navigation, not a tags file.

Marking this as a draft for now. I'd like to consider rewriting the script in Swift.

amartini51 avatar Mar 31 '23 18:03 amartini51