Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support bracketed function call in function definition #370

Merged
merged 3 commits into from
Jul 3, 2023

Conversation

Pangoraw
Copy link
Contributor

The following syntax:

function (f(a, b))
end

was interpreted as an anonymous function with 1 argument of name f(a,b).
This commits allows this syntax as a function f with two arguments.

This happened to me in the following case where the references to a
where resolved as global a (instead of as an argument):

function (a + b)
    a
end

Before (LanguageServer on neovim)

Screenshot from 2023-02-22 18-11-04

After (LanguageServer on neovim, highlighting by setting the cursor on the second b)

Screenshot from 2023-02-22 18-14-13

For every PR, please check the following:

Pangoraw and others added 2 commits February 22, 2023 18:14
The following syntax:

```julia
function (f(a, b))
end
```

was interpreted as an anonymous function with 1 argument of name `f(a,b)`.
This commits allows this syntax as a function `f` with two arguments.

This happened to me in the following case where the references to `a`
where resolved as global `a` (instead of as an argument):

```julia
function (a + b)
    a
end
```
@c42f
Copy link
Contributor

c42f commented Jul 1, 2023

Oh I just randomly came across this PR.

I had soo much trouble with the many allowed forms of function in JuliaSyntax.jl So I share your pain :-)

@pfitzseb pfitzseb merged commit b268a17 into julia-vscode:master Jul 3, 2023
40 of 52 checks passed
@Pangoraw Pangoraw deleted the bracketed_function_def branch July 3, 2023 11:42
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants