[atom] types for grammar-registry.js based off of incorrect docs
#56297
Replies: 2 comments 1 reply
-
|
Thanks for the discussion about "atom", some useful links for everyone: Pinging the DT module owners: @GlenCFL, @smhxx, @lierdakil, @aminya. |
Beta Was this translation helpful? Give feedback.
-
|
The concession we made while maintaining the types is that anything not in the docs is "private". Sometimes we include these "private" fields anyway, but there's no reasonable way to track those really from version to version, so we generally try to avoid those. So anyway, yes, the docs are considered the primary source of truth. Regrettable that those have drifted. Would you like to make a pull request? I'd still prefer to maintain the "undocumented=private" rule where possible, so please avoid adding too many new undocumented methods. If not, I'll try to get to it sometime, but I've been pretty busy lately, not sure when I'll be able to get to it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The docs for
GrammarRegistrypoint to https://github.com/atom/first-mate/blob/v7.4.1/src/grammar-registry.coffee instead of https://github.com/atom/atom/blob/v1.40.0/src/grammar-registry.js(Issue in docs repo: atom/flight-manual.atom.io#736)
(Types: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/atom/src/grammar-registry.d.ts)
(Code: https://github.com/atom/atom/blob/v1.40.0/src/grammar-registry.js)
Unfortunately, the types for Atom seem to be based on what the docs say instead of what the code says (understandable).
Breakdown of methods / type changes
Unaffected methods
There's a lot of methods in common
I didn't check the parameters
In the types but not in the code
onDidRemoveGrammarIn the types, and in the code, but not documented (see note):
In the code but not in the types
note
Often methods have documentation-comments in the code, before the function, like:
But many methods also don't have documentation. I think the online documentation depends on the code documentation, so by default they're not included (since the types were made from docs).
Beta Was this translation helpful? Give feedback.
All reactions