Skip to content

Conversation

bentsherman
Copy link
Member

@bentsherman bentsherman commented Oct 13, 2025

This PR adds a few things to nf-lang to help enable type checking in the language server.

The full type checker will eventually be incorporated into nf-lang, but for now it will reside in the language server while we continue to develop it. This way I can release improvements to the type checker without requiring a Nextflow patch release

No unit tests because these changes are covered by language server unit tests for now.

Summary of changes:

  • Save method overloads in VariableScopeVisitor when a method call matches multiple possible methods (used by type checker to select method or provide appropriate error message)

  • Add @NamedParams annotation to standard library functions (used by type checker to validate named params)

  • Fix resolution of output types for processes and workflows

  • Resolve params block during name checking (was previously done only by language server)

  • Minor bug fixes

Copy link

netlify bot commented Oct 13, 2025

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit 2c2168f
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/68f2bbb8be892c0008e281f3
😎 Deploy Preview https://deploy-preview-6482--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bentsherman bentsherman added this to the 25.10 milestone Oct 13, 2025
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman bentsherman requested a review from jorgee October 17, 2025 22:06
@bentsherman bentsherman marked this pull request as ready for review October 17, 2025 22:06
@bentsherman bentsherman requested a review from a team as a code owner October 17, 2025 22:06
return true;
var type = genericsType.getType();
resolveOrFail(type, genericsType);
resolve(type);
Copy link
Contributor

@jorgee jorgee Oct 20, 2025

Choose a reason for hiding this comment

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

Why is the failure removed? Also ignoring the return. Not understanding this part.

Copy link
Member Author

Choose a reason for hiding this comment

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

It was causing an unhelpful error when a generic type argument couldn't be resolved. But now I remember I need to propagate this error up the stack and still report it, so I will add that

Copy link
Contributor

@jorgee jorgee left a comment

Choose a reason for hiding this comment

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

I have tried to understand changes. Not familiar with the resolve part, so I couldn't understand why you changed a resolveOrFail by just resolve. The rest looks fine to me.

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