Skip to content

[DISCUSSION] For consistency sake, what should our documenting standard be like? #42

@DrKJeff16

Description

@DrKJeff16

Description

I am concerned about how we will do our field descriptions, so I'd like every maintainer / collaborator that's interested
to join in on this discussion (@craigmac && @TheLeoP , I'm pinging you (sorry) if you have any feedback).

My Suggested Standard

THIS IS NOT THE LAW.
I DON'T WANT TO ENFORCE MY PERSONAL STANDARDS, I'M SIMPLY EXPLAINING HOW I'VE
DONE IT SO FAR


---@ comments should go with three dashes, while any other description should go with only two dashes

Find and Replace operations (:%s, Vim users will get it) might benefit from this by differentiating and avoiding mistakes.

Also it makes description comments much easier to spot for manual searching.

No inline ---@field descriptions

This is because LuaLS supports Markdown comments1.
Having inline comments not only makes the comments harder to navigate through,
it also limits what we can write (say, lists/tables/sections/etc.)

-- I disagree with the following:
---@class Foo
---@field bar? fun(...:any) This does bar

-- Instead
---@class Bar
-- This does `foo`
---@field foo? fun(...: any)
In descriptions, any identifier, type and/or value should be enclosed like in Markdown

This is because it lets users spot important info much faster when hovering.

  • leader_key, 1.0, "FOO" - Not suggested
  • leader_key, 1.0, "FOO" - Suggested

Hover_Example


Footnotes

  1. Annotation Formatting

Metadata

Metadata

Labels

questionFurther information is requestedsolvedIssue is solved (or at least marked as solved)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions