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

Add getPosition() function to Reader #654

Closed
bingkh opened this issue Nov 30, 2020 · 1 comment
Closed

Add getPosition() function to Reader #654

bingkh opened this issue Nov 30, 2020 · 1 comment

Comments

@bingkh
Copy link
Contributor

bingkh commented Nov 30, 2020

Hi,

Description
As a user of ion-js, I would love to be able to get position information from ionReader, so that when using ionReader to read a ion file, I can know which position I'm currently at.

Application scenario
Our team uses ion to define a format, e.g. paragraph P uses certain format style S, and the definition of style S is out side of the paragraph itself. see blow:

style::{
  name:S,
  font:Arial,
  .....
}
....
....
paragraph::{
  name:A,
  style:S,
  .....
}

I'm working on a vs code extension: ion-style-peek, so that in the above ion file, when users are viewing paragraph A and call go to definition on S, the editor will jump to style S. Similar implementation can be found: https://github.com/pranaygp/vscode-css-peek

To implement the above, we need to get the position when parsing style container in the ion, hence the requesting issue.

Pull request:
#655

Thanks!

Ethan

@bingkh bingkh changed the title Add getPosition() function to ionReader Add getPosition() function to Reader Nov 30, 2020
@zslayton
Copy link
Contributor

Added in #657.

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

No branches or pull requests

2 participants