Comments (18)
Please give me until tomorrow to check this. Thank you for the report.
from sublimeethereum.
Of course, again let me know if there is any additional information I can provide.
from sublimeethereum.
I think the problem is more complex that I'm currently capable of tackling... probably, not sure yet...
What I planned to do for a long time and I still think it's rather easily doable (again, maybe with some help from community... would be welcome, of course) is this:
- rewrite the code here (basically all there is for this project) into the new format described here:
http://www.sublimetext.com/docs/3/syntax.html
Main point:
Sublime Text can use both .sublime-syntax and .tmLanguage files for syntax highlighting. This document describes .sublime-syntax files.
Basically .tmLanguage
is the old way with regular expresions that is already showing cracks (as you can see with some open issues). .sublime-syntax
works with stacks and contexts.
So quick question for you:
can you point me to some resources in understanding how exactly Linguist works for this case?
Would rewrite help here "automatically" or if not, then at least is it a good next step?
I won't be able to do anything on this project until rewrite (whenever that is, I hope soon, I started working on it "today"), will push some code on separate branch in a few days... EXCEPT I can do really small tweaks if I come to understand why pragma breaks when doing your Linguist magic...
As you can see here, it doesn't have anything to do with the sublime syntax definition itself (except as I say because it's the old way of doing things and Linguist would work better with new stack based syntax?):
from sublimeethereum.
@alexvandesande could also probably join the conversation?
from sublimeethereum.
I'm confused because the original Adoption.sol
contract I showed you now has proper syntax highlighting in Github even with the ^
before the solidity version:
However, this contract, Migrations.sol
, doesn't have syntax highlighting and the reason is because it doesn't have the two blank lines before the contract definition:
Before adding an extra line:
After adding an extra line:
Any thoughts? I see that nothing has changed in Master for this repository
from sublimeethereum.
Hi @spacesailor24 -- a few more days and we can observe if it fixes the issue and if not, investigate from there... see here for progress report: #24
from sublimeethereum.
new syntax parser has been published, now we wait for github linguist to pick it up
from sublimeethereum.
Something was broken with the latest changes:
The source file on the screen: https://github.com/poanetwork/poa-network-consensus-contracts/blob/master/contracts/BallotsStorage.sol
from sublimeethereum.
Thank you, fixed... 704eefa
from sublimeethereum.
Thanks. Also, something strange with colors - they were changed, I think. For example, on the screen the validatorSetContract
variable has different colors (I didn't change anything in settings):
The corresponding file: https://github.com/poanetwork/pos-contracts/blob/master/contracts/BlockRewardAuRa.sol
from sublimeethereum.
Hi, yes indeed some rather minor color changes do happen with new syntax parsing. All hopefully for the better.
I will examine this particular case later today and explain what happened and if I think it’s a good idea or if it needs discussion or it’s a bug.
from sublimeethereum.
@varasev I pushed the updates, some colors are back as before and there are additional fixes. Thank you very much for these reports, please write back if anything is still broken.
from sublimeethereum.
@spacesailor24 as for the original reported issue, I now identified one contract example here that is not properly identified by Linguist. And here is one that is properly highlighted.
GitHub hasn't yet updated their submodule reference to the latest version of SublimeEthereum
but before they do that, I'll try to test locally and see if the new .sublime-syntax is even supported etc. So, soon we know a bit more and thank you again for the report.
from sublimeethereum.
@davidhq Thank you for fixing, it seems to be fine now, but I still see a few minor color inconsistencies:
In the same file: https://github.com/poanetwork/pos-contracts/blob/master/contracts/BlockRewardAuRa.sol
from sublimeethereum.
In which IDE do you get such colors? I get this locally in my SublimeText:
So here it seems ok, please check again why difference at your side.
Also try some other theme and see if your theme brings in these inconsistencies.. I still probably can do something to fix this but we have to know where it comes from actually.
from sublimeethereum.
I use Sublime Text 3.0, build 3170
with packages Ethereum v1.1.3
and ColorSublime v2.1.0
. The color scheme on my above screen is Dawn
.
If I try to switch to some of default color schemes, I get the same issue. For example (Mariana
color scheme):
from sublimeethereum.
I think now in v1.1.5
it's fixed... btw a tip for any further problem detection → you can use :
While editing in Sublime Text, you can check what scopes have been applied to the text under the caret by pressing control+shift+p (OSX) or ctrl+alt+shift+p (Windows and Linux).
I used that to see that I used different scopes for two things you were showing and none of my themes were so exact as to apply some other styling to variable.language
scope... I now removed this scope from syntax highlighting.
from sublimeethereum.
Thank you, it's ok now.
from sublimeethereum.
Related Issues (20)
- Blocks inside a function break syntax highlighting HOT 2
- Wrong highlighting on anonymous function arguments with location HOT 3
- Any plan to make one for Atom? HOT 4
- Add support for Solidity 0.6 features HOT 17
- Solidity 0.6 top-level structs HOT 6
- Solidity 0.6 custom type + immutable HOT 1
- Add support for do...while loops HOT 5
- Incompatibility with different strings specifiers HOT 4
- Package Cotrol installation issue HOT 1
- add EtherumSoliditySnippets package in sublime4,but doesn't work HOT 1
- Syntax-color does not work in helper HOT 1
- How To Install without error's HOT 7
- Modifier in constructor doesn't work and breaks other highlightings HOT 4
- calldata keyword doesn't get highlighted in a variable declaration HOT 2
- A constant as the array size in a function declaration breaks highlighting of following elements HOT 3
- Add natspec support HOT 2
- Package Not In List for Sublime 4 MacOS HOT 1
- Quotes are not escaped inside of strings HOT 3
- some words show not correctly in version 1.3.8 HOT 1
- Quotes inside strings cause incorrect string termination HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sublimeethereum.