build: cherry pick concurrent id error (#472)

* dev: commit reference changes

* build: cherry pick concurrent id error
This commit is contained in:
Myriad-Dreamin 2024-07-28 18:06:43 +08:00 committed by GitHub
parent a6c81c80b0
commit 0c9d6623b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 20 deletions

14
Cargo.lock generated
View file

@ -4137,7 +4137,7 @@ dependencies = [
[[package]] [[package]]
name = "typst" name = "typst"
version = "0.11.1" version = "0.11.1"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.1#152d935d379f524b12c6b55a14c6343b718956d6" source = "git+https://github.com/Myriad-Dreamin/typst.git?tag=tinymist-v0.11.1-2#314749ea26ac3f62622bc3b3c30d3a7d6a457a74"
dependencies = [ dependencies = [
"az", "az",
"bitflags 2.6.0", "bitflags 2.6.0",
@ -4204,7 +4204,7 @@ checksum = "2b3061f8d268e8eec7481c9ab24540455cb4912983c49aae38fa6e8bf8ef4d9c"
[[package]] [[package]]
name = "typst-macros" name = "typst-macros"
version = "0.11.1" version = "0.11.1"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.1#152d935d379f524b12c6b55a14c6343b718956d6" source = "git+https://github.com/Myriad-Dreamin/typst.git?tag=tinymist-v0.11.1-2#314749ea26ac3f62622bc3b3c30d3a7d6a457a74"
dependencies = [ dependencies = [
"heck 0.4.1", "heck 0.4.1",
"proc-macro2", "proc-macro2",
@ -4215,7 +4215,7 @@ dependencies = [
[[package]] [[package]]
name = "typst-pdf" name = "typst-pdf"
version = "0.11.1" version = "0.11.1"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.1#152d935d379f524b12c6b55a14c6343b718956d6" source = "git+https://github.com/Myriad-Dreamin/typst.git?tag=tinymist-v0.11.1-2#314749ea26ac3f62622bc3b3c30d3a7d6a457a74"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"bytemuck", "bytemuck",
@ -4263,7 +4263,7 @@ dependencies = [
[[package]] [[package]]
name = "typst-render" name = "typst-render"
version = "0.11.1" version = "0.11.1"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.1#152d935d379f524b12c6b55a14c6343b718956d6" source = "git+https://github.com/Myriad-Dreamin/typst.git?tag=tinymist-v0.11.1-2#314749ea26ac3f62622bc3b3c30d3a7d6a457a74"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"comemo 0.4.0", "comemo 0.4.0",
@ -4283,7 +4283,7 @@ dependencies = [
[[package]] [[package]]
name = "typst-svg" name = "typst-svg"
version = "0.11.1" version = "0.11.1"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.1#152d935d379f524b12c6b55a14c6343b718956d6" source = "git+https://github.com/Myriad-Dreamin/typst.git?tag=tinymist-v0.11.1-2#314749ea26ac3f62622bc3b3c30d3a7d6a457a74"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"comemo 0.4.0", "comemo 0.4.0",
@ -4316,7 +4316,7 @@ dependencies = [
[[package]] [[package]]
name = "typst-syntax" name = "typst-syntax"
version = "0.11.1" version = "0.11.1"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.1#152d935d379f524b12c6b55a14c6343b718956d6" source = "git+https://github.com/Myriad-Dreamin/typst.git?tag=tinymist-v0.11.1-2#314749ea26ac3f62622bc3b3c30d3a7d6a457a74"
dependencies = [ dependencies = [
"comemo 0.4.0", "comemo 0.4.0",
"ecow 0.2.2", "ecow 0.2.2",
@ -4332,7 +4332,7 @@ dependencies = [
[[package]] [[package]]
name = "typst-timing" name = "typst-timing"
version = "0.11.1" version = "0.11.1"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.1#152d935d379f524b12c6b55a14c6343b718956d6" source = "git+https://github.com/Myriad-Dreamin/typst.git?tag=tinymist-v0.11.1-2#314749ea26ac3f62622bc3b3c30d3a7d6a457a74"
dependencies = [ dependencies = [
"parking_lot", "parking_lot",
"serde", "serde",

View file

@ -167,12 +167,12 @@ undocumented_unsafe_blocks = "warn"
tinymist-assets = { path = "./crates/tinymist-assets/" } tinymist-assets = { path = "./crates/tinymist-assets/" }
typst = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.1" } typst = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist-v0.11.1-2" }
typst-timing = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.1" } typst-timing = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist-v0.11.1-2" }
typst-svg = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.1" } typst-svg = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist-v0.11.1-2" }
typst-render = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.1" } typst-render = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist-v0.11.1-2" }
typst-pdf = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.1" } typst-pdf = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist-v0.11.1-2" }
typst-syntax = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.1" } typst-syntax = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist-v0.11.1-2" }
# typst = { path = "../typst/crates/typst" } # typst = { path = "../typst/crates/typst" }
# typst-timing = { path = "../typst/crates/typst-timing" } # typst-timing = { path = "../typst/crates/typst-timing" }

View file

@ -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. /// Resolve a call target to a function or a method with a this.
pub fn resolve_call_target( pub fn resolve_call_target(
ctx: &mut AnalysisContext, ctx: &mut AnalysisContext,
callee: LinkedNode, callee: &LinkedNode,
) -> Option<CallConvention> { ) -> Option<CallConvention> {
resolve_callee_(ctx, callee, true).map(identify_call_convention) resolve_callee_(ctx, callee, true).map(identify_call_convention)
} }
/// Resolve a callee expression to a function. /// 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) resolve_callee_(ctx, callee, false).map(|e| e.func_ptr)
} }
fn resolve_callee_( fn resolve_callee_(
ctx: &mut AnalysisContext, ctx: &mut AnalysisContext,
callee: LinkedNode, callee: &LinkedNode,
resolve_this: bool, resolve_this: bool,
) -> Option<DynCallTarget> { ) -> Option<DynCallTarget> {
None.or_else(|| { None.or_else(|| {
@ -357,7 +357,7 @@ fn resolve_callee_(
this: None, this: None,
}) })
.or_else(|| { .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 { if let Some(func) = values.into_iter().find_map(|v| match v.0 {
Value::Func(f) => Some(f), Value::Func(f) => Some(f),

View file

@ -202,7 +202,7 @@ pub(crate) fn analyze_signature(
// TryResolveCalleeResult::Runtime(func) => func, // TryResolveCalleeResult::Runtime(func) => func,
// }; // };
let func = resolve_callee(ctx, node)?; let func = resolve_callee(ctx, &node)?;
log::debug!("got function {func:?}"); log::debug!("got function {func:?}");
func func

View file

@ -563,7 +563,7 @@ pub fn param_completions<'a>(
let Some(cc) = ctx let Some(cc) = ctx
.root .root
.find(callee.span()) .find(callee.span())
.and_then(|callee| resolve_call_target(ctx.ctx, callee)) .and_then(|callee| resolve_call_target(ctx.ctx, &callee))
else { else {
return; return;
}; };
@ -940,7 +940,7 @@ pub fn named_param_value_completions<'a>(
let Some(cc) = ctx let Some(cc) = ctx
.root .root
.find(callee.span()) .find(callee.span())
.and_then(|callee| resolve_call_target(ctx.ctx, callee)) .and_then(|callee| resolve_call_target(ctx.ctx, &callee))
else { else {
// static analysis // static analysis
if let Some(ty) = ty { if let Some(ty) = ty {