diff --git a/src/python_module.h b/src/python_module.h index b48e6ea..7e64d45 100644 --- a/src/python_module.h +++ b/src/python_module.h @@ -2,9 +2,11 @@ #include "cmake.h" #include "compile_commands.h" #include "config.h" +#include "ctags.h" #include "python_bind.h" #include "terminal.h" #include +#include #include namespace pybind11 { @@ -197,6 +199,33 @@ class Module { ; } + static void init_compile_ctags_module(pybind11::module &api) { + py::class_ ctags(api, "Ctags"); + py::class_(api, "Ctags") + .def_readwrite("file_path", &Ctags::Location::file_path) + .def_readwrite("line", &Ctags::Location::line) + .def_readwrite("index", &Ctags::Location::index) + .def_readwrite("symbol", &Ctags::Location::symbol) + .def_readwrite("scope", &Ctags::Location::scope) + .def_readwrite("source", &Ctags::Location::source) + .def("__bool__", &Ctags::Location::operator bool) + + ; + + ctags + .def_static("get_result", &Ctags::get_result, + py::arg("path")) + .def_static("get_location", &Ctags::get_location, + py::arg("line"), + py::arg("markup")) + .def_static("get_locations", &Ctags::get_locations, + py::arg("path"), + py::arg("name"), + py::arg("type")) + + ; + } + public: static auto init_jucipp_module() { auto api = py::module("Jucipp", "API");