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 TSQL to linguist #4481

Merged
merged 2 commits into from
May 10, 2019
Merged

Add TSQL to linguist #4481

merged 2 commits into from
May 10, 2019

Conversation

beau-witter
Copy link
Contributor

@beau-witter beau-witter commented Apr 3, 2019

Description

Adding the TSQL language as identifiable through linguist.

Checklist:

  • I am associating a language with a new file extension.

  • I am adding a new language.

  • I am fixing a misclassified language

    • I have included a new sample for the misclassified language:
      • Sample source(s):
        • [URL to each sample source, if applicable]
      • Sample license(s):
    • I have included a change to the heuristics to distinguish my language from others using the same extension.
  • I am changing the source of a syntax highlighting grammar

  • I am updating a grammar submodule

  • I am adding new or changing current functionality

    • I have added or updated the tests for the new or changed functionality.

samples/TSQL/cursor.sql Outdated Show resolved Hide resolved
vendor/README.md Outdated Show resolved Hide resolved
@beau-witter
Copy link
Contributor Author

@lildude Updated the draft PR with some changes, all tests now pass. I think the major issue now is the grammar problem.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Is this something you are looking for?

@beau-witter
Copy link
Contributor Author

@nanoquanta Yes, but I am not sure how to look. Do you know of something that may be able to help?

@acdevick
Copy link

acdevick commented Apr 5, 2019

@nanoquanta Thanks for working on this our company just started using Flyway and moved all of our TSQL to github. I came across this looking for a solution to fix temp tables where github is rendering #tempTable as a commented line vs actual TSQL Code. Would that be able to be fixed as a feature to TSQL?

@beau-witter
Copy link
Contributor Author

@acdevick If we are able to get the right grammar file included as part of adding the TSQL language to Linguist, then yes, that should be rendered correctly assuming the file is correctly detected as TSQL.

@beau-witter
Copy link
Contributor Author

@lildude If I were to make a separate repo to be the TSQL grammar repo, have the scope be source.tsql, and have it setup in such a way that linguist can read/understand the path, would that be ok?

@lildude
Copy link
Member

lildude commented Apr 10, 2019

@beau-witter yeah, I think so. You'd become the maintainer of that grammar going forward and can't delete it as long as Linguist continues to use it.

@Alhadis has more experience with maintaining grammars so should know if simply changing the scope is sufficient for our needs.

@beau-witter
Copy link
Contributor Author

@lildude I added the TSQL grammar repo I created as the grammar for the TSQL language I added to linguist. All the tests appear to pass. Let me know if there is anything else that needs to be done to move forward.

@Alhadis When I added https://github.com/beau-witter/language-tsql as a grammar using script/add-grammar it auto added the scope as source.sql when the tsql.json file I have in the grammars folder specifies the scope to be source.tsql. I changed it manually (observable in the most recent commit). I just want to check if that is ok, and if not, why it happened?

@beau-witter
Copy link
Contributor Author

I am turning this into a real PR as I believe it is ready to be fully reviewed.

@beau-witter beau-witter marked this pull request as ready for review April 16, 2019 15:24
@lildude
Copy link
Member

lildude commented Apr 23, 2019

TIL... Travis doesn't support draft PRs yet so CI wasn't triggered when you flipped this PR to be a real PR. I'm going to see if I can trigger a build by closing and reopening the PR. If I hit problems, I may need you to do it @beau-witter.

@lildude lildude closed this Apr 23, 2019
@lildude lildude reopened this Apr 23, 2019
@lildude
Copy link
Member

lildude commented Apr 23, 2019

🎉 it worked!!!

@lildude lildude mentioned this pull request Apr 23, 2019
18 tasks
@beau-witter beau-witter reopened this Apr 24, 2019
@beau-witter
Copy link
Contributor Author

@lildude Alright! Thanks for Travis CI working! I think I got everything corrected on my side, and Travis seems to agree! Should be good to review now.

@Alhadis
Copy link
Collaborator

Alhadis commented Apr 24, 2019

Hey guys, sorry for the silence. Been out of action for the last couple of weeks. 👋

@Alhadis has more experience with maintaining grammars so should know if simply changing the scope is sufficient for our needs.

Yes, that's fine. A grammar's scope-name is mainly important to Atom (and other TextMate-derived text editors) for styling and syntax-level command scoping; e.g., an author might use source.sql.tsql to maximise compatibility with a user's customisations: a snippet that targets source.sql will also work for source.sql.tsql, but not source.tsql.

However, all of this is moot as far as Linguist is concerned, because a scope only has to be unique (in the sense of acting as a global identifier). I recommend using source.tsql because it's much clearer and obvious to future contributors.

@beau-witter
Copy link
Contributor Author

@Alhadis Thanks for that info! That is really neat. I did end up doing the source.tsql way, so thanks for confirming that way will work!

@beau-witter
Copy link
Contributor Author

@lildude Is there anything else I can do to help this PR move along?

@lildude
Copy link
Member

lildude commented May 7, 2019

Nope. It's up to @pchaigno and/or @Alhadis to review next.

@beau-witter
Copy link
Contributor Author

@lildude I see the changes have been approved. Yay!

Just curious, is there a known update date when this might be merged by?

@lildude lildude merged commit e463868 into github-linguist:master May 10, 2019
@lildude
Copy link
Member

lildude commented May 10, 2019

Just curious, is there a known update date when this might be merged by?

There's never a known date for merging as it's not really important. I merge whenever I get around to reviewing, if I approve, but it won't take effect on GitHub.com until I make a release, which once against doesn't have a known date beyond "I aim for approximately once a month, based on my own load and the GitHub.com deploy queue and locks etc" 😄

@esauser
Copy link

esauser commented May 28, 2019

Any idea when this will be included in GitHub and/or GitHub Enterprise?

@lildude
Copy link
Member

lildude commented May 28, 2019

I'm aiming to do a release this week. If I succeed, this will make it into GitHub Enterprise Server 2.17.1. If I can't get this on GitHub.com this week, it'll be in 2.17.2.

@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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants