-
Notifications
You must be signed in to change notification settings - Fork 185
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
Initialization fails #4
Comments
I added a fix in felixfbecker/php-advanced-json-rpc@f9d7354 and documentSymbol works now! 🎉 |
Yes. It works. So cool! :) |
BTW, I think you should apply the same pattern for JSON serialization everywhere. If an PHP object's member is I checked the behavior of the Gson library (the most popular for JSON serialization/deserialization in Java) and it does exactly this. |
@kaloyan-raev Yes, that would be ideal, but not possible in PHP. You cannot find out at serialization time if a property was set to I implemented the fix because I wanted advanced-json-rpc to be JSON RPC spec compatible, but for the VS Code language server protocol, we might actually have some influence on how they treat different values, and this makes it easier for developers. |
It is absolutely the same in Java (I am Java developer with some PHP knowledge). This is why I checked how the Gson library handles it. What about if here: https://github.com/felixfbecker/php-advanced-json-rpc/blob/master/lib/Message.php#L44 instead of
you have
Wouldn't be that a universal solution? |
No, because the spec for example says that the If we did it like this in all protocol structures, there would be no way to serialize actual Side note: you cannot cast an object directly to an array, it will include private properties. You have to do |
OK. You are right. |
I don't like this fact about PHP either. It sucks for ORMs, you have no way to see if a column is |
The following error is printed in the Console of Dev Tools:
[Extension Host] Response handler 'initialize' failed with message: Cannot read property 'code' of null
The text was updated successfully, but these errors were encountered: