doctree icon indicating copy to clipboard operation
doctree copied to clipboard

Language support tracking issue

Open slimsag opened this issue 2 years ago • 5 comments

This is a tracking issue for language support in doctree. If you'd like to request support for a language, or have started working on an indexer for a language, feel free to drop a comment on this issue!


Language support table

language functions types methods consts/vars search usage examples code intel
Go
Python
Zig partial
JavaScript
TypeScript
Java
Markdown n/a n/a n/a n/a n/a

Who is working on language support?

Special thanks to these fine folks who are working on language support:

  • @slimsag (Go, Zig, Markdown)
  • @joshuabezaleel (Java, Go)
  • @KShivendu (Python)
  • @DalvikDave (JavaScript)
  • @beyang (TypeScript)

Request support for a language

Feel free to leave a comment below so we know which language to target next!

Help add support for more languages

If you'd like to contribute an indexer, it's not too complex, all you need is experience coding in Go. Drop a comment in this issue so folks know you're working on support for a language, and join the Discord server so you can ask questions, get help, etc.

Right now, things are a little rough since the project is only a few weeks old! You might be better off waiting a few more weeks before diving in, as things will stabilize a lot more by then.

Here's how it all works:

The goal of an indexer is to analyze code for a specific programming language using tree-sitter queries, and produce documentation pages for all the libraries found in a directory of code in the doctree schema format.

The best indexer to take a look at as a reference is the Go indexer which produces documentation for Go code, but be sure to read the read the schema first to get an idea of what data it is trying to produce. Also check out the indexer.Language interface which describes the common interface all indexers implement.

Feel free to join the Discord server if you have any questions or want help, always happy to help people who want to learn!

slimsag avatar May 03 '22 21:05 slimsag

Hi @slimsag ! I'm interested in trying for writing the indexer for methods for Go but I haven't got any experience with tree-sitter, would that be okay? Do you have any recommendations on resources to read to work on this?

Also I think we can tick the const/vars block off the Go one since I saw you implemented it yesterday when I was pulling the latest main branch just now 😄

joshuabezaleel avatar May 24 '22 15:05 joshuabezaleel

@joshuabezaleel Cool, that'd be really great!

The syntax of tree-sitter queries is documented here: https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax

It's very helpful to run a simple query like (source_file) @file, and then print captures["file"] - it will explain all the nodes in an entire Go source file for you and then it's easier to write the relevant query.

Let me know if I can answer any questions etc. in the Discord, too, I'm usually pretty active

slimsag avatar May 25 '22 05:05 slimsag

Oh, also, it's useful to search the grammar.json file for the language too. In this case, Go, and we'd want to look at querying this node

slimsag avatar May 25 '22 05:05 slimsag

Hey Team, I would like to add language support for js.

DaivikDave avatar May 28 '22 05:05 DaivikDave

@DaivikDave awesome! I wrote down your name in the issue just now :) let me know if I can help at all in the Discord

slimsag avatar May 28 '22 17:05 slimsag