Implementing a clangd served, I see that when I put small integers (even if coerced with Number()) into a parameter – the values 0 and 1 when used for ranges (line and column) wind up getting serialized into JSON boolean true/false.
This breaks deserialization in clangd, which means that my extension has no way to utilize the LSP to access symbols on the first line of the file, nor in the first column.
(I also posted something in Get Help about this, but I’ve become more convinced that this is not a misunderstanding on my part but probably a Bug… I’m coming at this relatively new to JavaScript, but note that when I use JSON.stringify() to serialize the parameters they come out as I expect – with numbers rather than booleans, so I conclude it must be something that the Nova internal code is doing wrong. If there is a workaround for this problem, I’d be happy to hear it.)
This appears to be due to JavaScriptCore. In converting values from the extension request to native ones, it’s converting Boolean to a number, as Objective-C does not use discrete object types for booleans when placed in collections. We’ll investigate whether this is something that can be improved easily, and if not, file a request to have this code reworked to better preserve booleans in collections.