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

Add Power Query (.pq) language support #4191

Closed
wants to merge 1 commit into from

Conversation

mattmasson
Copy link

@mattmasson mattmasson commented Jul 9, 2018

Adds Power Query language support (.pq and .pqm)

Description

The Power Query / M formula language is a DSL for the Power Query Editor experience in Microsoft's Power BI, Excel, and SQL Server Analysis Services, and other products. This change adds highlighting support for .pq and .pqm files.

The PQ language was previously submitted in August 2017 (#3802) and not accepted (Pending Popularity). At the time the search results came back with ~75 URLs; we now have over 700.

Checklist:

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

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

Looks like .pqm is still not popular enough so can’t be included in this PR. .pq might just be (I’ll check later) however you’re going to need to add a heuristic as this extension is not unique to PowerQuery as demonstrated by your complex search.

@pchaigno
Copy link
Contributor

Looks like .pqm is still not popular enough so can’t be included in this PR.

👍

need to add a heuristic as this extension is not unique to PowerQuery as demonstrated by your complex search.

It could be sufficient to add Makefile.pq as a filename entry. Though I'm not sure those are exactly Makefile files (syntax seems a bit different?).

@mattmasson Also, any idea what these files are?

@lildude
Copy link
Member

lildude commented Jul 10, 2018

Looks like .pq isn't quite popular enough yet either:

Total files found: 648
Unique public user/repos: 137
Unique owners: 103

@mattmasson
Copy link
Author

Yes, Makefile.pq seems to be common name for a specific kind of makefile. There also seems to be some .pq files that are gnuplot oriented.

Here is a better search that pulls in both .pqm and .pq files. Power Query code will always contain either "section" or "let" statements.

https://github.com/search?p=52&q=extension%3Apq+extension%3Apqm+-filename%3AMakefile.pq+section+OR+let&type=Code

@lildude, what is the minimum counts we should have before resubmitting?

@pchaigno, what else can I change in linguist to make sure the Makefile.pq and gnuplot files aren't misclassified?

@lildude
Copy link
Member

lildude commented Jul 10, 2018

@lildude, what is the minimum counts we should have before resubmitting?

We don't have a specific count beyond "In most cases we prefer that extensions be in use in hundreds of repositories before supporting them in Linguist." as stated in the CONTRIBUTING.md.

Technically speaking, "hundreds" would signal at least 200, else it'll only be "hundred" 😉, though that's probably still on the low side as it's barely into the "hundreds" range. It also depends on how well spread out across users this is; 1000 unique repos for 2 users is not widespread usage.

The biggest limitation to us specifying precise figures is there's no easy way for peeps to quantify usage as this isn't exposed within the search results and querying the API to gain this info hits rate and abuse limits. I'm hoping that when code search comes to GraphQL, we can write an app or script to query the results without hitting rate limiting thus getting us out of this situation.

@pchaigno
Copy link
Contributor

pchaigno commented Aug 4, 2018

Closing in favor of #4219. We'll monitor the popularity of the extensions there.

If you have improved search queries compared to those I used in #4219, please post them here and I'll update #4219.

@pchaigno pchaigno closed this Aug 4, 2018
@pchaigno
Copy link
Contributor

The .pq file extension is now popular enough for inclusion (see #4219). @mattmasson Do you want me to reopen this pull request or would you prefer to resubmit as a new pull request?

@wanderleihuttel
Copy link

Hello Guys
Please include this pull request to sintax highlight for Power Query M.

@jimbrig
Copy link

jimbrig commented Dec 29, 2022

any plans to add language references for *.pq or *.m extensions?

@lildude
Copy link
Member

lildude commented Jan 1, 2023

any plans to add language references for *.pq or *.m extensions?

There are never any plans to add a language as contributions are entirely community driven. Submit a PR and we're likely to add support for that language or extensions provided the extensions meet the minimum usage requirements.

@jimbrig
Copy link

jimbrig commented Jan 6, 2023

thanks @lildude - I will have to decide if its worth the time and effort or not then I guess!

@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants