Skip to content

Conversation

@Janther
Copy link
Contributor

@Janther Janther commented Nov 3, 2024

Aware this might be an overkill but the possible issue is really difficult to solve with other means (see tests).

I have a different approach to get rid of the strip-comments dependencies if this gets rejected.

@Janther Janther requested a review from fvictorio November 3, 2024 09:26
parser: 'slangPragma'
};

const query = Query.parse(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed you moved query out of the tryToCollectPragmas function, but you only use it there; should we move it back to its original location?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this way the query is computed only once and not every time it tryToCollectPragmas is called

Copy link
Member

@mattiaerre mattiaerre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@Janther Janther force-pushed the prettier-for-pragma-version branch from f2b6050 to a167be2 Compare November 13, 2024 04:42
@fvictorio
Copy link
Member

I think I'd rather not support very weird pragma versions, like the one in the new test, and rather check that we throw a decent error when that happens (throw "couldn't parse version pragma in file " and crash).

@Janther
Copy link
Contributor Author

Janther commented Nov 15, 2024

I made a new PR I had prepared if this one was too ambitious and complicated maintenance

@Janther Janther closed this Nov 15, 2024
@Janther Janther deleted the prettier-for-pragma-version branch June 3, 2025 07:28
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

Successfully merging this pull request may close these issues.

4 participants