Language Server API #6762
Replies: 5 comments 16 replies
-
I looked into this issue today. @farmaazon thank you for the detailed description, it was very helpful in the investigation. I agree that the issue is that the Suggestions database does not add I created task #6800 for myself which should fix that. |
Beta Was this translation helpful? Give feedback.
-
@4e6 I don't think that this solves the problem. It is possible to call non-static method directly on a type (e.g. |
Beta Was this translation helpful? Give feedback.
-
We had a discussion today during the engine daily sync and decided that the |
Beta Was this translation helpful? Give feedback.
-
Clearing the Although it caused one issue with |
Beta Was this translation helpful? Give feedback.
-
That's always good idea. However...
Why? Is the engine and IDE distributed separately? By downloading an The cloud+browser setup has similar behavior. The cloud shall associate a particular combo of IDE and LS+engine with the project and always make sure the browser loads the right IDE for the engine running in the docker container. The only problematic case is cloud+desktop...
...we cannot easily give the user the right IDE for the project in the cloud. We can just warn the user that there is a mismatch... We will need some form of semantic versioning to define what is and what isn't a mismatch. Being compatible will of course help. |
Beta Was this translation helpful? Give feedback.
-
When I was discussion with @Frizi the issue #6715, we discovered several points about Language Server API to be discussed broader @4e6 @hubertp :
What widgets needs to know
The widgets need to know how what method is called in the node, and also what arguments are already applied. Currently, It uses the information from
method_pointer
field in expression updates. It works for most cases, but has some issues:method_pointer
. We cannot handle situation where more arguments were applied, for example in this graph:The func1 is taking two arguments, so in the node on the left-bottom we want to see a single widget.
MethodPointer
differs depending on the call syntax does not fit its definition in the protocol. See the section below.MethodPointer
is not always reported. To be more specific, it's only reported when the method name appears in the node, or all arguments are applied.Therefore, we need some sort of
call_info
in expression updates, which for given expression it would specify what method it is (taking method_call field from expression update) and what arguments are already applied. @Frizi please correct me if I'm missing something.MethodPointer
and.type
suffix.The
MethodPointer
, according to its documentation in https://github.com/enso-org/enso/blob/102ce7ae5691f9aaceb43226600515af73d78424/docs/language-server/protocol-language-server.md:Its field is called
definedOnType
, but as @Frizi mentioned in his comment it's value depends actually on how the method is called instead how it is defined. I think this should be fixed.But now an important question emerges: shall static method of
local.Unnamed.Foo
be reported as defined inlocal.Unnamed.Foo
or inlocal.Unnamed.Foo.type
?The latter is very tempting, but then:
.type
, for consistencysearch/completion
should understand theself_type
argument with.type
suffix as asking for the appropriate statics methods. Currently, it does not return them (it only returns methods ofAny
).is_static
field could be removed as not needed anymore. It would only make IDE live a bit harder, as we would need to handle modules in a special way (as modules, in turn, does not have.type
suffix, what obviously make sense from the language perspective).@4e6 @hubertp what do you think about it?
This problem is rather a low priority, as so far the issues caused by it are in obscure scenarios. Also, whatever decision will be made, we need to make sure that the problems in the previous sections will be addressed first.
Solidifying API
From all the above, I think one important side note must be taken.
Given the approaching release, I think we are at the last chance of making significant and breaking changes in the Language Server. After the design partner or beta release, we should add new things sparingly and possibly only backward-compatible. Therefore, I think we should at some point think about the API and fix all inconsistencies and perhaps rename things: for example, the suggestion database is no longer about suggestions only.
I will try to look through it and post more propositions here.
Beta Was this translation helpful? Give feedback.
All reactions