Comments (12)
Thanks! However, something is not right... Are you not using the latest version?
- Variables works fine
- Function declaration works fine
- Function calls; currently all function calls have
support.function
see the comment https://github.com/JuliaEditorSupport/Julia-sublime/blob/master/Julia.sublime-syntax#L138.
Furthermore, arguments have no particular scope, I agree this should be fixed.
I'm open for discussion regarding support.function
, I have function calls highlighted for all languages in my color scheme. I'm okay with removing support.function
for all function calls. However, I'd need a list of what functions calls to give the scope support.function
. (Personally I think it is weird to distinguish between some function calls and others, but that's personal opinion and I disregard that. Consistency across languages is important.)
I realize, perhaps you are using an old version of sublime text, from the readme:
Sublime Text 3 Build 3103 or later will use Julia.sublime-syntax which provides superior highlighting. For backward compatibility Julia.tmLanguage acts as fallback.
If you could be a bit more specific, I can implement a fix more easily. Ideally you could write some failing tests in https://github.com/JuliaEditorSupport/Julia-sublime/blob/master/syntax_test_julia.jl.
from julia-sublime.
Stupid me. I forgot to pull the latest commits and it does fix some of the issues.
However, for the regular variables, they should not be matched, even for variable.other
. At least it is how python and r behave. See how the variable a
is colored in the updated screenshot. (My color scheme highlights the scope variable.other
)
Check the updated list above.
from julia-sublime.
I have function calls highlighted for all languages in my color scheme
If you want to the same coloring for both supported functions and general functions, you just need to edit your color scheme and modify the color for the scope variable.function
. However, it will affect all other languages such as python and r.
from julia-sublime.
-
We should really distinguish between setting scopes (determined by this package) and how scopes are highlighted (determined by color schemes). However, it is reasonable to make sure that the default color scheme looks good.
-
Regarding
variable.other
, there is already an inconsistency across default languages here, javascript adds this scope:
The default color schemes does nothing withvariable.other
and I think it is good to add this scope, so that plugins and color schemes can track variables. You probably want to look over your particular color scheme. -
regular function call should be variable.function only and the arguments should be meta.function-call.arguments variable.parameter
Bold part yes, I have fixed this now, in commit cc2b8de, so that only built-in functions have
support.function
and all functions havevariable.function
, function calls havemeta.function-call
and function call arguments havemeta.function-call.arguments
. However, note that not all languages addmeta.function-call.arguments
to function call arguments, JavaScript does not add this scope:
regular function call should be variable.function only and the arguments should be meta.function-call.arguments variable.parameter
Bold part no?
variable.parameter
is for arguments in function declaration only. For example, Python has these scopes
With this I consider all items in your list checked. Do you agree?
from julia-sublime.
I guess we need to be more specific, I meant the variable name but not the value of the variable. Python uses variable.parameter
for the variable name.
foo(x = y)
# ^ variable.parameter
from julia-sublime.
Though you mention that Javascript also uses variable.other
, a lot of Julia users are more familiar to Python then JS. It seems that it makes sense to follow the convention of Python/C/Ruby, etc.
Besides, if one's color scheme highlights variable.other
, the emojis are also highlighted and it is less satifactory.
WIth that said, I respect your any decision on this issue.
from julia-sublime.
I mostly agree, will look into this more, but first, when is variable.other
supposed to be used, if not for plain variables? Why do you highlight variable.other
?
from julia-sublime.
From here, I have gathered the list of usages,
-
Regular variables
- ASP, C#, GO, JavaScript, PHP
-
Special variables
- C++: initialization list
- Lisp: global variables
- Python: placeholder variable
"%s"
- Ruby: constant variable
- YAML
All other syntaxes either do not use variable.other
or those are the syntaxes which I don't have much exposure.
I am using a variation of https://github.com/jonschlinkert/sublime-monokai-extended which highlights variable.other
. Given the popularity of this theme, it is another strong reason for not highlighting variables.
from julia-sublime.
I notice that only functions in Base
module are exported. The functions in Core
module should also be considered.
from julia-sublime.
Thanks for that overview, I was about to change my mind based on this, until I found the official docs, according to which variable.other
is supposed to be used like we do in this package. In light of this, what do you think regarding variable.other
?
I was not aware of this documentation for scopes, perhaps we find more things that should be changed to follow these guidelines.
I agree with you regarding variable.parameter
. This is now fixed in 6a56ed3.
I notice that only functions in Base module are exported. The functions in Core module should also be considered.
This is now fixed in 3ea5262.
from julia-sublime.
Great. I agree that we should keep variable.other
. The solution for me now would be to modify my color scheme. Anyway, thanks for your responsive work!
from julia-sublime.
Sweet. Thanks for your constructive input!
from julia-sublime.
Related Issues (20)
- Syntax hangs HOT 3
- Bug: trying to open julia/base/reducedim.jl fails HOT 3
- Syntax highlighting completely broken on ST4 HOT 16
- Definition / goto is broken for function definitions prefixed with package name HOT 3
- Syntax highlighting bug HOT 1
- Unicode Completion in Search Bar HOT 18
- Unicode expansion for other file types HOT 2
- Can not work in Markdown code block HOT 3
- Scope and syntax highlighting issue in the sequence scope
- Fix order of match blocks for macro rule HOT 4
- Docstrings are treated as regular strings if they are indented HOT 4
- Multi-line Comments HOT 4
- Recognizing keyword argument in f(x; kwd) HOT 11
- Package Control.sublime-package installation - I am lost... HOT 1
- Syntax highlighting for function name starting with `struct` broken
- v 4133 and unicode tab completion HOT 3
- Syntax highlighting inside quote block
- Error loading syntax file
- Correct syntax highlighting for "import Foo as Bar"
- Error loading syntax file "Package/Julia/Julia.sublime-syntax" HOT 8
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 julia-sublime.