Giter Club home page Giter Club logo

Comments (18)

davidhq avatar davidhq commented on June 15, 2024

Please give me until tomorrow to check this. Thank you for the report.

from sublimeethereum.

spacesailor24 avatar spacesailor24 commented on June 15, 2024

Of course, again let me know if there is any additional information I can provide.

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

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?):

screen shot 2018-12-29 at 22 56 31

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

@alexvandesande could also probably join the conversation?

from sublimeethereum.

spacesailor24 avatar spacesailor24 commented on June 15, 2024

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:

Adoption.sol

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:

Migrations.sol Before

After adding an extra line:

Migrations.sol After

Any thoughts? I see that nothing has changed in Master for this repository

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

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.

davidhq avatar davidhq commented on June 15, 2024

new syntax parser has been published, now we wait for github linguist to pick it up

from sublimeethereum.

varasev avatar varasev commented on June 15, 2024

Something was broken with the latest changes:

image

The source file on the screen: https://github.com/poanetwork/poa-network-consensus-contracts/blob/master/contracts/BallotsStorage.sol

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

Thank you, fixed... 704eefa

from sublimeethereum.

varasev avatar varasev commented on June 15, 2024

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):

image

The corresponding file: https://github.com/poanetwork/pos-contracts/blob/master/contracts/BlockRewardAuRa.sol

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

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.

davidhq avatar davidhq commented on June 15, 2024

@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.

davidhq avatar davidhq commented on June 15, 2024

@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.

varasev avatar varasev commented on June 15, 2024

@davidhq Thank you for fixing, it seems to be fine now, but I still see a few minor color inconsistencies:

image

In the same file: https://github.com/poanetwork/pos-contracts/blob/master/contracts/BlockRewardAuRa.sol

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

In which IDE do you get such colors? I get this locally in my SublimeText:

screen shot 2019-01-20 at 13 37 56

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.

varasev avatar varasev commented on June 15, 2024

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):

image

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

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.

varasev avatar varasev commented on June 15, 2024

Thank you, it's ok now.

from sublimeethereum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.