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

Linter crashes with missing range #32

Open
bjorn-einar-bjartnes-4ss opened this issue Aug 28, 2021 · 0 comments
Open

Linter crashes with missing range #32

bjorn-einar-bjartnes-4ss opened this issue Aug 28, 2021 · 0 comments

Comments

@bjorn-einar-bjartnes-4ss
Copy link

bjorn-einar-bjartnes-4ss commented Aug 28, 2021

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...

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

No branches or pull requests

1 participant