Comments (8)
yep!
from tree-sitter-haskell.
I guess it would make sense to synchronize the queries from nivim-treesitter…go ahead if you like!
from tree-sitter-haskell.
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.
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.
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.
@tek This has been fixed in the nvim-treesitter repo, should I open a PR to merge the changes here?
from tree-sitter-haskell.
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.
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)
- Combining characters in identifiers are not parsed correctly HOT 1
- Include . from qualified modules and variables HOT 6
- Segfault on large files (in Neovim) HOT 1
- Upgrade node-gyp dependency HOT 2
- Components parser as type when they are not HOT 1
- Include ! from strictness annotations
- exp_section_right not parsed when containing a hash HOT 3
- Incorrect parse for function with where-clause and comments HOT 4
- Can't npm install tree-sitter-haskell on Mac M3 Node.js v20.10? HOT 1
- infixr and infixl not respected HOT 4
- Crashing (possibly while editing markdown) HOT 7
- Comments following function included in function pattern HOT 6
- Update to latest tree-sitter version
- Instance with associated type, following TH top level splice, misparsed as function HOT 2
- Misparse of explicit-braced code
- UnicodeSyntax support HOT 10
- "undefined symbol: tree_sitter_haskell_external_scanner_create" when running "tree-sitter test" HOT 7
- Support `OverloadedRecordDot` HOT 8
- I added three more symbols for built-in syntax.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tree-sitter-haskell.