elm-tooling / tree-sitter-elm

Tree sitter implementation for elm
https://elm-tooling.github.io/tree-sitter-elm/
MIT License
75 stars 14 forks source link

Weird issue on how `line_comment` works #24

Closed GrayJack closed 5 years ago

GrayJack commented 5 years ago

I'm creating a elm atom package using your library and a strange thing happened

I map line_comments as comments in the css class in atom, and this happens

elm_treesitter

Not sure why, since I could not find the source of externals in the source code

razzeee commented 5 years ago

Relevant file is https://github.com/Razzeee/tree-sitter-elm/blob/master/src/scanner.cc

Can you please post the complete example code? I can look at it on monday

GrayJack commented 5 years ago

Sure, you can find it here: https://github.com/GrayJack/language-elm-treesitter/blob/master/grammars/tree-sitter-elm.cson#L32

razzeee commented 5 years ago

https://github.com/Razzeee/tree-sitter-elm/pull/25 should fix this. It might also affect the negate_expr.

GrayJack commented 5 years ago

I think I never saw a negate expression, can you give me a example?

razzeee commented 5 years ago

Well it's at least what we parse it as :)

https://github.com/Razzeee/tree-sitter-elm/blob/7821b8a941badf11cade7496c0acf41e03bfba8a/corpus/basic.txt#L99

GrayJack commented 5 years ago

Seems like it didn't fix, in my repo, I did use the new branch and still nothing

razzeee commented 5 years ago

Did you actually rebuild it, via npm run build? I'm very confident, that the error you mentioned is fixed by this :)

GrayJack commented 5 years ago

Maybe I did forget, will double check as soon as I can, sorry for the trouble

GrayJack commented 5 years ago

Looks like the problem is that apm have to run that, but atom actually expects to be already done. Can you help me out with this? Kinda lost, not very used with JS stuff, how ca I make my atom package run that before installing?

razzeee commented 5 years ago

Should I just publish it on npm? Would that help?

On Tue, Oct 15, 2019, 01:33 Eric Shimizu Karbstein notifications@github.com wrote:

Looks like the problem is that apm have to run that, but atom actually expects to be already done. Can you help me out with this? Kinda lost, not very used with JS stuff, how ca I make my atom package run that before installing?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Razzeee/tree-sitter-elm/issues/24?email_source=notifications&email_token=ABNLEZE45JQA6QMWLYSK5RDQOT6TFA5CNFSM4I74AAK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBG5Y3I#issuecomment-541973613, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNLEZFBM24IY35FZW7I5CTQOT6TFANCNFSM4I74AAKQ .

GrayJack commented 5 years ago

I think it would

razzeee commented 5 years ago

Pushed a new release to npm and new release builds should shortly show up on github. Please let me know if it solved it :)

GrayJack commented 5 years ago

Worked just fine now, thanks!!!