Skip to content

Linter crashes with missing range #32

Open
@bjorn-einar-bjartnes-4ss

Description

Problem description

I am not sure why it fails, because it only failed like this on some machines, and from what I can see the setup was identical. However, this error occured on all our work laptops, not sure why it fails on only some machines yet...

image

RangeMustbeSet

Workaround

I "fixed" it and verifies that the plugin runs when I replace
the https://github.com/Mermade/openapi-lint-vscode/blob/master/extension.js#L147 and https://github.com/Mermade/openapi-lint-vscode/blob/master/extension.js#L194

            let range; // TODO 

with

            let p1 = new vscode.Position(0,0);
            let p2 = new vscode.Position(0,0);
            let range = new vscode.Range(p1,p2); 

but I want to dig a little more into it before submitting a PR. When it fails, it is already inside an exception handler so there are no errors visible to the in VS Code, the plugin just does not work. This "fix" made it work again by printing the errors on position 0, I guess a better fix is to actually try to make the range either the error or the entire document...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions