-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to disable highlighting of base functions #70
Comments
Hi, thanks for opening an issue! This is a good question, and I don't know how to best deal with it. Most other language syntax highlighters will have the exact same problem. You could maybe have a look at some other languages and see how they deal with this. On the other hand, is it a good idea to shadow globally-predefined variables? A common annoyance in python is that I think this should be discussed further. Ideally getting more input from other users. |
I've discovered that what controls the highlighting is lines 493-494:
Commenting these out suffices to disable the highlighting for variable names.
It seems to me that unlike other languages Julia's design makes the use of highly generic names in the global namespace inevitable. Fortunately, Julia's scoping rules make their use as variable names possible, and you can find examples of uses of such variable names in base Julia itself. Not to mention that this highlights a fixed set of identifiers, rather than doing any sort of semantic analysis, so it's going to hit exactly the names in Base only, rather than the actual set of global identifiers (and perhaps you're using a |
Good point, and one can always access the variable as I do not see how we can make this into an option. Do you think we should simply remove those two lines? |
Yes, that sounds like a good idea to me. |
Ok. However, I won't make a commit immediately: I'll keep this open some days to give the others a chance to comment. |
As far as I understand, the lines that you quote are not directly responsible for highlighting, but just define the syntax. The actual highlighting is done by the color scheme. A better solution is to create/edit a color scheme that does not highlight |
Hi @albertas-jn , thank you — that does sound like a potentially better approach. I'm still new to Sublime internals, however, and don't quite understand which color scheme you are referring to here. It seems the file you mean would be a Julia-specific color scheme referencing Julia-specific scopes, which I don't see inside the Julia package internals. Where do you suggest I look? |
Color schemes are different from specific language support packages, like Julia-sublime. Color schemes are usually written to be used with different languages.To choose a color scheme go to Preferences -> Color Scheme. To modify your current color scheme, first locate it in the Installed Packages directory. It is probably a zipped archive. Extract a .tmTheme file, rename it, and put it in Packages/User directory. Choose your new color scheme via Preferences ->Color Scheme. Now you can edit the file, and you will see the changes immediately. Find the scopes More info here: |
That is a good point. Still, one could argue that this package should not the scope I have no strong opinion in this question. |
Hello! I've been enjoying this package for some time and have a question — is it at all possible to disable the syntactic highlighting of Julia Base functions?
I often have e.g. a local variable inside a function named
start
, which maddeningly gets colored and italicised just because it happens to use a word also used as a function name in Base.I see there is a list of functions in
Julia.sublime-syntax
:base_module_func: (?<!\.)(?:BLAS\.(?:asum|axpby!|axpy!|blascopy!|...
but I'm not sure how best to deal with either disabling it for myself or adding an option to disable highlighting to the package, or whether there's a better option available.The text was updated successfully, but these errors were encountered: