Hi there,
I have a custom file type and I am trying to either write a syntax or a plugin so that I can do things like jump to references/definitions. The filetype contains definitions of named paragraphs, and those paragraphs contain references to the names of other paragraphs.
For example:
* Hello world: This is a paragraph.
* Goodbye world: This is a paragraph that references [[Hello world]].
Paragraphs can be grouped using asterisks, and groups create a local namespace that affects the interpretation of link target, eg:
* Hello world: This is a paragraph that contains a reference to [[local paragraph]].
Local parargaph: This is a local paragraph in the namespace of “Hello world”
Lastly, there is dynamic syntax for writing links, so eg:
* Hello world: This is a paragraph that contains a link to [[the paragraph {{goodbye world}}]], and the double curly braces signify that the target is “goodbye world” and not the full display string “the paragraph goodbye world”.
* Goodbye world: This is a paragraph that references [[Hello world|with a custom display text]].
So, I’d like to have 1) jump to definition, 2) jump to references, 3) symbol search, and ideally 4) completions for link names. However, this filetype has references which require dynamic analysis to resolve. So, I’m wondering if there is a way of writing a plugin in Python that accesses the Sublime syntax features like references and definitions, or whether I should just do everything manually, eg parsing the file, populating the quick panel, moving the cursor, etc.
Thanks for your help!