rock-core / vscode-rock

VSCode extension for Rock integration
MIT License
1 stars 1 forks source link

Initial version #2

Closed doudou closed 6 years ago

doudou commented 6 years ago

@g-arjones: some helpers that would probably be helpful for you. Ported from https://github.com/rock-core/atom-build-autoproj.

g-arjones commented 6 years ago

Absolutely! This saves me from a lot of work. How does the extension publishing work? Is it automatically available to the world when we push to master? If that's the case, we should probably have a 'develop' branch where we could review each others work and only merge into master when releasing makes sense.

doudou commented 6 years ago

How does the extension publishing work? Is it automatically available to the world when we push to master?

Nope, there's a manual step involved (need to run vcse publish).

g-arjones commented 6 years ago

Perfect... Thanks 👍

doudou commented 6 years ago

Updated with a bit more tooling, and the implementation of the autoproj build targets. Open any package from a workspace, and you'll get build/update/... targets for the whole workspace, and for the packages that are opened.

This is still crude, but alpha-level functional.

Missing:

Lessons learned:

g-arjones commented 6 years ago

I was going a slightly different path... For large projects, I am not sure if having one task for each folder in the workspace is a good idea (we end up with a lot of tasks). I think we should have build/update tasks for the currently open folder and a global, which builds/updates the whole workspace.

What do you think?

doudou commented 6 years ago

What do you think?

I think that I'd rather go the simple route (a.k.a. "the one I have already implemented") and refine later.

VSCode does show the most used targets first. Moreover, since we have to add the package's folder to their workspace, I assume that we won't end up with a lot of packages in a single workspace. This, added with the ability to filter the targets in the list, seem to me workable.

I have other ideas if this one ends up being not so great. One route would for instance to have a "${TARGET} Package ..." (e.g. "Update Package ...") that lets the user pick a package in a list and remember the last 3-4 targets. Interestingly, this would allow to use targets on packages that are not in the workspace.

g-arjones commented 6 years ago

I have other ideas if this one ends up being not so great. One route would for instance to have a "${TARGET} Package ..." (e.g. "Update Package ...") that lets the user pick a package in a list

I like this one..

Noticed a weird behavior here... Once I use a build task, it is gone from the task list and I can only run the "Force Build" tasks.

doudou commented 6 years ago

Once I use a build task, it is gone from the task list and I can only run the "Force Build" tasks.

I'll check that one out.

One major negative point for VSCode ... the output parsing is horribly limited. See https://github.com/Microsoft/vscode/issues/9635 (and a lot of its friends). Not a complete blocker, we could go the Atom route and create our own problem reporting extension, but worth mentioning.

doudou commented 6 years ago

Once I use a build task, it is gone from the task list and I can only run the "Force Build" tasks.

Caused by duplicate 'mode' field in 'definitions' ... Just pushed a fix. It's critical to have unique 'definition' objects.

(I moved my 'lessons learned' to the wiki, along with some info about autoproj/rock that might be useful for you).

g-arjones commented 6 years ago

I have noticed the output parsing thing when I was writing problem watchers for unit tests. Besides that, did you have anything else in mind that would require parsing multi line messages?

doudou commented 6 years ago

For reference:

g-arjones commented 6 years ago

Hmm... I didn't go that far. Seems like the situation is worse than I thought.

doudou commented 6 years ago

Working on VSCode itself is a major pain. Basically, the open-source vscode on github is the "OSS edition", which has none of the default extensions installed (partly because some of these extensions is not open source). So, after building the repo (which is OK), you're left with a bare-bone install - that can't even run extensions - and you have to manually install stuff, without the extension gallery.

doudou commented 6 years ago

(Note: I don't know how working on Atom is ...)

doudou commented 6 years ago

Besides that, did you have anything else in mind that would require parsing multi line messages?

Given how important those are, it would be enough. But anyways,

Having had a glimpse in the build/linter API of Atom, it raised the bar of "exception parsing" pretty high. Parsing is done in Javascript directly, and they have a hierarchical tree for the problem view. However, VSCode's expressiveness is even lower than the one of vim. That was not a bar very high to pass.

I've added some comments to the VSCode issues related to that ... let's see.

g-arjones commented 6 years ago

associate multiple file/lines to a single message/error (think backtrace of an exception) syskit loading errors are very often multi-line (with backtrace)

Those would be great to have in the problems tab but given vscode limitation, it will probably be very hard. The ruby extension itself does not parse backtraces as problems.

autoproj build builds multiple packages in parallel, so one has to regroup the messages per-package, and then parse them normally.

With the new multi-root workspace API isn't there a way to associate problems with a folder/project?

GCC's output is often hard enough for a human to parse so I really don't expect much in this regard and really have never seen a solution to this other than the usual "severity, file, line, message" parsing.

NOTE: This guy is able to parse this. Maybe we should have a look and how he is doing it...

doudou commented 6 years ago

GCC's output is often hard enough for a human to parse so I really don't expect much in this regard and really have never seen a solution to this other than the usual "severity, file, line, message" parsing.

Well, actually ... I did some prototyping on Atom to at least group suggestions with the error that is being suggested, it clears things up quite significantly already.

g-arjones commented 6 years ago

Sounds innovative to me.

Never mind my note in the previous comment, Catch allows to customize its output to make it easier to parse, that's probably what the extension is doing.

Another workaround would be to not use vscode's task service and register everything as commands instead, spawn the processes ourselves and parse the output. I have no idea how much work that is in TypeScript though..