Skip to content

Top-level jsx elements cannot be uncommented #29

@desi-belokonska

Description

@desi-belokonska
comment-issue.mov

Problem

Commenting inner jsx elements works fine, but when doing it on the top-level element it only works the first time - every subsequent toggling just uses the default // comment.

Possible source

Did some digging - the function

function M.get_node_at_cursor_start_of_line(only_languages, winnr)

returns a <node jsx_opening_element> the first time and it correctly comments it out with {/* %s */}. When trying to uncomment, however, it returns a <node object>, possibly because it recognizes the { as the start of an object.
Hope this helps!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions