fmontesi / linter-jolie

A Jolie linter for Atom (via Atom Linter)
MIT License
1 stars 1 forks source link

Strange error #8

Open bmaschio opened 7 years ago

bmaschio commented 7 years ago

@Arcanemagus @fmontesi

I got this strange error started this morning

image

image

I am not sure line 141 is refereed to what file

Regards Balint

bmaschio commented 7 years ago

@fmontesi I think I figure it out were the problem is

If I include twice the standard library in this case time.iol and run the jolie --check it gives me the following error

image

And I think that when Jolie Linter calls function rangeFromLineNumber ( LinterAtom index.js ) the function buffer.getLineCount() returns the number of lines of the files currently opened I suppose would help checking the file of the error like

                if  editor.getPath() isnt issue.filePath
                    lineStart = 1

Thanks Balint

Arcanemagus commented 7 years ago

@fmontesi When fixing this you could take a similar approach to what's been done in project scoped linter providers in AtomLinter:

That way you get the best of both worlds: The ability to generate a range for any file, and if the user has it open then a "proper" range is created.