Outermost function when using $ operator isn't parsed as a function
See original GitHub issueWhen I have multiple functions chained together using the $ operator, the outermost function doesn’t get highlighted as a function.
The problem
Here is my code:
exactMatches :: Code -> Code -> Int
exactMatches actualPegs guessPegs =
length $ filter foundMatch $ zip actualPegs guessPegs where
foundMatch :: (Peg, Peg) -> Bool
foundMatch (actual, guess) = actual == guess
Here is what it looks like with the onedark.nvim colorscheme in neovim:
The outermost function,
length
, is not highlighted the same color as the functions filter
and zip
.
So, I suspect that tree-sitter isn’t parsing it as a function.
Expected behavior
I expected length
to be highlighted the same color as other functions.
When I use parentheses instead, length
is highlighted correctly.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Arrow function expressions - JavaScript - MDN Web Docs
Although the arrow in an arrow function is not an operator, arrow functions have special parsing rules that interact differently with ...
Read more >Identify outermost call to recursive parser - Stack Overflow
When the top level is parsed, there is no higher level to set it to "not the outermost", so it remains at "I...
Read more >XPath and XQuery Functions and Operators 3.1 - W3C
These functions and operators are defined for use in [XML Path Language (XPath) 3.1] and [XQuery 3.1: An XML Query Language] and [XSL ......
Read more >Rest parameters and spread syntax
A function can be called with any number of arguments, no matter how it is defined. Like here: function ...
Read more >Functions, operators, and conditionals in Google Standard SQL
Removes the outermost quotes and unescapes the values. ... not comply with RFC 3986 formatting, this function makes a best effort to parse...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I guess it would make sense to synchronize the queries from nivim-treesitter…go ahead if you like!
yep!