Open Vgrunert opened 6 years ago
I agree, it would be nice if the function names following a pipe operator got tokenized as support.function
:
Hi , is it something to change only here or is it much more difficult?
The file you linked to is some kind of test file or specification file. The grammar lives in this file. The Julia grammar is a TextMate Grammar. Learning how to write TextMate grammars is a rather deep rabbit-hole to go down...
I see it is quite a rabbit-hole, It is never easy unfortunately, Thanks you for the good links by the way.
After reading for a bit (I still don't understand anything). I guess we need some kind of "Positive Lookbehind" in this line.
Something like (?<=|>) with the pipe operator inside but with blank space after it.
Still we need to be sure that there is no use case where we can pipe |>
to something else than a function cause my naive way to implement will consider every "word" after |>
to be a function.I can see now there is many others things to consider.
Anyway I clearly don't understand what I am talking about.
I was thinking that the function's names where available somehow (after defining it and running it at least one time) to the text editor and that we could do something simpler to recognize it.
I was thinking that the function's names where available somehow (after defining it and running it at least one time) to the text editor and that we could do something simpler to recognize it.
There is a chance that someday we will have semantic highlighting (see here), which uses tokens provided by the Julia Language Server. However, the language server tokens (which would be generated by CSTParser.jl) would still be based only on a lexical analysis of the source code. So even CSTParser.jl doesn't actually evaluate any of your code (or at least I don't think it does), and the language server and the linter are not tracking the code that you run in the REPL.
Hi,
I am using the "|>" symbol heavily in my coding, unfortunately neither the symbol itself nor the function that follows it is highlighted which makes reading the code a bit more difficult.
Generally the syntax of using the "|>" symbol is as following:
"variable |> function". This is equal to "function( variable )", only expressed differently. It would be really nice if these were colour coded as other function, with a separate colour for the "|>" symbol.
Unfortunately I am not familiar with coding of the colours for the text editor, so I am a bit overwhelmed when looking at the file in the package folder.
Nevertheless, it would be a useful thing tho have.