Code Monkey home page Code Monkey logo

Comments (8)

tek avatar tek commented on June 12, 2024 1

yep!

from tree-sitter-haskell.

tek avatar tek commented on June 12, 2024 1

I guess it would make sense to synchronize the queries from nivim-treesitter…go ahead if you like!

from tree-sitter-haskell.

tek avatar tek commented on June 12, 2024

looks like this is handled here:
https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/haskell/highlights.scm#L119

which only triggers for application.

you'll have to create an issue in the nvim-treesitter repo!

from tree-sitter-haskell.

tek avatar tek commented on June 12, 2024

just noticed that this file is also present in this repo, but in an older state. so I'd say that the other repo is the reference implementation

from tree-sitter-haskell.

seasonedfish avatar seasonedfish commented on June 12, 2024

just noticed that this file is also present in this repo, but in an older state. so I'd say that the other repo is the reference implementation

Wait, so should I still open an issue in https://github.com/nvim-treesitter/nvim-treesitter?

from tree-sitter-haskell.

seasonedfish avatar seasonedfish commented on June 12, 2024

@tek This has been fixed in the nvim-treesitter repo, should I open a PR to merge the changes here?

from tree-sitter-haskell.

seasonedfish avatar seasonedfish commented on June 12, 2024

Ah wait a second, the file in this repo contains some changes from the one in nvim-treesitter (#40), and it looks like both repos have commits since.

Git diff
diff --git 1/highlights.scm 2/Users/fisher/Repositories/nvim-treesitter/queries/haskell/highlights.scm
index c7bd156..0e43d18 100644
--- 1/highlights.scm
+++ 2/Users/fisher/Repositories/nvim-treesitter/queries/haskell/highlights.scm
@@ -73,10 +73,7 @@
   "@"
 ] @operator
 
-(qualified_module (module) @constructor)
-(qualified_type (module) @namespace)
-(qualified_variable (module) @namespace)
-(import (module) @namespace)
+(module) @namespace
 
 [
   (where)
@@ -107,26 +104,37 @@
 ;; Functions and variables
 
 (variable) @variable
-"_" @variable.special
+(pat_wildcard) @variable
 
 (signature name: (variable) @type)
 (function
   name: (variable) @function
   patterns: (patterns))
+((signature (fun)) . (function (variable) @function))
+((signature (context (fun))) . (function (variable) @function))
+((signature (forall (context (fun)))) . (function (variable) @function))
 
 (exp_infix (variable) @operator)  ; consider infix functions as operators
 
+(exp_infix (exp_name) @function (#set! "priority" 101))
 (exp_apply . (exp_name (variable) @function))
-
-("@" @namespace)  ; "as" pattern operator, e.g. x@Constructor
+(exp_apply . (exp_name (qualified_variable (variable) @function)))
 
 
 ;; ----------------------------------------------------------------------------
 ;; Types
 
 (type) @type
+(type_variable) @type
 
 (constructor) @constructor
 
 ; True or False
 ((constructor) @_bool (#match? @_bool "(True|False)")) @boolean
+
+
+;; ----------------------------------------------------------------------------
+;; Quasi-quotes
+
+(quoter) @function
+; Highlighting of quasiquote_body is handled by injections.scm

I don't feel confident enough in tree-sitter's query syntax to make the merge, could someone else take a look?

from tree-sitter-haskell.

tek avatar tek commented on June 12, 2024

according to the commit message of the last big change for this file, it was copied from nvim-treesitter then as well. so I think you should just complete replace it with the current one from there

from tree-sitter-haskell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.