-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 solidity language #3973
Add solidity language #3973
Conversation
they're not used by the bayesian classifier
`Color #383838 is too close to ["3F3F3F", "383838"]`
@pchaigno can you review it, please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I do, however have several points:
- You've not provided a description for this PR. Please do so, but read the rest of these points first as you can address some of them in your description.
- This PR appears to be a duplicate of Add the Solidity language without an associated extension (updated) #3755 which you've commented on. Why the duplication and not the continuation of that PR?
- Proposal: use and recommend .solidity file extension (for syntax highlighting on github) ethereum/solidity#2681 hasn't been merged. Has the proposal been accepted by the upstream project? If so, please provide a link to the search results showing the adoption on GitHub.
- Please re-state the original source and licenses of the sample files included in this PR. Yes, this is stated in the original PR, but if you're intending for this PR to replace that one, we'd like the source and license of the sample files noted in the PR adding them as it's not clearly stated within the files themselves.
- The two
.solidity
files need to be moved tosamples
. The previous suggestion of moving them totest/fixtures
was because that PR was attempting to add support for Solidity without an extension. This PR is providing support with an extension so normal locations apply. - We prefer samples of real in-the-wild usage of the language.
pygments-example.solidity
is clearly only designed for the syntax highlighting and not the language. Linguist doesn't do the actual syntax highlighting, so this file doesn't really belong in this repo. Please remove it, and ideally, though not necessary, add another example of real-world usage. - On the topic of syntax highlighting... you've not added a syntax highlighting grammar. Looks like https://github.com/caktux/language-ethereum may do the trick, so you may want to add that as part of this PR so peeps get language recognition and pretty colours.
Note that this PR (#3973) is the 7th in the Solidity series. PR #3755 is the 6th. PR #3560 was the 5th, and has a reference for earlier ones.
No, it hasn't been accepted, neither by the team maintaining the compiler, nor the community at large. (As a social-first approach to issue resolution, it may never come to fruition; and that is fine.)
|
Thanks for your answer @lildude
@veox already answered many of your questions and I think the syntax highlighter is already here |
I added a comment to ask one of the solidity members to approve it here |
@oktapodia The sample you've included is from ethereum/solidity, which falls under GPLv3 AFAIK. May I suggest something from OpenZeppelin/zeppelin-solidity, which is under an MIT license?.. |
@veox sure, send me the link of the example you prefer and I will add it :) |
Ah, I missed that as it isn't currently referenced in the |
@oktapodia You have previously included a (The file does not have a license header, so you'll need to include a statement in the OP.) |
@veox Done |
@oktapodia It would be nice if you addressed @lildude's points in the PR summary. Adding something like:
Link helper: |
@oktapodia The blob links I've suggested are for the latest current |
The two most pressing issues from your list - lack of license statement for the sample file, and missing reference to existing PR - have been addressed in the PR summary. The rest have been addressed in comments. |
Perfect! Thanks. I really appreciate your work. I prefer to give my final sign off once one of the non-GitHub maintainers has reviewed and given their approval. |
Thanks @veox for your help! |
Oooof, yes. I released Linguist v7.2.0 this morning which included an update to all grammars including SublimeEthereum which is used for Solidity highlighting, but now I look at it, I can see the problem: The grammar has switched from a TextMate compatible grammar to a Sublime Text compatible grammar - Linguist does not support This wasn't picked up when I built the release because unsupported formats are silently ignored as many grammars include both Sublime and TextMate compatible grammars. |
The last tagged release of Ping @davidhq: see comment above:
Provided @davidhq can create that branch, and push/reset it to Alternatively, the file could be re-added on |
I've just double-checked and it's not actually failing silently... it's just lost in the other noise caused by the many known grammar issues as documented in #3924 which we ignore. Running it again, I've just spotted:
Looking through that output, no other grammars are reporting this that are not already known, so I don't think anything else has slipped past. |
Hi, I couldn't figure out if Linguist supports .sublime-syntax or not and indeed I removed .tmLanguage and was waiting for a report like this one :/ sorry about that... we can solve as you suggest - both options... what would be the best? I'd rather not add it back to master because of possible confusion... you suggested branch "linguist" in SublimeEthereum repo, I created it: https://github.com/davidhq/SublimeEthereum/tree/linguist ... does this remedy the issue for now? |
of course .tmLanguage was removed because of rewrite... also wasn't sure if all versions of SublimeText would pick up the correct syntax if both were included... let me know if for now I can help with anything else |
PS: davidhq/SublimeEthereum#29 ← any tips here would be welcome |
@lildude Should we do a quick release to fix this? |
I'll try squeeze it in sometime this week. |
@lildude .sol still broken |
Still haven't had time to make a new release 😉 |
I'm hoping you can get it in soon, since it's making reading Solidity code difficult across all projects in the Ethereum ecosystem. |
GitHub's Solidity highlighting is currently broken site-wide, but will probably be fixed soon. Tracking issue: github-linguist/linguist#3973 (comment) Because of the site-wide issue, this won't work right away, but hopefully will make our repo ready for highlighting when the issue is fixed.
I noticed both PRs were merged 🎉 but syntax highlighting is still broken. Any idea when the changes will take effect? |
@dmdque same as usual... when I make a release 😀. As you've seen, I've been working on a few improvements this week related to the grammar compiler so unexpected upstream changes outside of the control of Linguist are less likely to slip through the net in future. I'm not quite finished, but when I am, I'll make a release. My aim is for next week. |
I would say this is great ;) In fact I expected this to already be the case and that it wouldn't be possible to break syntax for anything over entire GitHub... 'Resilience' is very important. When it's finished and in particular the solidity syntax is back online, we can perhaps talk some more on how to bring separate project branch linguist will be using more up to date with latest version which is improving every day - one that uses stack based |
Syntax highlighting on contracts would make it easier to browse contract code in github. See: github-linguist/linguist#3973
Syntax highlighting on contracts would make it easier to browse contract code in github. See: github-linguist/linguist#3973
Syntax highlighting on contracts would make it easier to browse contract code in github. See: github-linguist/linguist#3973
GitHub's Solidity highlighting is currently broken site-wide, but will probably be fixed soon. Tracking issue: github-linguist/linguist#3973 (comment) Because of the site-wide issue, this won't work right away, but hopefully will make our repo ready for highlighting when the issue is fixed.
The main reason there's still no Solidity syntax highlighting on GitHub is that the
.sol
extension is too generic.Then, following this thread, having the extension
.solidity
for now and use the.gitattributes
file to set manually the.sol
extension on our side is the easiest way for nowCurrent public usage is over 400k hits, see here and here
Solidity is actively developed, used to manage the ethereum smart contract and it has been published by Ethereum.
Closes #3755 as superceded. PR #3755 fails CI due to a color proximity warning.
The sample file comes from OpenZeppelin and is licensed under the MIT license. The file has been edited to reflect the fact.