├── _config.yml
├── src
├── ctags
│ ├── mod.rs
│ ├── ctags_opt.rs
│ ├── ctags_cmd.rs
│ └── ctags_parser.rs
├── parse_option.rs
├── segment
│ ├── camelcase_tok.rs
│ ├── mod.rs
│ └── stop_words.rs
├── coco_struct.rs
├── bin
│ ├── diffing.rs
│ ├── visualing.rs
│ ├── concepting.rs
│ └── modeling.rs
├── render
│ ├── plantuml_render.rs
│ ├── mermaid_render.rs
│ ├── graphviz_render.rs
│ └── mod.rs
├── file_filter.rs
└── lib.rs
├── _fixtures
├── ctags
│ ├── main.go
│ ├── source
│ │ ├── animal.ts
│ │ ├── datastore.go
│ │ ├── TypeName.java
│ │ └── field.cpp
│ ├── ts_tags
│ ├── coco_tags
│ ├── java_tags
│ ├── go_tags
│ ├── coco_class_tags
│ └── cpp_tags
└── rust
│ └── render_tags
├── .gitignore
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── workflows
│ ├── build.yml
│ └── release.yml
└── CONTRIBUTING.md
├── static
├── index.html
├── stylesheets
│ └── main.css
└── js
│ └── chart.js
├── justfile
├── LICENSE
├── Cargo.toml
├── cliff.toml
├── README.md
└── CHANGELOG.md
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-slate
--------------------------------------------------------------------------------
/src/ctags/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod ctags_cmd;
2 | pub mod ctags_opt;
3 | pub mod ctags_parser;
4 |
--------------------------------------------------------------------------------
/_fixtures/ctags/main.go:
--------------------------------------------------------------------------------
1 | func main() {
2 |
3 | }
4 |
5 | type person struct {
6 | name string
7 | age int
8 | }
9 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | Cargo.lock
3 | .idea
4 | demo.puml
5 | tags
6 | *.puml
7 | temps/
8 | output.csv
9 | demo.log
10 | output_text.csv
11 | output_word.csv
12 | modeling.svg
13 | modeling.dot
14 | output.json
15 | debug.json
--------------------------------------------------------------------------------
/src/parse_option.rs:
--------------------------------------------------------------------------------
1 | use serde::{Deserialize, Serialize};
2 |
3 | #[derive(Serialize, Deserialize, Debug, Clone, Default)]
4 | pub struct ParseOption {
5 | pub merge_method_name: bool,
6 | pub field_only: bool,
7 | pub inline_id_suffix: bool,
8 | pub without_parent: bool,
9 | pub without_impl_suffix: bool,
10 | pub without_suffix: String,
11 | }
12 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 🐞 Bug report
3 | about: Create a report about something that is not working
4 | ---
5 |
6 |
7 | ### Describe the bug
8 | A clear and concise description of what the bug is.
9 |
10 | ### Steps to reproduce (please include code)
11 |
12 |
13 | ### Environment
14 | - coco version
15 | - Rust version
16 | - OS: [e.g. OSX 10.13.4, Windows 10]
17 |
--------------------------------------------------------------------------------
/src/segment/camelcase_tok.rs:
--------------------------------------------------------------------------------
1 | use tokenizers::{PreTokenizedString, PreTokenizer, SplitDelimiterBehavior};
2 |
3 | #[derive(Clone, Debug)]
4 | pub struct CamelCaseTok;
5 |
6 | impl Default for CamelCaseTok {
7 | fn default() -> Self {
8 | Self
9 | }
10 | }
11 |
12 | impl PreTokenizer for CamelCaseTok {
13 | fn pre_tokenize(&self, pre_tokenized: &mut PreTokenizedString) -> tokenizers::Result<()> {
14 | pre_tokenized.split(|_, normalized| {
15 | normalized.split(char::is_uppercase, SplitDelimiterBehavior::MergedWithNext)
16 | })
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Modeling simple Visualization
6 |
7 |
8 |
9 |
10 |
11 | Order:
12 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/_fixtures/ctags/source/animal.ts:
--------------------------------------------------------------------------------
1 | // https://github.com/microsoft/TypeScriptSamples/blob/master/simple/animals.ts
2 |
3 | class Animal {
4 | name : string
5 | constructor(name : string) {
6 | this.name = name;
7 | }
8 | move(meters) {
9 | console.log(this.name + " moved " + meters + "m.");
10 | }
11 | }
12 |
13 | class Snake extends Animal {
14 | move() {
15 | console.log("Slithering...");
16 | super.move(5);
17 | }
18 | }
19 |
20 | class Horse extends Animal {
21 | move() {
22 | console.log("Galloping...");
23 | super.move(45);
24 | }
25 | }
26 |
27 | var sam = new Snake("Sammy the Python")
28 | var tom: Animal = new Horse("Tommy the Palomino")
29 |
30 | sam.move()
31 | tom.move(34)
32 |
--------------------------------------------------------------------------------
/static/stylesheets/main.css:
--------------------------------------------------------------------------------
1 | .hover path {
2 | stroke: #ccc;
3 | }
4 |
5 | .hover text {
6 | fill: #ccc;
7 | }
8 |
9 | .hover g.primary text {
10 | fill: black;
11 | font-weight: bold;
12 | }
13 |
14 | .hover g.secondary text {
15 | fill: #333;
16 | }
17 |
18 | .hover path.primary {
19 | stroke: #333;
20 | stroke-opacity: 1;
21 | }
22 |
23 | div.tooltip {
24 | position: absolute;
25 | text-align: left;
26 | width: auto;
27 | height: auto;
28 | padding: 12px;
29 | font: 14px sans-serif;
30 | background: lightsteelblue;
31 | border: 0;
32 | border-radius: 8px;
33 | /*pointer-events: none;*/
34 | }
35 |
36 | #packing,
37 | #circle {
38 | width: 1200px;
39 | height: 1200px;
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F680 Feature Request"
3 | about: "I have a suggestion (and may want to implement it \U0001F642)!"
4 | title: ''
5 | labels: 'i: enhancement, i: needs triage'
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## Feature Request
11 |
12 | **Is your feature request related to a problem? Please describe.**
13 | A clear and concise description of what the problem is. Ex. I have an issue when [...]
14 |
15 | **Describe the solution you'd like**
16 | A clear and concise description of what you want to happen. Add any considered drawbacks.
17 |
18 | **Describe alternatives you've considered**
19 | A clear and concise description of any alternative solutions or features you've considered.
20 |
21 | **Teachability, Documentation, Adoption, Migration Strategy**
22 | If you can, explain how users will be able to use this and possibly write out a version the docs.
23 | Maybe a screenshot or design?
24 |
--------------------------------------------------------------------------------
/justfile:
--------------------------------------------------------------------------------
1 | setup:
2 | cargo install git-cliff
3 | rustup component add llvm-tools-preview --toolchain nightly
4 | cargo install cargo-llvm-cov
5 |
6 | install:
7 | cargo install --path .
8 |
9 | build:
10 | cargo build --all
11 |
12 | test:
13 | cargo test --all
14 |
15 | release:
16 | cargo build --verbose --release --all
17 |
18 | coverage:
19 | cargo llvm-cov --all-features --workspace --html
20 |
21 | @bench:
22 | cargo bench
23 |
24 | @lint:
25 | rustup component add clippy
26 | rustup component add rustfmt
27 | cargo clippy -- -D warnings
28 | cargo clippy --tests
29 | cargo fmt -- --check
30 |
31 | @fix:
32 | cargo fmt --all
33 |
34 | # cargo install cargo-bloat
35 | @analysis:
36 | cargo bloat --release -n 50
37 |
38 | clean:
39 | cargo clean
40 | find . -type f -name "*.orig" -exec rm {} \;
41 | find . -type f -name "*.bk" -exec rm {} \;
42 | find . -type f -name ".*~" -exec rm {} \;
43 |
44 | changelog:
45 | git cliff --output CHANGELOG.md
46 |
--------------------------------------------------------------------------------
/src/segment/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod camelcase_tok;
2 | pub mod stop_words;
3 |
4 | use crate::segment::camelcase_tok::CamelCaseTok;
5 | use tokenizers::{OffsetReferential, OffsetType, PreTokenizedString, PreTokenizer};
6 |
7 | pub fn segment(str: &str) -> Vec {
8 | segment_camelcase(str)
9 | }
10 |
11 | pub fn segment_camelcase(str: &str) -> Vec {
12 | let pretok = CamelCaseTok::default();
13 |
14 | let mut pretokenized = PreTokenizedString::from(str);
15 | pretok.pre_tokenize(&mut pretokenized).unwrap();
16 |
17 | let vec = pretokenized
18 | .get_splits(OffsetReferential::Original, OffsetType::Byte)
19 | .into_iter()
20 | .map(|(s, _o, _)| (s.to_string()))
21 | .collect::>();
22 |
23 | vec
24 | }
25 |
26 | #[cfg(test)]
27 | mod tests {
28 | use crate::segment::segment;
29 |
30 | #[test]
31 | fn should_segmentation() {
32 | assert_eq!(
33 | vec!["Hierarchy".to_string(), "Id".to_string()],
34 | segment("HierarchyId")
35 | );
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/_fixtures/ctags/source/datastore.go:
--------------------------------------------------------------------------------
1 | // tags2uml
2 | // Copyright 2014 ruben2020 https://github.com/ruben2020/
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | package pkg
17 |
18 | type memberinfo_st struct {
19 | name, access, datatype string
20 | }
21 |
22 | type methodinfo_st struct {
23 | name, access, returntype string
24 | }
25 |
26 | type classinfo_st struct {
27 | name string
28 | id int
29 | parents []string
30 | members []memberinfo_st
31 | methods []methodinfo_st
32 | }
33 |
34 | var classmap map[string]classinfo_st
35 | var idcounter int = 1
36 |
37 | func InitDatastore() {
38 | classmap = make(map[string]classinfo_st)
39 | }
40 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Coco Build
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | build:
7 | strategy:
8 | matrix:
9 | os: [macos-latest, ubuntu-latest, windows-latest]
10 | runs-on: ${{ matrix.os }}
11 | steps:
12 | - uses: actions/checkout@v2
13 | - name: Checkout submodules
14 | shell: bash
15 | run: |
16 | git fetch --tags
17 | auth_header="$(git config --local --get http.https://github.com/.extraheader)"
18 | git submodule sync --recursive
19 | git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
20 |
21 | - name: Install ctags on Linux
22 | if: matrix.os == 'ubuntu-latest'
23 | run: |
24 | sudo snap install universal-ctags
25 |
26 | - name: Install ctags on macOS
27 | if: matrix.os == 'macOS-latest'
28 | run: |
29 | brew update
30 | brew install --HEAD universal-ctags/universal-ctags/universal-ctags
31 |
32 | - name: Install ctags on Windows
33 | if: matrix.os == 'windows-latest'
34 | run: |
35 | choco install universal-ctags
36 |
37 | - name: Run unit tests
38 | run: ${{matrix.ENV_VARS}} cargo test
39 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | ctags analysis based on [https://github.com/dalance/ptags](https://github.com/dalance/ptags) with MIT, see in [src](plugins/coco_struct_analysis/src)
4 |
5 | ctags parser rewrite from Golang's [https://github.com/ruben2020/tags2uml](https://github.com/ruben2020/tags2uml) with Apache License.
6 |
7 | Copyright (c) 2021 Inherd Group
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy
10 | of this software and associated documentation files (the "Software"), to deal
11 | in the Software without restriction, including without limitation the rights
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | copies of the Software, and to permit persons to whom the Software is
14 | furnished to do so, subject to the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be included in all
17 | copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | SOFTWARE.
26 |
--------------------------------------------------------------------------------
/_fixtures/ctags/ts_tags:
--------------------------------------------------------------------------------
1 | !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2 | !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3 | !_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
4 | !_TAG_OUTPUT_FILESEP slash /slash or backslash/
5 | !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
6 | !_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/
7 | !_TAG_PROC_CWD /Users/chalme/CLionProjects/coco/_fixtures/ctags/source/ //
8 | !_TAG_PROGRAM_AUTHOR Universal Ctags Team //
9 | !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
10 | !_TAG_PROGRAM_URL https://ctags.io/ /official site/
11 | !_TAG_PROGRAM_VERSION 5.9.0 /98ff77d/
12 | Animal animal.ts /^class Animal {$/;" class line:3 language:TypeScript
13 | Horse animal.ts /^class Horse extends Animal {$/;" class line:20 language:TypeScript inherits:Animal
14 | Snake animal.ts /^class Snake extends Animal {$/;" class line:13 language:TypeScript inherits:Animal
15 | constructor animal.ts /^ constructor(name : string) {$/;" method line:5 language:TypeScript class:Animal access:public
16 | move animal.ts /^ move() {$/;" method line:14 language:TypeScript class:Snake access:public
17 | move animal.ts /^ move() {$/;" method line:21 language:TypeScript class:Horse access:public
18 | move animal.ts /^ move(meters) {$/;" method line:8 language:TypeScript class:Animal access:public
19 | name animal.ts /^ name : string$/;" property line:4 language:TypeScript class:Animal access:public
20 | sam animal.ts /^var sam = new Snake("Sammy the Python")$/;" variable line:27 language:TypeScript
21 | tom animal.ts /^var tom: Animal = new Horse("Tommy the Palomino")$/;" variable line:28 language:TypeScript
22 |
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "modeling"
3 | version = "0.6.2"
4 | authors = ["Inherd Group ", "Phodal Huang "]
5 | edition = "2018"
6 | license = "MIT"
7 | readme = "README.md"
8 | repository = "https://github.com/inherd/modeling"
9 | documentation = "https://github.com/inherd/modeling"
10 | homepage = "https://github.com/inherd/modeling"
11 | description = """
12 | Modeling is a tools to analysis different languages by Ctags
13 | """
14 | categories = ["text-processing", "command-line-interface", "development-tools"]
15 | exclude = [
16 | ".github/*",
17 | ".gitattributes",
18 | ".adr.json",
19 | ]
20 |
21 | [dependencies]
22 | nix = "0.19"
23 | tempfile = "3"
24 | failure = "0.1"
25 |
26 | # serialize
27 | serde = "1"
28 | serde_derive = "1"
29 | serde_json = "1"
30 |
31 | lazy_static = "1.4.0"
32 |
33 | regex = "1"
34 |
35 | # gitignore
36 | # docs: https://github.com/BurntSushi/ripgrep/tree/master/crates/ignore
37 | ignore = "0.4"
38 |
39 | clap = "3.0.0-beta.2"
40 |
41 | # command args to struct
42 | structopt = "0.3"
43 | structopt-toml = "0.4"
44 |
45 | # https://crates.io/crates/grep-regex
46 | grep-regex = "0.1.9"
47 | grep-searcher = "0.1.8"
48 |
49 | similar = { version = "2.1.0", features = ["text", "inline", "bytes"] }
50 | console = "0.15.0"
51 |
52 | prettytable-rs = "^0.8"
53 |
54 | env_logger = "0.8.4"
55 | log = "0.4"
56 |
57 | tokenizers = "0.11.0"
58 |
59 | # visual for embed files
60 | rust-embed = "6.3.0"
61 |
62 | # visual for web
63 | actix-web = { version = "3", default-features = false }
64 | actix-rt = "2.6.0"
65 |
66 | mime_guess = "2.0.3"
67 |
68 | # open URLs in browsers
69 | webbrowser = "0.5.5"
70 |
--------------------------------------------------------------------------------
/_fixtures/rust/render_tags:
--------------------------------------------------------------------------------
1 | DData graphviz_render.rs /^pub struct DData {$/;" struct line:14 language:Rust
2 | DLink graphviz_render.rs /^pub struct DLink {$/;" struct line:27 language:Rust
3 | DNode graphviz_render.rs /^pub struct DNode {$/;" struct line:20 language:Rust
4 | GraphvizRender graphviz_render.rs /^impl GraphvizRender {$/;" implementation line:34 language:Rust
5 | GraphvizRender graphviz_render.rs /^pub struct GraphvizRender;$/;" struct line:11 language:Rust
6 | group graphviz_render.rs /^ group: usize$/;" field line:23 language:Rust struct:DNode
7 | id graphviz_render.rs /^ id: String,$/;" field line:21 language:Rust struct:DNode
8 | links graphviz_render.rs /^ links: Vec$/;" field line:16 language:Rust struct:DData
9 | nodes graphviz_render.rs /^ nodes: Vec,$/;" field line:15 language:Rust struct:DData
10 | package graphviz_render.rs /^ package: String,$/;" field line:22 language:Rust struct:DNode
11 | package graphviz_render.rs /^ pub package: String,$/;" field line:31 language:Rust struct:DLink
12 | render graphviz_render.rs /^ pub fn render(classes: &Vec, parse_option: &ParseOption) -> String {$/;" method line:35 language:Rust implementation:GraphvizRender
13 | should_render_graphviz graphviz_render.rs /^ fn should_render_graphviz() {$/;" function line:136 language:Rust module:tests
14 | source graphviz_render.rs /^ source: String,$/;" field line:28 language:Rust struct:DLink
15 | target graphviz_render.rs /^ target: String,$/;" field line:29 language:Rust struct:DLink
16 | tests graphviz_render.rs /^mod tests {$/;" module line:131 language:Rust
17 | value graphviz_render.rs /^ value: usize,$/;" field line:30 language:Rust struct:DLink
--------------------------------------------------------------------------------
/_fixtures/ctags/coco_tags:
--------------------------------------------------------------------------------
1 | !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2 | !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3 | !_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
4 | !_TAG_OUTPUT_FILESEP slash /slash or backslash/
5 | !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
6 | !_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/
7 | !_TAG_PROC_CWD /Users/fdhuang/consultant/devops/coco/ //
8 | !_TAG_PROGRAM_AUTHOR Universal Ctags Team //
9 | !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
10 | !_TAG_PROGRAM_URL https://ctags.io/ /official site/
11 | !_TAG_PROGRAM_VERSION 5.9.0 /d532b5c/
12 | CocoSwagger coco_swagger/src/lib.rs /^impl Default for CocoSwagger {$/;" implementation line:20 language:Rust
13 | CocoSwagger coco_swagger/src/lib.rs /^impl PluginInterface for CocoSwagger {$/;" implementation line:6 language:Rust
14 | CocoSwagger coco_swagger/src/lib.rs /^pub struct CocoSwagger {}$/;" struct line:4 language:Rust
15 | default coco_swagger/src/lib.rs /^ fn default() -> Self {$/;" method line:21 language:Rust implementation:CocoSwagger
16 | execute coco_swagger/src/lib.rs /^ fn execute(&self, config: CocoConfig) {$/;" method line:15 language:Rust implementation:CocoSwagger
17 | name coco_swagger/src/lib.rs /^ fn name(&self) -> &'static str {$/;" method line:7 language:Rust implementation:CocoSwagger
18 | on_plugin_load coco_swagger/src/lib.rs /^ fn on_plugin_load(&self) {}$/;" method line:11 language:Rust implementation:CocoSwagger
19 | on_plugin_unload coco_swagger/src/lib.rs /^ fn on_plugin_unload(&self) {}$/;" method line:13 language:Rust implementation:CocoSwagger
20 | plugin coco_swagger/src/lib.rs /^pub fn plugin() -> Box {$/;" function line:27 language:Rust
21 |
--------------------------------------------------------------------------------
/cliff.toml:
--------------------------------------------------------------------------------
1 | # configuration file for git-cliff (0.1.0)
2 |
3 | [changelog]
4 | # changelog header
5 | header = """
6 | # Changelog
7 | All notable changes to this project will be documented in this file.\n
8 | """
9 | # template for the changelog body
10 | # https://tera.netlify.app/docs/#introduction
11 | body = """
12 | {% if version %}\
13 | ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
14 | {% else %}\
15 | ## [unreleased]
16 | {% endif %}\
17 | {% for group, commits in commits | group_by(attribute="group") %}
18 | ### {{ group | upper_first }}
19 | {% for commit in commits %}
20 | - {{ commit.message | upper_first }}\
21 | {% endfor %}
22 | {% endfor %}\n
23 | """
24 | # remove the leading and trailing whitespaces from the template
25 | trim = true
26 | # changelog footer
27 | footer = """
28 |
29 | """
30 |
31 | [git]
32 | # allow only conventional commits
33 | # https://www.conventionalcommits.org
34 | conventional_commits = true
35 | # regex for parsing and grouping commits
36 | commit_parsers = [
37 | { message = "^feat", group = "Features"},
38 | { message = "^fix", group = "Bug Fixes"},
39 | { message = "^doc", group = "Documentation"},
40 | { message = "^perf", group = "Performance"},
41 | { message = "^refactor", group = "Refactor"},
42 | { message = "^style", group = "Styling"},
43 | { message = "^test", group = "Testing"},
44 | { message = "^chore\\(release\\): prepare for", skip = true},
45 | { message = "^chore", group = "Miscellaneous Tasks"},
46 | { body = ".*security", group = "Security"},
47 | ]
48 | # filter out the commits that are not matched by commit parsers
49 | filter_commits = false
50 | # glob pattern for matching git tags
51 | tag_pattern = "v[0-9]*"
52 | # regex for skipping tags
53 | skip_tags = "v0.1.0-beta.1"
54 |
--------------------------------------------------------------------------------
/src/coco_struct.rs:
--------------------------------------------------------------------------------
1 | use serde::{Deserialize, Serialize};
2 |
3 | #[derive(Serialize, Deserialize, Debug, Clone)]
4 | pub struct MemberInfo {
5 | pub name: String,
6 | pub access: String,
7 | pub data_type: String,
8 | pub pure_data_type: String,
9 | pub line_no: i32,
10 | }
11 |
12 | impl MemberInfo {
13 | pub fn new(name: &str, access: String, data_type: String) -> Self {
14 | MemberInfo {
15 | name: name.to_string(),
16 | access,
17 | data_type,
18 | pure_data_type: "".to_string(),
19 | line_no: 0,
20 | }
21 | }
22 | }
23 |
24 | #[derive(Serialize, Deserialize, Debug, Clone)]
25 | pub struct MethodInfo {
26 | pub name: String,
27 | pub access: String,
28 | pub parameters: Vec,
29 | pub return_type: String,
30 | pub pure_return_type: String,
31 | pub line_no: i32,
32 | }
33 |
34 | impl MethodInfo {
35 | pub fn new(name: &str, access: String, parameters: Vec, return_type: String) -> Self {
36 | MethodInfo {
37 | name: name.to_string(),
38 | access,
39 | parameters,
40 | return_type,
41 | pure_return_type: "".to_string(),
42 | line_no: 0,
43 | }
44 | }
45 | }
46 |
47 | #[derive(Serialize, Deserialize, Debug, Clone)]
48 | pub struct ClassInfo {
49 | pub id: i32,
50 | pub name: String,
51 | pub package: String,
52 | pub file: String,
53 | pub lang: String,
54 | pub parents: Vec,
55 | pub members: Vec,
56 | pub methods: Vec,
57 | }
58 |
59 | impl ClassInfo {
60 | pub fn new(class_name: &str) -> Self {
61 | ClassInfo {
62 | id: 0,
63 | name: class_name.to_string(),
64 | package: "".to_string(),
65 | file: "".to_string(),
66 | lang: "".to_string(),
67 | parents: vec![],
68 | members: vec![],
69 | methods: vec![],
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/bin/diffing.rs:
--------------------------------------------------------------------------------
1 | use std::fmt;
2 | use std::fs::read;
3 | use std::process::exit;
4 |
5 | use console::{style, Style};
6 | use similar::{ChangeTag, TextDiff};
7 |
8 | struct Line(Option);
9 |
10 | impl fmt::Display for Line {
11 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
12 | match self.0 {
13 | None => write!(f, " "),
14 | Some(idx) => write!(f, "{:<4}", idx + 1),
15 | }
16 | }
17 | }
18 |
19 | fn main() {
20 | let args: Vec<_> = std::env::args_os().collect();
21 | if args.len() < 3 {
22 | eprintln!("usage: diffing [old] [new]");
23 | exit(1);
24 | }
25 |
26 | let old = read(&args[1]).unwrap();
27 | let new = read(&args[2]).unwrap();
28 |
29 | let diff = TextDiff::from_lines(&old, &new);
30 |
31 | for (idx, group) in diff.grouped_ops(3).iter().enumerate() {
32 | if idx > 0 {
33 | println!("{:-^1$}", "-", 80);
34 | }
35 | for op in group {
36 | for change in diff.iter_inline_changes(op) {
37 | let (sign, s) = match change.tag() {
38 | ChangeTag::Delete => ("-", Style::new().red()),
39 | ChangeTag::Insert => ("+", Style::new().green()),
40 | ChangeTag::Equal => (" ", Style::new().dim()),
41 | };
42 | print!(
43 | "{}{} |{}",
44 | style(Line(change.old_index())).dim(),
45 | style(Line(change.new_index())).dim(),
46 | s.apply_to(sign).bold(),
47 | );
48 | for (emphasized, value) in change.iter_strings_lossy() {
49 | if emphasized {
50 | print!("{}", s.apply_to(value).underlined().on_black());
51 | } else {
52 | print!("{}", s.apply_to(value));
53 | }
54 | }
55 | if change.missing_newline() {
56 | println!();
57 | }
58 | }
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/render/plantuml_render.rs:
--------------------------------------------------------------------------------
1 | use std::collections::HashMap;
2 |
3 | use crate::coco_struct::ClassInfo;
4 | use crate::render::{process_name, render_member, render_method};
5 | use crate::ParseOption;
6 |
7 | /// Render classes info to string
8 | pub struct PlantUmlRender;
9 |
10 | impl PlantUmlRender {
11 | pub fn render(classes: &Vec, parse_option: &ParseOption) -> String {
12 | let mut rendered: Vec = vec![];
13 | let mut deps: Vec = vec![];
14 |
15 | let mut class_map: HashMap = HashMap::default();
16 | for clazz in classes {
17 | class_map.insert(process_name(&parse_option, &clazz.name), true);
18 | }
19 |
20 | for clazz in classes {
21 | let mut dep_map: HashMap = HashMap::default();
22 |
23 | let members = render_member(&clazz, &mut dep_map, "", parse_option, &mut class_map);
24 | let mut methods = vec![];
25 | if !parse_option.field_only {
26 | methods = render_method(&clazz, &mut dep_map, "", parse_option);
27 | }
28 |
29 | let content = format!("{}{}", members.join(""), methods.join(""));
30 | let clazz_name = process_name(&parse_option, &clazz.name);
31 | if clazz.parents.len() > 0 && !parse_option.without_parent {
32 | for parent in &clazz.parents {
33 | rendered.push(format!("{} <|-- {}", parent, clazz.name));
34 | }
35 | }
36 |
37 | rendered.push(format!("class {} {{\n{}}}", clazz_name, content));
38 |
39 | for (callee, current_clz) in dep_map {
40 | if callee == current_clz {
41 | continue;
42 | }
43 |
44 | if class_map.get(&callee).is_none() {
45 | continue;
46 | }
47 |
48 | deps.push(format!("{} -- {}\n", current_clz, callee));
49 | }
50 | }
51 |
52 | format!(
53 | "@startuml\n\n{}\n{}\n@enduml",
54 | rendered.join("\n\n"),
55 | deps.join("")
56 | )
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/_fixtures/ctags/java_tags:
--------------------------------------------------------------------------------
1 | !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2 | !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3 | !_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
4 | !_TAG_OUTPUT_FILESEP slash /slash or backslash/
5 | !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
6 | !_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/
7 | !_TAG_PROC_CWD /Users/fdhuang/clone/lombok/src/core/lombok/core/configuration/ //
8 | !_TAG_PROGRAM_AUTHOR Universal Ctags Team //
9 | !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
10 | !_TAG_PROGRAM_URL https://ctags.io/ /official site/
11 | !_TAG_PROGRAM_VERSION 5.9.0 /d532b5c/
12 | TypeName TypeName.java /^ private TypeName(String name) {$/;" method line:29 language:Java class:TypeName file: access:private
13 | TypeName TypeName.java /^public final class TypeName implements ConfigurationValueType {$/;" class line:26 language:Java inherits:ConfigurationValueType
14 | description TypeName.java /^ public static String description() {$/;" method line:43 language:Java class:TypeName access:public
15 | equals TypeName.java /^ @Override public boolean equals(Object obj) {$/;" method line:51 language:Java class:TypeName access:public
16 | exampleValue TypeName.java /^ public static String exampleValue() {$/;" method line:47 language:Java class:TypeName access:public
17 | getCharArray TypeName.java /^ public char[] getCharArray() {$/;" method line:68 language:Java class:TypeName access:public
18 | getName TypeName.java /^ public String getName() {$/;" method line:64 language:Java class:TypeName access:public
19 | hashCode TypeName.java /^ @Override public int hashCode() {$/;" method line:56 language:Java class:TypeName access:public
20 | lombok.core.configuration TypeName.java /^package lombok.core.configuration;$/;" package line:22 language:Java
21 | name TypeName.java /^ private final String name;$/;" field line:27 language:Java class:TypeName file: access:private
22 | toString TypeName.java /^ @Override public String toString() {$/;" method line:60 language:Java class:TypeName access:public
23 | valueOf TypeName.java /^ public static TypeName valueOf(String name) {$/;" method line:33 language:Java class:TypeName access:public
24 |
--------------------------------------------------------------------------------
/src/render/mermaid_render.rs:
--------------------------------------------------------------------------------
1 | use crate::coco_struct::ClassInfo;
2 | use crate::render::{process_name, render_member, render_method};
3 | use crate::ParseOption;
4 | use std::collections::HashMap;
5 |
6 | /// Render classes info to string
7 | pub struct MermaidRender;
8 |
9 | impl MermaidRender {
10 | pub fn render(classes: &[ClassInfo], parse_option: &ParseOption) -> String {
11 | let space = " ";
12 | let mut rendered: Vec = vec![];
13 | let mut deps: Vec = vec![];
14 |
15 | let mut class_map: HashMap = HashMap::default();
16 | for clazz in classes {
17 | class_map.insert(process_name(&parse_option, &clazz.name), true);
18 | }
19 |
20 | for clazz in classes {
21 | let mut dep_map: HashMap = HashMap::default();
22 |
23 | let members = render_member(&clazz, &mut dep_map, space, parse_option, &mut class_map);
24 | let mut methods = vec![];
25 | if !parse_option.field_only {
26 | methods = render_method(&clazz, &mut dep_map, space, parse_option);
27 | }
28 |
29 | let content = format!("{}{}", members.join(""), methods.join(""));
30 | let class_name = process_name(&parse_option, &clazz.name);
31 | if clazz.parents.len() > 0 && !parse_option.without_parent {
32 | rendered.push(format!(
33 | "{}{} <|-- {}",
34 | space,
35 | clazz.parents.join(","),
36 | class_name
37 | ));
38 | }
39 |
40 | rendered.push(format!(
41 | "{}class {} {{\n{}{}}}",
42 | space, class_name, content, space
43 | ));
44 |
45 | for (callee, current_clz) in dep_map {
46 | if callee == current_clz {
47 | continue;
48 | }
49 |
50 | if class_map.get(&callee).is_none() {
51 | continue;
52 | }
53 |
54 | deps.push(format!("{}{} -- {}\n", space, current_clz, callee));
55 | }
56 | }
57 |
58 | format!("{}\n{}", rendered.join("\n\n"), deps.join(""))
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/bin/visualing.rs:
--------------------------------------------------------------------------------
1 | use std::borrow::Cow;
2 | use std::fs;
3 |
4 | use actix_web::body::Body;
5 | use actix_web::{get, web, App, HttpResponse, HttpServer};
6 | use mime_guess::from_path;
7 | use rust_embed::RustEmbed;
8 |
9 | #[actix_web::main]
10 | async fn main() -> std::io::Result<()> {
11 | let args: Vec<_> = std::env::args_os().collect();
12 |
13 | let mut port = "9000";
14 | if args.len() > 1 {
15 | port = args[1].to_str().unwrap();
16 | }
17 |
18 | return start_local_server(port).await;
19 | }
20 |
21 | async fn start_local_server(port: &str) -> std::io::Result<()> {
22 | let url = format!("http://127.0.0.1:{}", port);
23 | println!("start server: {}", url);
24 |
25 | open_url(&url);
26 | return start(port).await;
27 | }
28 |
29 | pub async fn start(port: &str) -> std::io::Result<()> {
30 | return HttpServer::new(move || {
31 | App::new()
32 | .service(web::resource("/").route(web::get().to(index)))
33 | .service(data)
34 | .service(web::resource("/{_:.*}").route(web::get().to(dist)))
35 | })
36 | .bind(format!("127.0.0.1:{}", port))?
37 | .run()
38 | .await;
39 | }
40 |
41 | #[get("/output.json")]
42 | pub fn data() -> HttpResponse {
43 | let content = fs::read_to_string("output.json").unwrap();
44 |
45 | return HttpResponse::Ok()
46 | .content_type("application/json")
47 | .body(content.into_bytes());
48 | }
49 |
50 | pub fn open_url(url: &str) {
51 | if let Err(err) = webbrowser::open(url) {
52 | println!("failure to open in browser: {}", err);
53 | }
54 | }
55 |
56 | #[derive(RustEmbed)]
57 | #[folder = "static/"]
58 | struct Asset;
59 |
60 | fn handle_embedded_file(path: &str) -> HttpResponse {
61 | match Asset::get(path) {
62 | Some(content) => {
63 | let body: Body = match content.data {
64 | Cow::Borrowed(bytes) => bytes.into(),
65 | Cow::Owned(bytes) => bytes.into(),
66 | };
67 | HttpResponse::Ok()
68 | .content_type(from_path(path).first_or_octet_stream().as_ref())
69 | .body(body)
70 | }
71 | None => HttpResponse::NotFound().body("404 Not Found"),
72 | }
73 | }
74 |
75 | pub fn index() -> HttpResponse {
76 | handle_embedded_file("index.html")
77 | }
78 |
79 | pub fn dist(path: web::Path) -> HttpResponse {
80 | handle_embedded_file(&path.0)
81 | }
82 |
--------------------------------------------------------------------------------
/_fixtures/ctags/source/TypeName.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013-2019 The Project Lombok Authors.
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | * THE SOFTWARE.
21 | */
22 | package lombok.core.configuration;
23 |
24 | import lombok.core.JavaIdentifiers;
25 |
26 | public final class TypeName implements ConfigurationValueType {
27 | private final String name;
28 |
29 | private TypeName(String name) {
30 | this.name = name;
31 | }
32 |
33 | public static TypeName valueOf(String name) {
34 | if (name == null || name.trim().isEmpty()) return null;
35 |
36 | String trimmedName = name.trim();
37 | for (String identifier : trimmedName.split("\\.")) {
38 | if (!JavaIdentifiers.isValidJavaIdentifier(identifier)) throw new IllegalArgumentException("Invalid type name " + trimmedName + " (part " + identifier + ")");
39 | }
40 | return new TypeName(trimmedName);
41 | }
42 |
43 | public static String description() {
44 | return "type-name";
45 | }
46 |
47 | public static String exampleValue() {
48 | return "";
49 | }
50 |
51 | @Override public boolean equals(Object obj) {
52 | if (!(obj instanceof TypeName)) return false;
53 | return name.equals(((TypeName) obj).name);
54 | }
55 |
56 | @Override public int hashCode() {
57 | return name.hashCode();
58 | }
59 |
60 | @Override public String toString() {
61 | return name;
62 | }
63 |
64 | public String getName() {
65 | return name;
66 | }
67 |
68 | public char[] getCharArray() {
69 | return name.toCharArray();
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/_fixtures/ctags/go_tags:
--------------------------------------------------------------------------------
1 | !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2 | !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3 | !_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
4 | !_TAG_OUTPUT_FILESEP slash /slash or backslash/
5 | !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
6 | !_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/
7 | !_TAG_PROC_CWD /Users/fdhuang/consultant/devops/coco/ //
8 | !_TAG_PROGRAM_AUTHOR Universal Ctags Team //
9 | !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
10 | !_TAG_PROGRAM_URL https://ctags.io/ /official site/
11 | !_TAG_PROGRAM_VERSION 5.9.0 /d532b5c/
12 | InitDatastore pkg/datastore.go /^func InitDatastore() {$/;" func line:37 language:Go package:pkg
13 | access pkg/datastore.go /^ name, access, datatype string$/;" member line:19 language:Go struct:pkg.memberinfo_st typeref:typename:string
14 | access pkg/datastore.go /^ name, access, returntype string$/;" member line:23 language:Go struct:pkg.methodinfo_st typeref:typename:string
15 | classinfo_st pkg/datastore.go /^type classinfo_st struct {$/;" struct line:26 language:Go package:pkg
16 | classmap pkg/datastore.go /^var classmap map[string]classinfo_st$/;" var line:34 language:Go package:pkg typeref:typename:map[string]classinfo_st
17 | datatype pkg/datastore.go /^ name, access, datatype string$/;" member line:19 language:Go struct:pkg.memberinfo_st typeref:typename:string
18 | id pkg/datastore.go /^ id int$/;" member line:28 language:Go struct:pkg.classinfo_st typeref:typename:int
19 | idcounter pkg/datastore.go /^var idcounter int = 1$/;" var line:35 language:Go package:pkg typeref:typename:int
20 | memberinfo_st pkg/datastore.go /^type memberinfo_st struct {$/;" struct line:18 language:Go package:pkg
21 | members pkg/datastore.go /^ members []memberinfo_st$/;" member line:30 language:Go struct:pkg.classinfo_st typeref:typename:[]memberinfo_st
22 | methodinfo_st pkg/datastore.go /^type methodinfo_st struct {$/;" struct line:22 language:Go package:pkg
23 | methods pkg/datastore.go /^ methods []methodinfo_st$/;" member line:31 language:Go struct:pkg.classinfo_st typeref:typename:[]methodinfo_st
24 | name pkg/datastore.go /^ name string$/;" member line:27 language:Go struct:pkg.classinfo_st typeref:typename:string
25 | name pkg/datastore.go /^ name, access, datatype string$/;" member line:19 language:Go struct:pkg.memberinfo_st typeref:typename:string
26 | name pkg/datastore.go /^ name, access, returntype string$/;" member line:23 language:Go struct:pkg.methodinfo_st typeref:typename:string
27 | parents pkg/datastore.go /^ parents []string$/;" member line:29 language:Go struct:pkg.classinfo_st typeref:typename:[]string
28 | pkg pkg/datastore.go /^package pkg$/;" package line:16 language:Go
29 | returntype pkg/datastore.go /^ name, access, returntype string$/;" member line:23 language:Go struct:pkg.methodinfo_st typeref:typename:string
30 |
--------------------------------------------------------------------------------
/_fixtures/ctags/coco_class_tags:
--------------------------------------------------------------------------------
1 | !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2 | !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3 | !_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
4 | !_TAG_OUTPUT_FILESEP slash /slash or backslash/
5 | !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
6 | !_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/
7 | !_TAG_PROC_CWD coco/ //
8 | !_TAG_PROGRAM_AUTHOR Universal Ctags Team //
9 | !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
10 | !_TAG_PROGRAM_URL https://ctags.io/ /official site/
11 | !_TAG_PROGRAM_VERSION 5.9.0 /d532b5c/
12 | ClassInfo src/coco_struct.rs /^impl ClassInfo {$/;" implementation line:48 language:Rust
13 | ClassInfo src/coco_struct.rs /^pub struct ClassInfo {$/;" struct line:38 language:Rust
14 | MemberInfo src/coco_struct.rs /^impl MemberInfo {$/;" implementation line:10 language:Rust
15 | MemberInfo src/coco_struct.rs /^pub struct MemberInfo {$/;" struct line:4 language:Rust
16 | MethodInfo src/coco_struct.rs /^impl MethodInfo {$/;" implementation line:27 language:Rust
17 | MethodInfo src/coco_struct.rs /^pub struct MethodInfo {$/;" struct line:21 language:Rust
18 | access src/coco_struct.rs /^ pub access: String,$/;" field line:23 language:Rust struct:MethodInfo
19 | access src/coco_struct.rs /^ pub access: String,$/;" field line:6 language:Rust struct:MemberInfo
20 | data_type src/coco_struct.rs /^ pub data_type: String,$/;" field line:7 language:Rust struct:MemberInfo
21 | file src/coco_struct.rs /^ pub file: String,$/;" field line:41 language:Rust struct:ClassInfo
22 | id src/coco_struct.rs /^ pub id: i32,$/;" field line:40 language:Rust struct:ClassInfo
23 | lang src/coco_struct.rs /^ pub lang: String,$/;" field line:42 language:Rust struct:ClassInfo
24 | members src/coco_struct.rs /^ pub members: Vec,$/;" field line:44 language:Rust struct:ClassInfo
25 | methods src/coco_struct.rs /^ pub methods: Vec,$/;" field line:45 language:Rust struct:ClassInfo
26 | name src/coco_struct.rs /^ pub name: String,$/;" field line:22 language:Rust struct:MethodInfo
27 | name src/coco_struct.rs /^ pub name: String,$/;" field line:39 language:Rust struct:ClassInfo
28 | name src/coco_struct.rs /^ pub name: String,$/;" field line:5 language:Rust struct:MemberInfo
29 | new src/coco_struct.rs /^ pub fn new(class_name: &str) -> Self {$/;" method line:49 language:Rust implementation:ClassInfo
30 | new src/coco_struct.rs /^ pub fn new(name: &str, access: &str, data_type: String) -> Self {$/;" method line:11 language:Rust implementation:MemberInfo
31 | new src/coco_struct.rs /^ pub fn new(name: &str, access: &str, data_type: String) -> Self {$/;" method line:28 language:Rust implementation:MethodInfo
32 | parents src/coco_struct.rs /^ pub parents: Vec,$/;" field line:43 language:Rust struct:ClassInfo
33 | return_type src/coco_struct.rs /^ pub return_type: String,$/;" field line:24 language:Rust struct:MethodInfo
34 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Publish
2 |
3 | on:
4 | push:
5 | tags:
6 | - '*'
7 |
8 | jobs:
9 | build_windows:
10 | name: Build Windows
11 | runs-on: windows-latest
12 |
13 | steps:
14 | - uses: actions/checkout@v2
15 |
16 | - uses: actions-rs/toolchain@v1
17 | with:
18 | profile: minimal
19 | toolchain: stable
20 |
21 | - name: Build
22 | run: cargo build --release
23 |
24 | - name: Upload modeling to release
25 | uses: svenstaro/upload-release-action@v1-release
26 | with:
27 | repo_token: ${{ secrets.GITHUB_TOKEN }}
28 | file: target/release/modeling.exe
29 | asset_name: modeling-windows.exe
30 | tag: ${{ github.ref }}
31 |
32 | - name: Upload visualing to release
33 | uses: svenstaro/upload-release-action@v1-release
34 | with:
35 | repo_token: ${{ secrets.GITHUB_TOKEN }}
36 | file: target/release/visualing.exe
37 | asset_name: visualing-windows.exe
38 | tag: ${{ github.ref }}
39 |
40 | build_ubuntu:
41 | name: Build Ubuntu
42 | runs-on: ubuntu-latest
43 |
44 | steps:
45 | - uses: actions/checkout@v2
46 |
47 | - uses: actions-rs/toolchain@v1
48 | with:
49 | profile: minimal
50 | toolchain: stable
51 |
52 | - name: Build
53 | run: cargo build --release
54 |
55 | - name: Upload modeling to release
56 | uses: svenstaro/upload-release-action@v1-release
57 | with:
58 | repo_token: ${{ secrets.GITHUB_TOKEN }}
59 | file: target/release/modeling
60 | asset_name: modeling_linux
61 | tag: ${{ github.ref }}
62 |
63 | - name: Upload visualing to release
64 | uses: svenstaro/upload-release-action@v1-release
65 | with:
66 | repo_token: ${{ secrets.GITHUB_TOKEN }}
67 | file: target/release/visualing
68 | asset_name: visualing_linux
69 | tag: ${{ github.ref }}
70 |
71 | build_macos:
72 | name: Build macOS
73 | runs-on: macos-latest
74 |
75 | steps:
76 | - uses: actions/checkout@v2
77 |
78 | - uses: actions-rs/toolchain@v1
79 | with:
80 | profile: minimal
81 | toolchain: stable
82 |
83 | - name: Build
84 | run: cargo build --release
85 |
86 | - name: Upload modeling to release
87 | uses: svenstaro/upload-release-action@v1-release
88 | with:
89 | repo_token: ${{ secrets.GITHUB_TOKEN }}
90 | file: target/release/modeling
91 | asset_name: modeling_macos
92 | tag: ${{ github.ref }}
93 |
94 | - name: Upload visualing to release
95 | uses: svenstaro/upload-release-action@v1-release
96 | with:
97 | repo_token: ${{ secrets.GITHUB_TOKEN }}
98 | file: target/release/visualing
99 | asset_name: visualing_macos
100 | tag: ${{ github.ref }}
101 |
--------------------------------------------------------------------------------
/_fixtures/ctags/source/field.cpp:
--------------------------------------------------------------------------------
1 | // based on https://stackoverflow.com/questions/38217459/accessing-list-of-fields-and-types-in-a-class-in-c
2 | #include
3 | #include