-
Notifications
You must be signed in to change notification settings - Fork 34
Conversation
…unction arguments.
…vocations of known arity
let chain = infix.flatten(); | ||
let app_base = ApplicationBase::new(self); | ||
let invocation = || -> Option<CalledMethodInfo> { | ||
context.call_info(self.id?, app_base.function_name) | ||
}(); | ||
|
||
// All prefix params are missing arguments, since there is no prefix application. | ||
let missing_args = app_base.prefix_params(invocation); | ||
let arity = missing_args.len(); | ||
let base_node_kind = if arity==0 {kind} else {node::Kind::Operation}; | ||
let node = chain.generate_node(base_node_kind,context)?; | ||
let provided_prefix_arg_count = 0; | ||
Ok(generate_expected_arguments(node,kind,provided_prefix_arg_count,missing_args)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The infix could be a function part of prefix chain - and possibly we could generate ports for arguments twice (all depends of definition of "expression being a call". Let's discuss this case on the call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving as-is for now, as discussed.
Current language server behavior is that it provides a method pointer only for fully saturated calls.
src/rust/ide/src/controller/graph.rs
Outdated
/// | ||
/// Will use `self` as the context for span tree generation. | ||
pub fn connections_unevaluated_ctx(&self) -> FallibleResult<Connections> { | ||
let graph = self.graph_info()?; | ||
Ok(Connections::new(&graph,self)) | ||
} | ||
|
||
/// Returns information about all the connections between graph's nodes. | ||
pub fn connections | ||
(&self, context:&impl SpanTreeContext) -> FallibleResult<Connections> { | ||
let graph = self.graph_info()?; | ||
Ok(Connections::new(&graph)) | ||
// TODO perhaps this should merge given context with the metadata information | ||
// or perhaps this should just do exactly what it is told | ||
Ok(Connections::new(&graph,context)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make functions:
connections(self)
- to provide connections with data from metadataconnections_enriched(self, context)
- to apply result of context before metadata - being used by executed graph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving as-is, as discussed. For now that for consistency would require providing a number of mostly duplicated unused methods.
If ever needed, then they can provided or alternatively a design where graph controller holds context as a field should be reconsidered.
Co-authored-by: Adam Obuchowicz <adam.obuchowicz@luna-lang.org>
Co-authored-by: Adam Obuchowicz <adam.obuchowicz@luna-lang.org>
Co-authored-by: Adam Obuchowicz <adam.obuchowicz@luna-lang.org>
…to wip/mwu/arg-names
Pull Request Description
This PR adds information about argument names and types to the span tree nodes.
The arguments are recognized based on the intended method metadata entry (if present and name matches) or the computed value registry.
This is feature complete PR. Still more tests are intended.
Important Notes
Checklist
Please include the following checklist in your PR: