Skip to content

Multiline function calling - #8117

Open
Efnilite wants to merge 24 commits into
dev/featurefrom
feature/multiline-function-args
Open

Multiline function calling#8117
Efnilite wants to merge 24 commits into
dev/featurefrom
feature/multiline-function-args

Conversation

@Efnilite

@Efnilite Efnilite commented Aug 6, 2025

Copy link
Copy Markdown
Member

Problem

Due to Skript's nature of having one statement per line, calling functions with many arguments may lead to unreadable long lines when specifying function arguments.

Solution

Adds a new SectionExpression for calling a function while specifying one argument per line. Every line sets a specific argument and is separated by set to to indicate that parameter x has value y.

set {_transformation} to function transformation with arguments:
    x set to vector(0, 0, 0)
    y set to vector(1, 1.5, 1)
    angle set to axisAngle(45, vector(2, 2, 2)
    axis set to {_axis}

Testing Completed

Added ExprSecFunction.sk tests.

Supporting Information

This PR uses code from the function package rework PR (#8112), and thus can only be merged once that has been merged.


Completes: #7924
Related: none

@Efnilite Efnilite added enhancement Feature request, an issue about something that could be improved, or a PR improving something. functions Related to functions labels Aug 6, 2025
@Efnilite Efnilite linked an issue Aug 6, 2025 that may be closed by this pull request
1 task
Comment thread src/main/java/ch/njol/skript/sections/ExprSecFunction.java Outdated
Comment thread src/main/java/ch/njol/skript/sections/ExprSecFunction.java Outdated
Comment thread src/main/java/ch/njol/skript/sections/ExprSecFunction.java Outdated
Comment thread src/main/java/ch/njol/skript/sections/ExprSecFunction.java Outdated
Comment thread src/main/java/ch/njol/skript/sections/ExprSecFunction.java Outdated
Comment thread src/main/java/ch/njol/skript/sections/ExprSecFunction.java Outdated
Comment thread src/main/java/ch/njol/skript/sections/ExprSecFunction.java Outdated
Comment thread src/main/java/ch/njol/skript/sections/ExprSecFunction.java Outdated
@Efnilite Efnilite changed the title Mulitiline function calling Multiline function calling Aug 7, 2025
Comment thread src/main/java/ch/njol/skript/sections/ExprSecFunction.java Outdated
@Efnilite
Efnilite requested a review from Burbulinis August 11, 2025 19:42
@Efnilite
Efnilite marked this pull request as ready for review January 5, 2026 14:06
@Efnilite
Efnilite requested a review from a team as a code owner January 5, 2026 14:06
@Efnilite
Efnilite requested review from TheMug06 and removed request for a team January 5, 2026 14:06
Comment thread src/main/java/org/skriptlang/skript/common/sections/ExprSecFunction.java Outdated
@Efnilite
Efnilite requested a review from sovdeeth April 19, 2026 12:51
@skriptlang-automation skriptlang-automation Bot moved this to In Review in 2.16 Releases Apr 25, 2026
@sovdeeth

Copy link
Copy Markdown
Member

What do you think about opening up the section so that it's a normal section, and we just use set {_arg} to value? It wouldn't be quite so nice grammatically, but it would be more consistent in using the normal set effect, and give some more flexibility in assigning params.

# Conflicts:
#	src/main/java/org/skriptlang/skript/common/CommonModule.java
@Efnilite

Copy link
Copy Markdown
Member Author

What do you think about opening up the section so that it's a normal section, and we just use set {_arg} to value? It wouldn't be quite so nice grammatically, but it would be more consistent in using the normal set effect, and give some more flexibility in assigning params.

sounds good, would using variables here be ideal though? what do you think about using something like set argument "x" to value? imo it makes it more apparent you're setting the argument for the function. exact syntax is open to discussion ofc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature request, an issue about something that could be improved, or a PR improving something. functions Related to functions

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Allow for multi-line function inputs

5 participants