Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not identify python docstring? #80

Closed
celsofranssa opened this issue Sep 1, 2020 · 3 comments
Closed

Could not identify python docstring? #80

celsofranssa opened this issue Sep 1, 2020 · 3 comments
Labels

Comments

@celsofranssa
Copy link

Using the following code snippet in Syntax Tree Playground

def get_vid_from_url(url):
        """
        Extracts video ID from URL.
        """
        return match(url, r'youtu\.be/([^?/]+)')

the resulting tree fails to identify Extracts video ID from URL. as docstring.

@patrickt patrickt transferred this issue from tree-sitter/tree-sitter Sep 8, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.90. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the bug label Sep 8, 2020
@tree-sitter tree-sitter deleted a comment from issue-label-bot bot Sep 8, 2020
@patrickt
Copy link
Contributor

patrickt commented Sep 8, 2020

We don’t currently give the docstring a field name. I’m not sure whether this would be worth doing, as it is perhaps the job of the query API.

@maxbrunsfeld
Copy link
Contributor

Yeah, I think this is best handled outside of the parser itself. As far as the parser is concerned, the docstring is just a string. It is a higher layer of logic that identifies the first string in a definition block as "the docstring".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants