PMunch / nimlsp

Language Server Protocol implementation for Nim
MIT License
416 stars 50 forks source link

Async doesn't work on Windows #131

Open AmjadHD opened 2 years ago

AmjadHD commented 2 years ago

After #125 fix of #121, async doesn't work on Windows. Isn't there a way to make it work ?

PMunch commented 2 years ago

@bung87, if these aren't fixed soon I'll have to revert your changes..

bung87 commented 2 years ago

I dont understand , the issue seems like a question, my pr does work on windows . I dont see any reason async support cause code revert.

AmjadHD commented 2 years ago

What I meant is async doesn't work on windows like other platforms, #121 was fixed by not going async on windows. https://github.com/PMunch/nimlsp/blob/7b28d0cfbbab40afd15d2344165afa7d0f96b9b7/src/nimlsp.nim#L665-L673 This issue is more of a continuation to #121 to discuss how async can be implemented on windows. So I don't see how #132 fixes this.

bung87 commented 2 years ago

oh, sorry! it's fix #130, I understand the problem you want to resolve. I've investigate one or two years ago , this is because std async libs use iocp , but it will not work on stdio, see https://stackoverflow.com/questions/55619555/win32-impossible-to-use-iocp-with-stdin-handle , I'v read one blog post by tokio explain more details, but I can't find the link now.

AmjadHD commented 2 years ago

There's this read https://tim.mcnamara.nz/post/176613307022/iocp-and-stdio also this: https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncpipe.nim

bung87 commented 2 years ago

yeah, it's that post.