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

[FEATURE] - PR to Linguist? (+ Some missing keywords) #135

Open
TheWitheredStriker opened this issue Jul 3, 2023 · 2 comments
Open

[FEATURE] - PR to Linguist? (+ Some missing keywords) #135

TheWitheredStriker opened this issue Jul 3, 2023 · 2 comments

Comments

@TheWitheredStriker
Copy link
Contributor

TheWitheredStriker commented Jul 3, 2023

Hey there! Admittedly, this PR isn't really about the development of the VS Code extension itself, but it's still related to it. I didn't know where else to put it, so I made it a feature request.

I wanted to ask if, perhaps, you could consider suggesting your extension's Pascal grammar for use in Linguist? Linguist is essentially the provider of GitHub's syntax highlighting, and the highlighter they use for Pascal is seriously out of date. It misses several keywords, such as override, strict, raise, read, write, exit, overload, and almost all of the types (true/false, boolean, string etc), which this extension's Pascal grammar all covers. It hasn't been comitted to since 2016 and is abandoned.

Since you own this repo and created the project, I found it most appropriate to ask you about this directly before doing anything else.

If you think this is a good idea, I would like to point out that there some keywords that this highlighter lacks as well, and which you could add. For example, the open-source Pascal game OpenSoldat is much closer to the metal and makes frequent use of stdcall and cdecl (there's also the keyword cppdecl in Free Pascal). It also appears like your grammar does not cover the keyword helper, which the current grammar does account for.

I'm suggesting this because I'm really enthousiastic about Pascal and would love to see the lacking syntax highlighting on GitHub upgraded, so that reading Pascal code will be easier and a bit friendlier to the eye :)

@alefragnani
Copy link
Owner

Hi @TheWitheredStriker ,

It's great to hear you are enjoying Pascal. It was my first professional language (Delphi to be more specific) and used it for a looong time. That's the main reason I created the Pascal extensions for VS Code and Atom back then.

Based on your request, I would split in two separate issues, with different approaches

Improve this Pascal extension

I never heard about OpenSoldat, so it is expected that some keywords from its Pascal flavor are missing.

I would suggest you to open a PR on this repo, adding the missing keywords. Once you open the PR, I could merge it, and you could enjoy fully enjoy OpenSoldat in VS Code.

Contribute to Linguist with an improved language definition

I always wondered which engine was used by GitHub for its syntax highlighting, but also didn't miss any particular Pascal keyword on it. In fact, I was expecting it would be changed (at some point in the future) to use the Microsoft Monaco editor, (which has an improved Pascal syntax - contributed by myself btw 😀 ).

If the TextMate language is not being upgraded, there is no point on opening a PR there. Instead, I suppose the best approach would be to reach the Linguist team what is required to change/redirect a language support to another project/repo. If this is possible, ask them if it could be directed to this repo. If it works, you could open this PR on the Linguist repo. Otherwise, it would depend on how the Linguist team defines as steps to upgrade/replace the language reference. Maybe a new TextMate equivalent structure repo. I did a quick look on their documentation and didn't find any specific info about it

Hope this helps

@TheWitheredStriker
Copy link
Contributor Author

Hi there! Sorry for the really late response! I'll get to that PR in a bit (as well as open a new issue regarding nested records, where something bizarre happens with your highlighting).

I looked around a bit, and found this: https://github.com/github-linguist/linguist/blob/master/CONTRIBUTING.md#changing-the-source-of-a-syntax-highlighting-grammar

It requires a set of Ruby dependencies last time I checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants