-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Language server #346
Language server #346
Conversation
447d0d0
to
e3c0fd4
Compare
Several updates fixing a few bugs, reusing modules in memory that have already been typechecked, better completions based on types and better logging and compile & run support via language server. |
a20e41f
to
f69e38b
Compare
e3c5c68
to
9924a6c
Compare
Updated the binary files for the sample release here, should be a lot more responsive, and has exception handling and some fixes so it no longer thinks it has a different file open when you are hovering: https://github.com/TimWhiting/koka/releases/tag/v2.4.2-language-server |
9d31d31
to
3c29bf0
Compare
cf276e4
to
bf49f1a
Compare
Updated extension with ability to pass in extra compiler arguments to the run/debug configuration |
An update: For small projects, the language server works really well. For large projects or large files, the compiler is slow, and takes a ton of memory. I've run into some sort of memory leak. I'm not super familiar with debugging Haskell memory leaks - especially due to it's laziness. The memory leak might be in the existing compiler, but just doesn't manifest due to the short runtime of the process, I'm not sure where to go from here. I did look at how to configure the runtime options for Haskell to capture a heap profile, but for whatever reason, when I terminate the process it doesn't write it out - I'm probably sending the wrong signal. |
92f9260
to
dd7d61c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @daanx
I've added a few comments to this PR, and did some cleanup. This PR should be a lot cleaner now. I believe the current approach in Compile.hs
should make a lot more sense than my prior approach since I understand it better now, but I haven't used it as extensively yet. I believe the memory issues to be less of a problem than mentioned previously, though likely still present.
1852cb2
to
4a65beb
Compare
Latest prebundled release assets that I have generated: https://github.com/TimWhiting/koka/releases/tag/v2.4.3-lang-server |
d363482
to
5a0acd5
Compare
079df67
to
27bc0eb
Compare
With the most recent changes, there are a lot of improvements, including some fixes for windows paths.
That being said, I'm sure there are still likely small bugs with it. It should not change the normal compilation process, and should not affect the interpreter, so you should always be able to fall back on that model of compilation. Additionally restarting the vscode window or the language server can get rid of many temporary issues. Please report issues as you find them though so we can get as many bugs worked out before releasing this. Precompiled binaries and the vscode extension are currently available here: https://github.com/TimWhiting/koka/releases/tag/v2.4.3-lang-server7 I'm working with Daan to get the changes integrated in the next release, in addition to a few other fixes in recent PRs (which are included in the precompiled release linked above). |
04a4cf8
to
d2654d0
Compare
d9b738a
to
957e39c
Compare
… Also add a ton of comments
…ring of koka image
Moving to lang-server2.1 branch |
I've reset the commit history here since this PR no longer looks much like the original PR. This PR is updated to the latest Haskell LSP libraries, uses the LSP library's virtual file system to support unsaved changes, and has support for VSCode run configuration of Koka files. Syntax errors are no longer immediately sent to stdout so that it doesn't mess with the server protocol.
I'll go through and make some comments in this PR or in the code for things to note.