-
Notifications
You must be signed in to change notification settings - Fork 24
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
Provide information about original source formatting #93
Comments
Just to give an update on this story. I am actively working on implementation and will have it available as different branch/version soon. Apparently, token approach greatly simplifies some flows layered over last few of years. There will be some breaking changes, not much, but major version would have to be bumped for compatibility safety. |
Hey @syavorsky! |
@brettz9 @renatho yeah, sorry, it took forever. But seems like I finally put something together. Drifted away a bit from original idea as implementing, but mostly it is what was discussed above Would appreciate if you give it a try. Please see the 1.0 branch. I have updated the README and added examples. Also, a bunch of unit tests added, so you can refer those too. |
@renatho I took a pick on alignment, didn't mean to undermine what you are already doing, just wanted to understand if the new stringifier can be used for the purpose. Would be happy to take in a PR with improvements, I believe you put more thoughts into the problem and would suggest some tweaks |
This is great to see moving forward. Maybe a simple migration doc could help? I see |
@brettz9 added some notes to put more light on this. I hope to make it better by having interactive examples page on github.io |
@brettz9 let me know what cases you have in mind that can't be handled with 1.0 API
I want to keep API compact but sufficient, and rather provide recipes for all possible customization on top |
Awesome! Thank you for work on that @syavorsky! I did some tests and it's great. I'm just wondering about some different tags, like the /**
* Description may go
* over few lines followed by @tags
* @param {string} name the name parameter
* @param {any} value the value parameter
* @return {string} Lorem ipsum dolor sit amet
*/ It's parsing the "Lorem" as the
Totally! Probably we can parse and compare with the comment being validated. If it's not equal is because it's wrong. And if it's wrong we can also use it as the fixer. 😊 And a prettier plugin can also be created using this.
And out of curiosity. @brettz9, could these items that you commented to be a barrier to update it in the |
Yes, we need them all for |
Please, for code locations use the Babel AST structure, e.g. {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 6
}
} Having the same format as the Babel AST is useful; it's not only familiar, but you can also pass location data straight into I really need a way to get this start and end line and column information from Like with the Babel AST (or most AST's), all the JSDoc parts ( |
Also, it would be nice to be able to pass a start location line and column to |
@jaydenseric I see your point about aligning with Babel AST, that makes sense indeed. However, I would rather bundle a mapper function allowing you to convert one to another. And start line parameter is already in |
Step in the right direction, although it's not documented yet and a start column is also necessary. Comments can come from somewhere indented or with code to the left. I need the features I described earlier right now for features coming to the next major |
@jaydenseric column information should also be available through the mapper. 1.0 is being worked on, it does better job on describing the input source, hopefully that would fit better with what you are building. I am trying to finish documentation and usage examples. |
|
Supplying meta about white spaces would address #92, #79, and #51.
As per discussion in #92, following spec has emerged
The text was updated successfully, but these errors were encountered: