Comments (10)
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.
Since typed array calls (empty or not) are actually just getindex
calls anyway there's no way to separate the two cases. Arguably, since Function
s, Type
s and Module
s 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.
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.
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.
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.
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.
Also in the following code
convert(Array{T}, r)
shouldn't Array{T}
be treated as Type?
from atom-language-julia.
I'll put in a vote for not applying coloring unless it is actually correct.
from atom-language-julia.
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.
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)
- `′` breaks variable syntax highlighting
- md"a" syntax breaks highlighting
- Tokenize TODO in comments HOT 3
- Make more specific token for `::` HOT 4
- Weird case of function tokenization when end of line comment includes parentheses HOT 1
- colored documentation syntax as comment HOT 1
- Highlight attributes of a module or constructor HOT 4
- `Markdown.@md_str` breaks syntax highlighting HOT 8
- Incorrect syntax highlighting when splatting a range
- Unicode operators aren't highlighted HOT 1
- Additional keywords HOT 1
- String interpolation with generator is broken HOT 3
- Unicode letters break type name HOT 1
- Command interpolation
- Syntax coloring for doctests
- New `public` keyword not recognized
- Future development after Atom's sunset HOT 1
- Tokenization of commas changed to `source.julia`, which affects Julia Color Themes HOT 8
- Broken REPL syntax highlighting of multi-line inputs
- Highlight prompts in REPL syntax highlighting
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 atom-language-julia.