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

Show a progress indicator for building documentation #82

Closed
connorshea opened this issue Oct 11, 2018 · 8 comments
Closed

Show a progress indicator for building documentation #82

connorshea opened this issue Oct 11, 2018 · 8 comments

Comments

@connorshea
Copy link

Right now when you run Solargraph: Build new gem documentation or Solargraph: Rebuild gem documentation, there's no indication of what the command is doing or if it's even running. This is super annoying, especially since it can take a few minutes for the docs to be generated.

Would it be possible to show what the number of gems that it's generated docs for, e.g. something like Documentation generated for 43/87 gems.

Thanks for the extension! :)

@connorshea
Copy link
Author

So I looked at the commit that added this feature: 03a74dc

yard gems --rebuild --verbose provides a lot of info but parsing it would probably be a pain. That said, it takes a really long time for the command to run, so a progress indicator would still be nice. Even just a status bar indicator that said something like "Rebuilding documentation...". If more info could also be send to the developer tools that'd be useful as well.

@connorshea
Copy link
Author

connorshea commented Oct 11, 2018

(For someone's future reference, probably: if your documentation generation is failing on mail you need to upgrade yard to at least 0.9.16: lsegal/yard#1176)

Actually, there's already a line to set a status message like this, so why isn't working 🤔 It's lacking a semicolon, but I doubt that's the actual problem.

var disposableStatus = vscode.window.setStatusBarMessage('Building new YARD documentation...')

I tried disabling all other extensions, and my status bar is definitely enabled. (I can't find any settings I would have set that would effect this, and status bar messages show fine for when the server is booting).

EDIT: This code isn't in master, so that'd be why this isn't showing up :D Why was it removed in the first place?

@castwide
Copy link
Owner

Progress indicators would be a great feature for long-running commands. It's a little tricky to implement because it has to be custom-built in both the server and the client. The language server protocol doesn't have a specification for it, although there's a proposal at microsoft/language-server-protocol#70

Status bar notifications at the start and end of a process are a little easier. The current extension provides them for server initialization: "Starting the Solargraph language server" when it starts, and "Solargraph is ready" when it's finished. That process includes the preliminary mapping of the entire workspace, so it can take a while for large projects. (castwide/solargraph takes about 10 seconds on my desktop. rails/rails takes about 45).

The notification you found for building yardocs was removed because of drastic changes in the way those commands are implemented. The process gets executed by the server instead of the extension.

I'm not sure if or when I'll be able to implement progress indicators, but I can at least get those status bar notifications back. I'll add it to the roadmap.

@castwide
Copy link
Owner

Status bar notifications for gem documentation is in the master branch. It requires an update to the gem, which is currently in the castwide/solargraph gem-build-result branch. After the gem update is released, I expect to publish the extension update in version 0.18.0.

@castwide
Copy link
Owner

castwide commented Dec 5, 2018

Version 0.18.0 includes status notifications when gem documentation starts and finishes. It should work with the latest gem.

@connorshea
Copy link
Author

Thank you! ❤️ I’ll try testing it once I get into work later today.

@connorshea
Copy link
Author

It looks like it works, although I ran into an error while building gem documentation :D I assume it has to do with the mail gem again.

It’d be nice if there were a button in the error notification that linked to the console (though if I remember correctly the last error was only visible in the developer tools, which you probably can’t/don’t want to link to).

@castwide
Copy link
Owner

castwide commented Dec 5, 2018

Just tried it a few times. I got an error once, but it worked as expected the rest of the time. I'll see if I can narrow the problem down to a reproducible cause.

One minor bug, the extension doesn't dispose of the "Rebuilding all..." message after rebuilding all gem documentation. It works correctly when building new gem documentation only. I'll add a fix to the next patch release.

@castwide castwide closed this as completed May 9, 2019
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

2 participants