Cannot declare multiline function
See original GitHub issueI’m not sure what I’m missing from the readme, but I cannot seem to able to define multiline functions.
Given:
let bla = (one, two) ->
console.log one
console.log two
It compiles to:
let bla = function(one, two) {}
console.log(one)
console.log(two)
There is just a single line break after ->
and the indentation is the same on the 2nd and 3rd line.
I’m using the VSC extensions, so the language server is already displaying me an error before compilation, saying
Cannot find name 'one'
Changing it to an arrow function:
let bla = (one, two) =>
console.log one
console.log two
Results in:
let bla = (one, two) =>
console.log(one)
console.log(two)
Here’s the same with types:
let bla = (one: string, two: string) =>
console.log one
console.log two
It turns to:
let bla = (one: string, two: string) =>
console.log(one)
console.log(two)
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Unable to declare multiline string in JS File with ES6 format
I am trying to declare multiline string variable in a JS file. However it seems that Karate won't let me to declare the...
Read more >Multiline Functions - General - RStudio Community
I am doing something wrong when I try to create a function. I enter. I want to enter "myfunc3 <- variable(a) {" and...
Read more >Working of Python Multiline String with Examples - eduCBA
Firstly, we will see how to declare a multiline string in Python having a newline character using triple quotes along with examples. Example:...
Read more >[PSR-12] Function declarations with multiline arguments AND ...
I cannot find an answer to this question: what should a function/method declaration look like if it has arguments that are split over...
Read more >Allow blank lines between multi-line function arguments #3323
I read through the exact definition in PSR12 and it does not state that there cannot be blank lines between function arguments -...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks Daniel, really helpful! Read the readme like 5 times but I missed that 😄
+1 for optional assignment, I never understood why it’s not a thing in typescript and it’s always a big bummer conditional assignment is also very nice!
Civet has a really, really bright future 🌈
Works great, thank you!