rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 96 forks source link

Feature: introduce variable #639

Open ishmum123 opened 3 years ago

ishmum123 commented 3 years ago

PR for #414 .

Would appreciate any help or collaboration...

rikvdkleij commented 3 years ago

@ishmum123 thanks for your contribution. But we can only implement this proper when the layout is properly parsed. A start is made in the layout lexer branch but still a lot of work. I also have to rebase master on the branch which is also not trivial.

ishmum123 commented 3 years ago

@rikvdkleij if you could list out the steps of lexer, I might be able to help. Also I felt the project currently lacks a proper testing pattern. I am willing to help out

rikvdkleij commented 3 years ago

@ishmum123 thanks! Except for the rebase there are no clear steps. It’s a matter of getting the parser in a shape that it will parse Haskell code while individual expressions, where clauses, etc are identifiable on whatever level.

ishmum123 commented 3 years ago

I am currently trying to Intellij Elm. Does the parsing over there help somehow?

rikvdkleij commented 3 years ago

Yes, the Elm plugin solution helped us for the solution in the layoutlexer branch. To continue I have to rebase that branch on master.

ishmum123 commented 3 years ago

I am trying to rebase the branch locally. Working incrementally at the moment, i.e. - rebasing a few commits at a time until I hit a commit with high number of conflicts. Might take some time...

rikvdkleij commented 3 years ago

@ishmum123 don’t know if you’re still trying to rebase but you can ignore the conflicts of files inside the gen folder and HaskellParser.java because those are generated. If not then I will give it a try again 😄

ishmum123 commented 3 years ago

I was out of town for a while... I would start working on it today, God willing

ishmum123 commented 3 years ago

This is my take on it - #646 . Feel free to completely discard it if it causes more harm than good

rikvdkleij commented 3 years ago

@ishmum123 thanks! I will take a look soon

rikvdkleij commented 3 years ago

@ishmum123 it looks okay. Had to make some small changes and regenerate the parser code to get it compiled.

The HaskellParsingTest is failing because of different element for newline.

ishmum123 commented 3 years ago

@rikvdkleij can you please push your changes to the branch? I can look into the HaskellParsingTest on top of that?

rikvdkleij commented 3 years ago

@ishmum123 I’ve pushed my changes to your branch already. It’s a PR

Thanks but be aware that the new PSI tree still has to be defined by us.

ishmum123 commented 3 years ago

@rikvdkleij let's carry the discussion over to the other PR?

rikvdkleij commented 3 years ago

@ishmum123 yes, good idea

ishmum123 commented 3 years ago

@rikvdkleij left a comment there. Would be great if you could address that please

CodeByAidan commented 1 year ago

2 year later, ouch!