Giter Club home page Giter Club logo

Comments (10)

garborg avatar garborg commented on August 18, 2024

Hmmm... without getting into naming conventions, I don't see a good way around -- I added this type identification, but I'm for just removing it for now.

from atom-language-julia.

MikeInnes avatar MikeInnes commented on August 18, 2024

Since typed array calls (empty or not) are actually just getindex calls anyway there's no way to separate the two cases. Arguably, since Functions, Types and Modules are really just types of run-time value, trying to guess their presence from syntax is a non-starter – like trying to guess whether x is an Int from syntax alone.

I don't think it would be so bad to just highlight identifiers beginning with a capital letter as types. Yes, that technically means people can highlight their integer as a type by defining Foo = 1, but IMO the (very minimal) consequences of doing that are on them.

from atom-language-julia.

garborg avatar garborg commented on August 18, 2024

But what about differentiating between MyType and MY_INDEXABLE_CONST? It's impossible to assign acronyms or single-letter names to one bin or the other with certainty.

from atom-language-julia.

MikeInnes avatar MikeInnes commented on August 18, 2024

Types and consts could just have the same non-default colouring. After all they are both a type of constant :)

It's basically consistent that identifiers with capitals mean "slightly unusual / notable kind of variable". Really we'd be overloading the type.julia scope to refer to that, and actual Julia types are a subset. Conceptually, it is at least consistent.

I'm not adamant about it or anything, but for the reasons above I think the only alternative is to avoid differentiating between normal vars and types altogether. Having some differentiation seems better than none at all, even if "notable kind of variable" is a relatively broad category (including types, modules, consts etc).

from atom-language-julia.

facundoq avatar facundoq commented on August 18, 2024

I think differentiating using a regexp on the convention that types are PascalCase and variables_use_underscores_and_lowercase would work in 99% of my Julia code.

from atom-language-julia.

jianghaizhu avatar jianghaizhu commented on August 18, 2024

The array indexing highlighted as Type really confused me in my code. Is there any plan to fix this bug? or any workaround at the moment?

from atom-language-julia.

jianghaizhu avatar jianghaizhu commented on August 18, 2024

Also in the following code

convert(Array{T}, r)

shouldn't Array{T} be treated as Type?

from atom-language-julia.

JeffBezanson avatar JeffBezanson commented on August 18, 2024

I'll put in a vote for not applying coloring unless it is actually correct.

from atom-language-julia.

pfitzseb avatar pfitzseb commented on August 18, 2024

Yeah, we just should not color types since it's impossible to tell what they are from syntax alone (and maybe optionally color words in camel case as types).

from atom-language-julia.

sglyon avatar sglyon commented on August 18, 2024

I agree with what is said here. If anyone has the time to implement this I will happily review a PR, I don't think I'll be able to do it myself.

from atom-language-julia.

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.