Highlighting issue with macros #1

Closed
opened 2022-04-23 22:13:15 +02:00 by acheroncrypto · 2 comments
acheroncrypto commented 2022-04-23 22:13:15 +02:00 (Migrated from github.com)

Using a keyword inside an attribute macro results in corrupted highlighting and unwanted indentation on next line.

Example:
image

Quotes are able to stop the highlighting issue but indentation on next line persists.
image

Example code

Using a keyword inside an attribute macro results in corrupted highlighting and unwanted indentation on next line. Example: ![image](https://user-images.githubusercontent.com/98934430/164944416-1181419a-a9ce-4b82-8f05-c37fed09236e.png) Quotes are able to stop the highlighting issue but indentation on next line persists. ![image](https://user-images.githubusercontent.com/98934430/164944461-a71b3a8a-ed36-494a-b1de-603c8eaed165.png) [Example code](https://github.com/project-serum/anchor/blob/master/examples/tutorial/basic-2/programs/basic-2/src/lib.rs#L34)
marijnh commented 2022-04-25 09:22:57 +02:00 (Migrated from github.com)

It would have made figuring out what you mean a lot easier if you had presented valid rust code, instead of a bunch of code that is invalid in ways that have nothing to do with what you mean here.

But I guess what you wanted to say is that something like #[foo(mut)] should be valid. Attached patch fixes that.

It would have made figuring out what you mean a lot easier if you had presented valid rust code, instead of a bunch of code that is invalid in ways that have nothing to do with what you mean here. But I guess what you wanted to say is that something like `#[foo(mut)]` should be valid. Attached patch fixes that.
acheroncrypto commented 2022-04-26 00:55:07 +02:00 (Migrated from github.com)

Thank you but I had already attached a valid code at the end. #[foo(mut)] was actually not causing any issues. The issue started when there is a comma after the mut like in the example I've sent #[account(mut, has_one = authority)].

Don't know if the issue is fixed as the package is not yet updated but thank you.

Thank you but I had already attached a valid code at the end. `#[foo(mut)]` was actually not causing any issues. The issue started when there is a comma after the `mut` like in the example I've sent `#[account(mut, has_one = authority)]`. Don't know if the issue is fixed as the package is not yet updated but thank you.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lezer/rust#1
No description provided.