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

[Python] Add syntax support for sphinx-style doc comments #3839

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

FichteFoll
Copy link
Collaborator

Sphinx (the most common Python documentation tool) uses #: comments to signal documentation comments for its "autodoc" module.

There is no known overlap with other comment punctuation, so this should be a safe addition.

TM_COMMENT_START_2 is also added to be able to undo the comment using toggle_comment, but unfortunately it does not work like this currently because Default/comment.py does not prioritize the longest prefix match of all available comment styles.

https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-autoattribute

Discovered via sublimehq/sublime_text#5587 (comment)

Sphinx (the most common Python documentation tool) uses `#:` comments to
signal documentation comments for its "autodoc" module.

There is no known overlap with other comment punctuation, so this should
be a safe addition.

`TM_COMMENT_START_2` is also added to be able to undo the comment using
`toggle_comment`, but unfortunately it does not work like this
currently because `Default/comment.py` does not prioritize the longest
prefix match of all available comment styles but we don't want this
style to be the default.

https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-autoattribute
@FichteFoll FichteFoll force-pushed the pr/python/sphinx-doc-comment branch from 246d1e1 to bbc745c Compare September 14, 2023 18:27
@deathaxe deathaxe merged commit 2aeae5d into sublimehq:master Sep 15, 2023
@FichteFoll FichteFoll deleted the pr/python/sphinx-doc-comment branch September 15, 2023 17:43
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