Skip to content

An empty line should be able to generate a RangeLink #683

Description

@couimet

I wanted to run R-L on a selected empty line and got a "Failed to generate link" error toast; I should have gotten a #L12 link sent to destination.

Logs from real-life:

[DEBUG] {"fn":"SelectionValidator.validateSelectionsAndShowError","hasEditor":true,"selectionCount":1,"selections":[{"index":0,"start":{"line":12,"char":0},"end":{"line":13,"char":0},"isEmpty":false}],"documentVersion":1,"documentLineCount":32,"documentIsDirty":false,"documentIsClosed":false} Selection validation starting
[DEBUG] {"fn":"toInputSelection","selectionCount":1,"documentVersion":1,"documentLineCount":32,"inputSelections":[{"index":0,"start":{"line":12,"char":0},"end":{"line":13,"char":0},"isEmpty":false}]} Converting VSCode selections to InputSelection
[DEBUG] {"fn":"toInputSelection","isRectangular":false,"outputSelections":[{"index":0,"start":{"line":12,"character":0},"end":{"line":12,"character":0},"coverage":"FullLine"}],"selectionType":"Normal"} Selection conversion complete
[ERROR] {"fn":"generateLinkFromSelections","error":{"code":"SELECTION_ZERO_WIDTH","functionName":"validateInputSelection","details":{"selectionIndex":0,"line":12,"character":0},"name":"RangeLinkError"}} Failed to generate link
[ERROR] {"fn":"generateLinkFromSelection","error":{"code":"GENERATE_LINK_FORMAT_FAILED","functionName":"generateLinkFromSelections","cause":{"code":"SELECTION_ZERO_WIDTH","functionName":"validateInputSelection","details":{"selectionIndex":0,"line":12,"character":0},"name":"RangeLinkError"},"name":"RangeLinkExtensionError"},"linkType":"regular"} Failed to generate link
[DEBUG] {"fn":"VscodeAdapter.showErrorMessage","message":"Failed to generate link"} Showing error message

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions