Skip to content

[WIT] Add Go function name extractors - #165

Open
dplyukhin wants to merge 2 commits into
advanced-go-internalsfrom
advanced-go-name-extractor
Open

[WIT] Add Go function name extractors#165
dplyukhin wants to merge 2 commits into
advanced-go-internalsfrom
advanced-go-name-extractor

Conversation

@dplyukhin

@dplyukhin dplyukhin commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

What was changed

  • Implemented @nexus.function go-name-extractor
  • Added workflowFunctionName helper to support.go
  • Updated model.wit to use it

Why?

The original runtime.FuncForPC logic didn't resolve aliases.

Checklist

  1. Closes: N/A

  2. How was this tested:

    • cargo build-examples --lang go
    • go test ./...
    • cargo test --features advanced --test generate_go — 50 passed
    • cargo check --all-features --all-targets
    • cargo test --features advanced parser::wit::tests::parses_wit_into_selected_language_spec
    • Generated support equality check — verified all 4 files
    • git diff --check advanced-go-internals -- .
  3. Any docs updates needed?

No.

@dplyukhin
dplyukhin requested a review from a team as a code owner August 28, 2026 21:03
@dplyukhin
dplyukhin marked this pull request as draft August 28, 2026 21:04
@dplyukhin
dplyukhin force-pushed the advanced-go-name-extractor branch from 17b7aa3 to 781cf55 Compare August 28, 2026 21:36
@dplyukhin
dplyukhin force-pushed the advanced-go-name-extractor branch from 781cf55 to 561edfc Compare August 28, 2026 21:43
@dplyukhin
dplyukhin marked this pull request as ready for review August 28, 2026 22:14
Comment thread src/generator/go.rs
params.iter().any(|param| {
param.required
&& param.function.as_ref().is_some_and(|function| {
!is_go_signal_function(function) && function.name_extractor.is_none()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having signal here explicitly isn't a great sign, since that is not a concept in the WIT.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, not introduced by this, but we should fix:

fn is_go_signal_function(function: &FunctionFieldSpec) -> bool {
    !function.primary
        && function.args_field == "signal_input"
        && matches!(function.alternate_type.as_ref(), Some(TypeSpec::String))
}

@dplyukhin
dplyukhin force-pushed the advanced-go-name-extractor branch from 5ba96fb to a063eaa Compare September 2, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants