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

[WIP] @feature: "cargo check"-inspector for the rust bundle #464

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bugabinga
Copy link
Contributor

No description provided.

This adds an "on_idle" inspector in the rust bundle, that calls
`cargo check` and parses the output json for warning and errors.
It was necessary to extend `inspect.moon` to accept options for
enabling/disabling stdout/stderr because cargo sends the json
to stdout and some other non-json to stderr.
This produced a bug in `activities.moon` where the pump-methods
of the process always received a `on_stdout` and a `on_stderr`
handler, regardless of the existence of a `stdout` or `stderr`
object respectivly in the process.
The fix simply checks for the existence of these objects and
omits passing the respective handler if the output stream does
not exist.
This adds an "on_idle" inspector in the rust bundle, that calls
`cargo check` and parses the output json for warning and errors.
It was necessary to extend `inspect.moon` to accept options for
enabling/disabling stdout/stderr because cargo sends the json
to stdout and some other non-json to stderr.
This produced a bug in `activities.moon` where the pump-methods
of the process always received a `on_stdout` and a `on_stderr`
handler, regardless of the existence of a `stdout` or `stderr`
object respectivly in the process.
The fix simply checks for the existence of these objects and
omits passing the respective handler if the output stream does
not exist.
@bugabinga bugabinga changed the title @feature: "cargo check"-inspector for the rust bundle [WIP] @feature: "cargo check"-inspector for the rust bundle Aug 27, 2018
@bugabinga
Copy link
Contributor Author

add "work in progress" label, because I have encountered a bug that I will fix.
@nilnor Is this feature of interest to you?

…s return `nil`.

`Cargo check` returns issues with a list of "spans", that hold position information
about the issue in the text buffer. Since a spans "label" (message) is optional,
a fallback to the parent issues message was added.
@nilnor
Copy link
Contributor

nilnor commented Oct 17, 2018

@bugabinga I believe we talked about this on Gitter, but I see this as useful. Remove the WIP label when you feel it's ready for review.

@bugabinga
Copy link
Contributor Author

I still try to fix this from time to time, but regularly hit a wall.

There is a bug blocking this:

  • inspections get appended to the popup list on every buffer-inspect

Hopefully you will find some time to whip up some docs about how bundles are supposed to get built ;).

@zesterer
Copy link

Has these been any progress on this? Seems like a very useful feature. I've not used Moon before, but I'm happy to try my hand at fixing the remaining issue if explained a little further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants