[00:40:16] * ColonelJ [ColonelJ!~ColonelJ@unaffiliated/colonelj] has quit (Quit: leaving). [02:17:05] * nonlinear [nonlinear!~discrttm@unaffiliated/discrttm] has quit (Quit: The Lounge - https://thelounge.chat). [05:33:13] * MrMobius [MrMobius!~MrMobius@208.58.206.154] has quit (Ping timeout: 264 seconds). [05:33:36] * [1]MrMobius [[1]MrMobius!~MrMobius@208.58.206.154] has joined the channel. [07:10:57] bitmapper: did you see my note earlier about how the ebnf macro transforms locals? [07:11:14] bitmapper: mentioned briefly here https://bluishcoder.co.nz/2008/04/04/factor-parsing-dsl.html [09:04:09] * neceve_ [neceve_!~quassel@unaffiliated/neceve] has joined the channel. [09:55:20] * Sgeo [Sgeo!~Sgeo@ool-18b982ad.dyn.optonline.net] has quit (Read error: Connection reset by peer). [12:13:55] * neceve_ [neceve_!~quassel@unaffiliated/neceve] has quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.). [13:48:25] * ColonelJ [ColonelJ!~ColonelJ@unaffiliated/colonelj] has joined the channel. [15:10:01] doublec: i don't see what you mean [15:16:04] * itmuckel [itmuckel!~itmuckel@i577BC819.versanet.de] has joined the channel. [16:37:56] bmps: OMG. Just tested it for IntelliJ (intellij-lsp) and it turns out that it just runs the process and doesn't send messages to it by tcp, but by stdin/stdout. :roll_eyes: [16:39:07] I didn’t know IntelliJ *had* an LSP engine... [16:39:20] bmps: The whole time I assumed that the language server is an http-server, but it seems like some lsp plugins just do it via stdin/stdout, which is alright, because it saves some overhead, but I wish I had known that was an option. :-D [16:40:21] I’d swear when I poked at this I was looking at doing a server model, but maybe I’m thinking of when I was screwing with nREPL. [16:40:24] bmps: It has and it is quite useful for testing purposes, because it is configurable over GUI (set a command for the language server and IntelliJ does the rest) so you don't have to program two applications at the same time [16:40:39] That makes sense. [16:45:46] bmps: So, I'll re-factor my code as soon as I coped with not looking into this basic question earlier. :D [16:48:40] <^alex> well-factored (pun intended) code should be easy to adapt to either mechanism :) [16:49:48] Yeah, the actual server code is very minimal [16:50:44] The majority of it is converting strings to and from json. I still need to do that for stdin/stdout communication [16:51:15] * ^alex nods [16:52:26] lol [17:02:59] How do I read from stdin? :D [17:39:06] got it [17:48:36] <^alex> `read-json-objects` imo [18:17:24] imo? I thought you are many? Shouldn't it be ioo=in our opinion? ;) [18:18:26] read-json-objects won't work unfortunately, because LSP-Messages always have "Content-Length: n" prepended, so the stdin knows when to stop [18:18:42] But still, I think this might be useful [18:21:20] Hmm, also I use `"{" read-until drop` to scan the stream for the first json object. at this point I could use read-json-objects, but unfortunately then the opening '{' is missing. [18:22:28] Also the word reads json objects until the stream ends. The LSP-Stream won't end until the IDE is finished with the language server. [18:28:25] <^alex> itmuckel, a) fewer people understand `ioo` than `imo`, also b) english is bad at conveying the shape of our plurality [18:29:35] <^alex> also, what we would do in that case is read a line and parse it for the content-length, check for a reasonable value, read that many bytes from stdin, and `json>` [18:30:32] <^alex> which would adhere more closely to the protocol, instead of assuming the JSON is properly framed [18:30:56] That's what I'm trying to do, but it returns me an empty slice: https://paste.factorcode.org/paste?id=4148 [18:35:17] <^alex> itmuckel, let's see... gimme a few to experiment in the listener [18:39:07] <^alex> itmuckel, annotated [18:40:02] <^alex> if this were prod code, we'd factor out the content-length parsing [18:56:06] * Sgeo [Sgeo!~Sgeo@ool-18b982ad.dyn.optonline.net] has joined the channel. [18:56:47] nice, thank you [19:00:32] * bitmapper [bitmapper!~bitmapper@142.162.167.202] has quit (Remote host closed the connection). [19:02:22] * itmuckel [itmuckel!~itmuckel@i577BC819.versanet.de] has quit. [19:45:45] * itmuckel [itmuckel!~itmuckel@i577BC819.versanet.de] has joined the channel. [19:47:42] Somehow when I try my code in the listener it won't work, but when I try it in the terminal it works fine [19:47:57] ^alex: regarding reading from stdin [20:00:10] <^alex> in a listener we'd use `with-string-reader` [20:00:54] <^alex> "content-length: 2\n{}" [ parse-message ] with-string-reader [20:02:12] :-O [20:02:35] Why did it work without "with-string-reader" in your paste? [20:02:49] <^alex> because it's reading from the default input stream [20:02:54] <^alex> idk? [20:03:14] <^alex> we... might have hit Ctrl-D to signal EOF [20:03:38] <^alex> ... no we did not [20:05:28] :-( [20:05:52] I'd expect it to read from the default input stream too in my listener :D [20:06:18] Also I tried it with double CR at the end and Ctrl-D too. :( [20:06:30] Maybe it's a Windows problem :'( [20:13:47] <^alex> yeah, we haven't used Windows in a long time [20:13:54] <^alex> Windows EOF is ctrl-z tho [20:16:46] No, it's Ctrl-D too [20:17:35] Well at least I can test my code from the listener with [ word ] with-string-reader [20:17:58] <^alex> we'll defer to your experience there, not having used windows in a while [20:18:48] Well. I'll probably continue working on the lsp on thursday, tomorrow I have to program other stuff at work. ;) [20:19:10] Have a nice week, see you soon and thank you for your input [20:22:10] * itmuckel [itmuckel!~itmuckel@i577BC819.versanet.de] has quit. [20:31:18] * bitmapper [bitmapper!~bitmapper@142.162.167.202] has joined the channel.