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

this.warn and this.error should accept a loc rather than a pos #1265

Closed
Pauan opened this issue Jan 16, 2017 · 2 comments
Closed

this.warn and this.error should accept a loc rather than a pos #1265

Pauan opened this issue Jan 16, 2017 · 2 comments

Comments

@Pauan
Copy link
Contributor

Pauan commented Jan 16, 2017

Plugins can use this.warn and this.error to emit warnings/errors. These functions accept a second pos argument, which must be an integer. This integer is the character index within the code.

My plugin uses recast to parse the source code, which gives me back an AST. This AST contains loc objects, like { line: 0, column: 10 }, but it does not contain the character index.

Therefore, I cannot use the second argument to this.warn or this.error, but I would like to. So I would prefer if I could pass in a { line, column } object instead of a character index.

@fregante
Copy link

This was fixed by #1446, correct?

@Pauan
Copy link
Contributor Author

Pauan commented Jun 21, 2017

@bfred-it Yes, it seems that way, thanks!

@Pauan Pauan closed this as completed Jun 21, 2017
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

3 participants