-
Notifications
You must be signed in to change notification settings - Fork 300
[WIP] feature/switch typescript language server to theia-ide #1717
base: master
Are you sure you want to change the base?
Conversation
Awesome, thanks @akin909 for making the branch available! I wanted to try it out, will save me some time 💯 |
Ya, looks like it works pretty well! I noticed diagnostics are missing too unfortunately - I wonder if they'd be open for a PR to implement that? The rename and go-to definition issues might be on our end - need to check it out. Also, FYI, if you set this:
It shouldn't restart the process as frequently (so should perform better when switching files in the same workspace) |
I think the best bet for us would be to see if we could help them implement the diagnostics, which is the main gap - and then integrate this in lieu of our in-proc strategy. From there, we could help implement the 'auto-import' functionality - looks like they have an issue tracking it already: |
@bryphe I'm getting error markers and |
Codecov Report
@@ Coverage Diff @@
## master #1717 +/- ##
==========================================
- Coverage 45.43% 37.37% -8.07%
==========================================
Files 361 297 -64
Lines 14563 12219 -2344
Branches 1912 1600 -312
==========================================
- Hits 6617 4567 -2050
+ Misses 7721 7402 -319
- Partials 225 250 +25
Continue to review full report at Codecov.
|
Not sure the root files option actually makes things faster 😞 , also re diagnostics not sure all the issues with errors have gone away although the behaviour seems more realtime unless switching file when the lsp is restarting so old errors wait till its booted back up to clear |
Hmm, are you still seeing the server restart when switching files after setting that? Perhaps it's a different issue.
Oh, cool! I'm glad it actually has diagnostics. I wasn't seeing them, but perhaps there is some pathing issue or something on Windows.. need to check further. I checked again in their code and it seems they are publishing diagnostics, so thats promising If we can figure out that switching issue, seems like it's definitely worth bringing in! 👍 Then we can see if we can work with them to add the auto-import functionality |
@bryphe re. the restarting of the I've noted the following series of events A Fumbling in the dark here but I wonder if this might at all relate to our configuration in the lsp ? |
Thanks for the investigation, @akin909 ! I'm stoked to integrate this and get out of the business of maintaining our own TypeScript layer 👍
The trace helps a lot. I think that the fault may be ours - we may be sending As a temporary troubleshooting measure, we could try commenting out this line:
Just to see how the language server behaves. If we find it's better after removing that, we might need to change the event (like, hook to an |
@bryphe thanks for the heads up was having difficulty figuring out what the significance of that sequence of events was, will give commenting that section out a shot Edit: tried with the event changed to bufferClose which prevents the restarting however theres still a 2s approx lag on switching file. I'm wondering whether this might relate to the |
Another issue which I think my be contributing to lagging or the server functionality cutting out is an error which seems to occur on trying to getDefinition Seems to be referenced at microsoft/TypeScript#21818 but cant see any information that might help mitigate this 🤕 |
@bryphe started working on this again and I've managed to fix the rename bug, as well as the restarting bug - this required changing the logic we use to find a root dir as it was unfortunately not returning the correct directory causing the The one outstanding issue I believe with this PR is |
Update on this I found: microsoft/TypeScript#16456 which seems to be a very similar (not the same issue) and the cause of it seems to be the language server slowly getting into a state of confusion because of problematic input/ casing issues. I'm thinking that somewhere along the way we post to the language server, details like line and column numbers perhaps some of this info is off (I know neovim sends line info as 0 based and perhaps it might relate to that?) |
Sounds like good progress! Thanks @akin909 .
Hmm, the
We log the request names, but you might want to log the What I'd really like is a way for us to test the |
Thanks for the heads up with those I will do some logging and try and figure out whats going on. Re. testing the lsp independently that definitely seems v. useful/necessary, perhaps we can have another issue to outline how that might work? e.g. from what i've seen most lsps can be run from the command line so perhaps a process could be spawned and we use that to send various request and check the responses to ensure that things come and go as expected as you suggest. Although sounds like it might require a service as opposed to just spawning a process as a mock I think with this PR i'd like to focus on just getting |
Raised the issues regarding testing the lsp as #2246 |
Any idea when this is going to land? |
@wesselvdv there've been quite a few errors crop up in trying to integrate this lsp, so has taken way longer than I initially hoped. There've have been quite a lot of very nice improvememts to that client since which would be awesome to integrate with oni. Tbh can't give an eta ill update the client and have another go with it to see if im still encountering the error which kills the lsp client (not sure what exactly is going on there i.e. is it an oni error or the client is erroring) |
53a6fd2
to
bd44cc8
Compare
Following discussion with @bryphe in #1593 this PR switches the default
lsp
for typescript totheia-ide/typescript-language-server
, more details re. reasoning behind the switch can be found in the linked issue.@bryphe I've essentially replicated the steps I took to setup the LSP and haven't touched Oni's ts lsp.
Oustanding: