https://github.com/rluba/jai-ctags
Jai module for generating CTags
https://github.com/rluba/jai-ctags
Last synced: over 1 year ago
JSON representation
Jai module for generating CTags
- Host: GitHub
- URL: https://github.com/rluba/jai-ctags
- Owner: rluba
- Created: 2020-05-27T10:30:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-29T19:31:36.000Z (over 3 years ago)
- Last Synced: 2024-11-03T11:32:39.671Z (over 1 year ago)
- Homepage:
- Size: 19.5 KB
- Stars: 19
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Jai module for generating Ctags
This module generates a [ctags file](https://en.wikipedia.org/wiki/Ctags) for your project as part of normal compilation.
This allows many editors to access definitions (functions, variables, structs, …) for quick navigation or lookup.
## Usage
If you don’t yet control compilation via workspaces, you can simply call the included `build_ctags(…)` function from your main file:
```jai
#import "ctags";
#run build_ctags(#file);
```
Otherwise, i.e., if you’ve already set up a custom workspace for compilation, you have to init a `CTags` struct and call `process_message(…)` from your compiler message loop:
```jai
#import "ctags";
your_build_function :: () {
w := compiler_create_workspace();
// your compilation setup
…
compiler_begin_intercept(w);
// add your build files
…
// Set up ctags options
ctags: CTags;
ctags.base_path = get_working_directory();
defer reset(*ctags);
while true {
message := compiler_wait_for_message();
if !message continue;
if message.workspace == w {
// Forward message to ctags generator
process_message(*ctags, message);
}
if message.kind == .COMPLETE break;
}
}
```
## Options
See the `CTags` struct for available options.