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

JavaScript: destructural binding #1112

Open
techee opened this issue Sep 6, 2016 · 3 comments · May be fixed by #3435
Open

JavaScript: destructural binding #1112

techee opened this issue Sep 6, 2016 · 3 comments · May be fixed by #3435
Assignees

Comments

@techee
Copy link
Contributor

techee commented Sep 6, 2016

When playing with various languages I ran into this warning for this file:

https://github.com/facebook/react/blob/master/src/renderers/shared/fiber/ReactFiberBeginWork.js

It looks the code doesn't like lines like

var { findNextUnitOfWorkAtPriority } = require('ReactFiberPendingWork');

and the warning comes from

https://github.com/universal-ctags/ctags/blob/master/parsers/jscript.c#L1778

because the name tag isn't checked whether it's an identifier or something else - it's probably { in this case.

Not a js developer myself so leaving this to someone who knows the correct syntax.

@masatake masatake changed the title javascript: ignoring null tag warning javascript: destructural binding Apr 14, 2020
@Strangehill
Copy link

Strangehill commented Apr 14, 2020

I also get this warning with array destructuring, i.e. this pattern :
const [lang, setLang] = useState("en")

@masatake
Copy link
Member

#2115
I found I tried to fix this issue once.
e977d56

Though I opened the pull request, the way to fix the issue in the pull request looks a bit tricky for me.
In addition, as @Strangehill wrote, the fix doesn't handle the array destructuring.

I will fix this but I cannot say when. I have to finish rewriting R parser.

See also #2494.

@masatake masatake changed the title javascript: destructural binding JavaScript: destructural binding Jul 5, 2022
masatake added a commit to masatake/ctags that referenced this issue Jul 5, 2022
Related to universal-ctags#900, universal-ctags#1112, and universal-ctags#3427.

When the parser tries making a tag with empty name, an assertion
in registerEntry fails. The parser side should be fixed but it
will take a time. This change puts guard conditions around
registerEntry to avoid the failures.

THIS IS A TEMPORARILY SOLUTION.

Signed-off-by: Masatake YAMATO <[email protected]>
@masatake masatake self-assigned this Jul 9, 2022
@masatake
Copy link
Member

masatake commented Jul 9, 2022

I'm working on this item.
The code in my PC partially works.

$ cat /tmp/foo.js
cat /tmp/foo.js
var [a, b, ...rest] = [1, 2, 3];
$ ./ctags -o - /tmp/foo.js 
./ctags -o - /tmp/foo.js 
a	/tmp/foo.js	/^var [a, b, ...rest] = [1, 2, 3];$/;"	v
b	/tmp/foo.js	/^var [a, b, ...rest] = [1, 2, 3];$/;"	v
rest	/tmp/foo.js	/^var [a, b, ...rest] = [1, 2, 3];$/;"	v
$ 

masatake added a commit to masatake/ctags that referenced this issue Jul 9, 2022
@masatake masatake linked a pull request Jul 9, 2022 that will close this issue
4 tasks
masatake added a commit to masatake/ctags that referenced this issue Jul 10, 2022
masatake added a commit to masatake/ctags that referenced this issue Aug 26, 2022
masatake added a commit to masatake/ctags that referenced this issue Jan 12, 2023
masatake added a commit to masatake/ctags that referenced this issue Nov 17, 2023
masatake added a commit to masatake/ctags that referenced this issue Mar 9, 2024
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 a pull request may close this issue.

4 participants