Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

(js) Async arrow function should be highlighted as function #3405

Closed
jebarjonet opened this issue Nov 21, 2021 · 5 comments · Fixed by #3414
Closed

(js) Async arrow function should be highlighted as function #3405

jebarjonet opened this issue Nov 21, 2021 · 5 comments · Fixed by #3414
Labels
bug help welcome Could use help from community language

Comments

@jebarjonet
Copy link

jebarjonet commented Nov 21, 2021

Describe the issue
Async arrow function should be highlighted as function, instead it is not highlighted at all. This is the most used shape for functions in modern Javascript syntax (instead of function name() {})

Which language seems to have the issue?
js / ts

Are you using highlight or highlightAuto?
highlight specifically asking for javascript language

Sample Code to Reproduce

In the examples below, init is a function name. The function is declared as arrow function in Javascript.

✅ Example without async (works well) :

const init = () => {
  // something
}

Screen Shot 2021-11-21 at 22 31 56

Screen Shot 2021-11-21 at 22 31 56

❌ Example with async (does not recognize function name) :

const init = async () => {
  // something
}

Screen Shot 2021-11-21 at 22 32 35

Screen Shot 2021-11-21 at 22 32 30

Expected behavior
The presence or absence of async should not change function identification. In the example above, init should be colored blue in both cases.

@jebarjonet jebarjonet added bug help welcome Could use help from community language labels Nov 21, 2021
@joshgoebel
Copy link
Member

joshgoebel commented Nov 29, 2021

Please provide textual examples that can be easily cut and paste in addition to images.

@jebarjonet
Copy link
Author

@joshgoebel done ✅

@joshgoebel
Copy link
Member

Can async we used with the old syntax at all?

@jebarjonet
Copy link
Author

Sure, like so :

// not async
function myFunction() {
  // ...
}

// async
async function myFunction() {
  // ...
}

Thank you very much for your reactivity ! 🥇

@joshgoebel
Copy link
Member

Which we already support because it's just a keyword there that needs no special coding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants