Git Product home page Git Product logo

Comments (4)

ViktorQvarfordt avatar ViktorQvarfordt commented on May 24, 2024 1

Regarding the colors: A syntax highlighting package only sets scopes, colors are determined from the scope by the color scheme. Type annotations have scope support.type which is blue in the default color scheme, ordinary functions have scope variable.function which is not colorized in the default color scheme.

This package currently breaks convention by setting scope support.function for all function calls, this scope is only intended for built-in functions (such as map, filter, range). This is how it should be done.

I will try to adhere to conventions as much as possible (comparing with built-in languages such as c, python, javascript).

I'm currently rewriting some things that where a mess, a fix for these things will be part of that.

from julia-sublime.

ViktorQvarfordt avatar ViktorQvarfordt commented on May 24, 2024

Indeed, this has been annoying me as well. I already have some local changes for this. However, some things need to be discussed:

(The numbers in what follow refer to the text in the images below.)

  • Color of <:? An inconsistency is made clear in 3. I see no obvious solution. Making the <: red inside a type breaks the flow and looks really confusing.
  • Since types are used a lot, and function calls by default have the same color as types. I'm considering making it so that functions do not get highlighted by the default theme. This is how essentially any other language behaves. Not sure why the choice was made to make functions blue originally.
  • Default color of macros? It is very blue in 5. If functions are no longer blue, should macros still be? I like the idea of giving one color to types exclusively. Macros white, or some other color?

What do you think?

Previous syntax version, default color
old-syntax-orig-color

Suggested new version, default color
new-syntax-orig-color

Suggested new version, using my custom color theme to show difference
new-syntax-alt-color

A file that uses many "edge cases" is (multidimensional.jl)[https://github.com/JuliaLang/julia/blob/master/base/multidimensional.jl#L23]. It does not look too good in the current state. With my current changes line 23 becomes
example

from julia-sublime.

ahwillia avatar ahwillia commented on May 24, 2024

👍 for your custom color scheme. I like orange for macros. Maybe something slightly different than the sea green for function calls? Maybe keep the function calls blue (which is a pleasing color) and make the parametric types sea green (which is slightly less pleasing, but will probably appear less often this way?).

Anyways, I like the underlying logic - so you should go for it once your happy. Also don't forget typealias!

screen shot 2016-08-09 at 11 37 13 am

from julia-sublime.

ViktorQvarfordt avatar ViktorQvarfordt commented on May 24, 2024

Fixed in #21.

from julia-sublime.

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.