Skip to content

Specify indent #16

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

Closed
wooorm opened this issue Aug 23, 2018 · 3 comments
Closed

Specify indent #16

wooorm opened this issue Aug 23, 2018 · 3 comments
Labels
🙅 no/wontfix This is not (enough of) an issue for this project

Comments

@wooorm
Copy link
Member

wooorm commented Aug 23, 2018

node.position.indent isn’t used a lot, but it could be specced better.

Currently, it’s a list of integers, if a node spans multiple lines, where each value refers to the column a line (node.position.start.line + index).
This only supports the start of a line (which is useful in markdown). But not the end of a line.
It’s also awkward to access, as there’s no explicit line access.

It could make sense for indent to be an Array.<{start: Point, end: Point}>.

@wooorm wooorm added 🧑 semver/major This is a change 🙉 open/needs-info This needs some more info low priority labels Aug 23, 2018
@wooorm wooorm added 🙅 no/wontfix This is not (enough of) an issue for this project and removed 🧑 semver/major This is a change 🙉 open/needs-info This needs some more info labels Oct 13, 2020
@wooorm
Copy link
Member Author

wooorm commented Oct 13, 2020

No longer needed: remark no longer includes ’em

@wooorm wooorm closed this as completed Oct 13, 2020
@unicornware
Copy link

unicornware commented Oct 28, 2022

@wooorm

for those implementing their own ast, can this be revisited? or can the README be updated to include an example? before finding this issue, i thought indent was (node.position.start.line + node.position.start.column)[]. now i'm not sure if index refers to the index of a new line 😅

@wooorm
Copy link
Member Author

wooorm commented Oct 28, 2022

Hm I think it should be removed from the spec instead now that it isn’t used anymore.
You probably shouldn’t need/implement it?

indent is useful for things that span multiple lines, and start at different “columns”. Which can occur in markdown.

So say something spans 3 lines, then position.start is the starting point.
indent[0] is the column of line 2, indent[1] the column of line 3.
I’m not sure if the columns were relative or absolute anymore though, would have to check that.

Problem was, that it should probably be points instead of columns. And why only starts of lines and not ends? 🤷‍♂️

wooorm added a commit that referenced this issue Feb 4, 2023
This isn’t used anywhere anymore.
If someone else wants it, it’s better to put into `data`.

Related-to: GH-16.
@wooorm wooorm mentioned this issue Feb 4, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙅 no/wontfix This is not (enough of) an issue for this project
Development

No branches or pull requests

2 participants