Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Support error reporting for missing props #47

Closed
wants to merge 4 commits into from

Conversation

joarwilk
Copy link

@joarwilk joarwilk commented Oct 21, 2016

In general, support error reporting in all ranges when a message points to more than one file.

screen shot 2016-10-21 at 13 32 07

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions.

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@joarwilk
Copy link
Author

@gabelevi Any comments on this?

Copy link
Contributor

@gabelevi gabelevi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not terribly familiar with this code, but I made a pass. It looks good to me, and the behavior you're adding seems like a great change to make! I'm requesting changes for that one potential exception, but once that's fixed I'll merge.

Thanks for the PR!

let details = [];
other.forEach(part => {
let partMsg = part.descr;
if (partMsg && partMsg !== 'null' && partMsg !== 'undefined') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird - why is it checking for the strings 'null' and 'undefined'?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, honestly...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error reporter in Nuclide doesn't have this check so I think it's safe to remove it.

diags[message.file] = [];
}

message.msg = description.reduce((full, descr, i, arr) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like description can be an empty array, which means this might throw an exception. Maybe only call reduce if arr description is non-empty?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good catch

@orta
Copy link
Contributor

orta commented Dec 6, 2016

Given this a shot - looks good, should be good to merge IMO

screen shot 2016-12-06 at 15 52 14

Ideally we need support in VS Code for something like microsoft/vscode#10271 - but we could live with microsoft/vscode#1927

@joarwilk
Copy link
Author

joarwilk commented Dec 6, 2016

Quick note: a similar PR was rejected in Nuclide.

Here's the reasoning: facebookarchive/nuclide#845 (comment)

@davidmfoley
Copy link

Will this be merged or is it dead?

@joarwilk
Copy link
Author

I'm assuming it's dead

@joarwilk joarwilk closed this May 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants