Skip to content

Is file extension language detection the only option? #5694

Answered by lildude
jcubic asked this question in Q&A
Discussion options

You must be logged in to vote

Is this library detect langauges only based on extension?

No. It also looks at things like filename and modeline comments too.

If no then is there a way to make it detect the PEG.js grammar if it not have pegjs extension?

Yes, the documentation details how you can implement various different overrides to set the language.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jcubic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants