close
The Wayback Machine - https://web.archive.org/web/20210228030425/https://github.com/github/linguist/discussions/5189
Skip to content
1

Why is Maven POM its own language? #5189

Nixinova asked this question in Q&A
Why is Maven POM its own language? #5189
Feb 6, 2021 · 7 answers

languages.yml lists Maven POM, filename pom.xml, as its own language even though it is entirely XML, as evidenced by its docs:

A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project[...]

Should it be removed from languages.yml?

Replies

1

Should it be removed from languages.yml?

No, because its tm_scope field indicates that it has a dedicated grammar for syntax highlighting:

Maven POM:
type: data
tm_scope: text.xml.pom

SVG and XML Property List are two important examples of XML-based formats that benefit from having specialised grammars: the SVG grammar highlights embedded JavaScript and CSS, for example, while XML property lists benefit from error highlighting due to their highly-specific and rigid structures.

That being said, I don't know how much of an improvement the Maven POM grammar (text.xml.pom) is over the normal XML grammar (text.xml). If the difference is negligible or noticeably worse, then yes, Maven POM should be rolled into XML.

3 replies
@Nixinova

At a glance the syntax highlighting seems identical and pom.xml doesn't seem to have any unique features.

@Nixinova

Although, comparing the files, XML is 573 lines while Maven POM is 1226 lines so there must be something different, though the POM tmLanguage does seem to be 12 years old.

@Nixinova

Should they be merged?

1

Either way, it should still be grouped under XML, as it is currently its own language.

2 replies
@Alhadis

I concur. This oversight probably fell through the cracks when Maven POM was originally added, as the pairing wouldn't have made a difference on XML's (lack of) influence on repository classification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
2 participants
Beta