diff --git a/queries/haskell/highlights.scm b/queries/haskell/highlights.scm index bf9692136..1fea39b08 100644 --- a/queries/haskell/highlights.scm +++ b/queries/haskell/highlights.scm @@ -173,6 +173,7 @@ (exp_name [(constructor) (variable) + (qualified_variable) ])) (quasiquote) ((exp_name) . (operator)) @@ -186,6 +187,7 @@ (exp_name [(constructor) (variable) + (qualified_variable) ])) (quasiquote) ((exp_name) . (operator)) @@ -293,6 +295,12 @@ ]) (#any-of? @_op "." ">>>" "***" ">=>" "<=<" )) +; function defined in terms of a function composition +(function + name: (variable) @function + rhs: (exp_infix (_) . (operator) @_op . (_) + (#any-of? @_op "." ">>>" "***" ">=>" "<=<"))) + (exp_apply (exp_name [ ((variable) @function.call) @@ -325,7 +333,7 @@ . (variable) @variable . [ (exp_record) - (exp_name (variable)) + (exp_name [(variable) (qualified_variable)]) (exp_list) (exp_tuple) (exp_cond) diff --git a/tests/query/highlights/haskell/test.hs b/tests/query/highlights/haskell/test.hs index cd5db435e..bf7e939a0 100644 --- a/tests/query/highlights/haskell/test.hs +++ b/tests/query/highlights/haskell/test.hs @@ -171,6 +171,8 @@ someIOaction = do gunc x y = func x $ y + 7 -- ^ @variable -- ^ @variable + valueFromList = HashSet.fromList [] + -- ^ @variable when foo $ putStrLn $ T.showt =<< bar -- ^ @function.call -- ^ @variable @@ -325,3 +327,6 @@ lambdaAlias _ _ _ = undefined spec :: Spec spec = describe "test ns" $ it "test case" pending -- ^ @variable + +composed = f . g +-- ^ @function