-
Notifications
You must be signed in to change notification settings - Fork 83
add ProgressToken constructor #688
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
Conversation
It seems to work. But now that I think about it, isn't this type piracy? Since |
Yeah possibly, but who really owns a Union? |
I'd say that, since we don't own any of the types in the Union, then we don't own the Union. If we have the right to define a constructor for the Union, then any other module has the right to do the same, which is (as I understand it) what the concept of type piracy tries to avoid. More concretely, this implementation could break if someone else decides to define their own constructor for the same Union. |
Yeah, this seems kind of risky.... |
Probably right - I'll fix and add a check in StaticLint |
why not simply do
|
Sorry for jumping in, but - haskey(dict, "workDoneToken") ? ProgressToken(dict["workDoneToken"]) : missing)
+ haskey(dict, "workDoneToken") ? dict["workDoneToken"] : missing) Also, there's a |
Sorry, I've not had time to have a proper look at this yet. I'm pretty sure |
I've grepped project and found only this instance. |
The macro mentioned above creates, for each struct it is used on, functions that convert a macroexpand(LanguageServer, :(
@dict_readable struct T
d::ProgressToken
end))
-->
struct T
d::ProgressToken
end
function T(dict::Dict)
T(ProgressToken(dict["d"]))
end So it's not only explicit calls to Your fix above will work for now, but as soon as we start getting sent |
Then you really should use
|
What is the status with this? Should we first merge #701 and then revisit this? |
I just thought I'd mention I managed to get lsp-julia working without a hiccup by dropping in the progtoken branch and then editing InitializeParams as suggested. The progtoken branch did not work by itself. I'm on mac running 1.4.2. Thanks to the guys that solved this, it was driving me crazy. |
Could you share your init.el? |
My lsp-mode is installed manually because I was trying different versions when I was trying to get lsp-julia to work but I don't see why an elpa installed lsp-mode wouldn't work. Also, I had to edit lsp-julia.el to use the new |
@julia-vscode/core bump ? (I got a report on this today in other place) I guess it's okay if we pirate the |
I think piracy is fine in an application, but I'd really prefer we continue thinking of LanguageServer.jl as a library/package so that people could use parts of it to build their own code analysis tools if desired. That said, it's unlikely to happen, so if the right fix for this is onerously difficult (involves special-casing a macro? I haven't dug in to see what the best fix would be), creating a method for a |
na, |
So what's the reason for not making |
Guess we want to treat it as a value ? pps = ProgressParams(...)
pps.token # want to get the actual value here ? And overloading |
Yeah, not sure how/in what contexts |
If this instance of pirating is deemed unacceptable can we simply replace all fields that are typed by |
Sounds good to me. |
yeah good to me too |
fixes #651 ?