mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-23 04:35:00 +00:00
build: cherry pick concurrent id error (#472)
* dev: commit reference changes * build: cherry pick concurrent id error
This commit is contained in:
parent
a6c81c80b0
commit
0c9d6623b4
5 changed files with 20 additions and 20 deletions
|
@ -317,19 +317,19 @@ fn is_same_native_func(x: Option<&Func>, y: &Func) -> bool {
|
|||
/// Resolve a call target to a function or a method with a this.
|
||||
pub fn resolve_call_target(
|
||||
ctx: &mut AnalysisContext,
|
||||
callee: LinkedNode,
|
||||
callee: &LinkedNode,
|
||||
) -> Option<CallConvention> {
|
||||
resolve_callee_(ctx, callee, true).map(identify_call_convention)
|
||||
}
|
||||
|
||||
/// Resolve a callee expression to a function.
|
||||
pub fn resolve_callee(ctx: &mut AnalysisContext, callee: LinkedNode) -> Option<Func> {
|
||||
pub fn resolve_callee(ctx: &mut AnalysisContext, callee: &LinkedNode) -> Option<Func> {
|
||||
resolve_callee_(ctx, callee, false).map(|e| e.func_ptr)
|
||||
}
|
||||
|
||||
fn resolve_callee_(
|
||||
ctx: &mut AnalysisContext,
|
||||
callee: LinkedNode,
|
||||
callee: &LinkedNode,
|
||||
resolve_this: bool,
|
||||
) -> Option<DynCallTarget> {
|
||||
None.or_else(|| {
|
||||
|
@ -357,7 +357,7 @@ fn resolve_callee_(
|
|||
this: None,
|
||||
})
|
||||
.or_else(|| {
|
||||
let values = analyze_expr(ctx.world(), &callee);
|
||||
let values = analyze_expr(ctx.world(), callee);
|
||||
|
||||
if let Some(func) = values.into_iter().find_map(|v| match v.0 {
|
||||
Value::Func(f) => Some(f),
|
||||
|
|
|
@ -202,7 +202,7 @@ pub(crate) fn analyze_signature(
|
|||
// TryResolveCalleeResult::Runtime(func) => func,
|
||||
// };
|
||||
|
||||
let func = resolve_callee(ctx, node)?;
|
||||
let func = resolve_callee(ctx, &node)?;
|
||||
|
||||
log::debug!("got function {func:?}");
|
||||
func
|
||||
|
|
|
@ -563,7 +563,7 @@ pub fn param_completions<'a>(
|
|||
let Some(cc) = ctx
|
||||
.root
|
||||
.find(callee.span())
|
||||
.and_then(|callee| resolve_call_target(ctx.ctx, callee))
|
||||
.and_then(|callee| resolve_call_target(ctx.ctx, &callee))
|
||||
else {
|
||||
return;
|
||||
};
|
||||
|
@ -940,7 +940,7 @@ pub fn named_param_value_completions<'a>(
|
|||
let Some(cc) = ctx
|
||||
.root
|
||||
.find(callee.span())
|
||||
.and_then(|callee| resolve_call_target(ctx.ctx, callee))
|
||||
.and_then(|callee| resolve_call_target(ctx.ctx, &callee))
|
||||
else {
|
||||
// static analysis
|
||||
if let Some(ty) = ty {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue