Skip to content

Add README#1

Merged
look merged 13 commits intomainfrom
look/code-nav
May 23, 2024
Merged

Add README#1
look merged 13 commits intomainfrom
look/code-nav

Conversation

@look
Copy link
Copy Markdown
Member

@look look commented May 21, 2024

Copy link
Copy Markdown

@computermode computermode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow this is awesome, thank you Luke for taking the time to make these thoughtful additions to our docs 🙇🏻 I have a question and a suggestion but they're both minor. Thank you!

Comment thread README.md Outdated
Public documentation about GitHub's code navigation system
# GitHub code navigation

GitHub code navigation helps you to read, navigate, and understand code by showing and linking definitions of a named entity (like a class or method) corresponding to a reference to that entity, as well as references corresponding to an entity's definition. GitHub has developed two code navigation approaches:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Is an entity in this context the same as a symbol? We refer to classes/methods as symbols in our other public documentation such as Navigating code on GitHub and I'm wondering if we'd want to keep that consistent here or if there's a specific reason to call it an entity instead.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this language from the first paragraph of Navigating code on GitHub, but I like "symbol" as a word to use here, it makes more sense to me than entity or "programming language construct" as I used below.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's funny that the same document has both terms used seemingly interchangeably 😆 I also prefer symbol over entity

Comment thread README.md Outdated
Copy link
Copy Markdown
Contributor

@hendrikvanantwerpen hendrikvanantwerpen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of being more explicit about this process and the write up as well! I left a few questions and suggestions on the text.

One high-level question I have is whether you envision this repo just as a means to document the process and interact with the community, or whether we also put artifacts here? More conretely, we could move tree-sitter-parsers here, plus custom query files if we accept those.

Comment thread README.md Outdated
Comment thread README.md
Comment thread README.md
Additionally, references to function or method calls can be extracted as `@reference.call`.

Not all programming languages support all of these constructs. The tag queries should contain only those that make sense for your programming language.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question I wonder if it makes sense to include an example here already. Since we're also describing the FQN queries in detail below, adding an example here would make this more self-contained.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. Let me consider possible examples.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't come up with a good way to add an example that didn't seem extremely long. It seems like we'd want to explain the tagged symbols extracted for a few different types of programming languages. Let me know if you have suggestions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I can see that. The fqn section is already quite detailed for being in the top-level README. Perhaps keep it like this, and if we start getting questions because people don't figure out what to do, we can revisit.

Comment thread README.md Outdated
Comment thread README.md

**Note:** It will be easier for us to integrate a parser if it publishes a Rust crate to [crates.io](https://crates.io/).

### Tags query
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question Should we be explicit about our expectation of where these queries (and the FQN queries below) live? Do we require them to be part of the grammar repo, or do we accept custom queries?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, we've always adapted tags queries from the grammar repositories. We've also written our own tags queries, but that is limited because we aren't experts on most languages.

I suppose we could accept a third-party query, but I think it will be much easier to manage if the source of the tags is the same as the parser. Lacking a maintained tags query is a sign that the parser isn't mature enough for us IMHO.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that having the queries in the grammar repo is definitely the ideal state. But I thought we currently have our own query files for some languages in symbol-extraction, mostly because the fqn stuff was internal to us. But perhaps we upstreamed those at some point?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have to modify the queries which makes managing them more difficult. I'm saying we should only accept upstream tags queries from the parser repository to avoid making managing tags queries even harder. 😄

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstreaming the FQN logic to tree-sitter would be a nice way of making those things more relevant for the community, increasing the willingness to accept such queries upstream. The idea was floated a couple of times in the past, but nobody got around to it.

Copy link
Copy Markdown
Member Author

@look look left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reviews!

Comment thread README.md Outdated
Public documentation about GitHub's code navigation system
# GitHub code navigation

GitHub code navigation helps you to read, navigate, and understand code by showing and linking definitions of a named entity (like a class or method) corresponding to a reference to that entity, as well as references corresponding to an entity's definition. GitHub has developed two code navigation approaches:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this language from the first paragraph of Navigating code on GitHub, but I like "symbol" as a word to use here, it makes more sense to me than entity or "programming language construct" as I used below.

Comment thread README.md

**Note:** It will be easier for us to integrate a parser if it publishes a Rust crate to [crates.io](https://crates.io/).

### Tags query
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, we've always adapted tags queries from the grammar repositories. We've also written our own tags queries, but that is limited because we aren't experts on most languages.

I suppose we could accept a third-party query, but I think it will be much easier to manage if the source of the tags is the same as the parser. Lacking a maintained tags query is a sign that the parser isn't mature enough for us IMHO.

Comment thread README.md
Additionally, references to function or method calls can be extracted as `@reference.call`.

Not all programming languages support all of these constructs. The tag queries should contain only those that make sense for your programming language.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. Let me consider possible examples.

@look
Copy link
Copy Markdown
Member Author

look commented May 22, 2024

One high-level question I have is whether you envision this repo just as a means to document the process and interact with the community, or whether we also put artifacts here? More conretely, we could move tree-sitter-parsers here, plus custom query files if we accept those.

I discussed with @dcreager how this repo could evolve. We decided initially that it should be just this documentation, but perhaps in the future it could include the tagging queries or the canonical parser versions we use.

@look look merged commit bfda8a7 into main May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants