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

feat(texlab): add cancelBuild #2977

Closed

Conversation

DimitrisDimitropoulos
Copy link
Contributor

Add a command for the new workspace command of texlab for canceling the build, including the onSave ones. I think it is pretty useful. Thanks for your effort and help

if err then
error(tostring(err))
end
print 'Build cancelled'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use vim.notify() instead of print.

local function buf_cancel_build()
local texlab_client = util.get_active_client_by_name(0, 'texlab')
if texlab_client then
texlab_client.request('workspace/executeCommand', { command = 'texlab.cancelBuild' }, function(err)
Copy link
Member

Choose a reason for hiding this comment

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

isn't workspace/executeCommand part of the LSP spec? should this use :help vim.lsp.commands ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the reply and the suggestion. Reading the docs on the vim.lsp.commands I too think it should be used here. However, the docs were not very helpful on how to implement it, even looking at the source code in neovim i could not get it to work. Moreover, i found another implementation with the request in the following part from the es-lint config. I could really use some help regarding how to proceed, thanks in advance.

Copy link
Member

Choose a reason for hiding this comment

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

Hoping that @glepnir can help.

i found another implementation with the request in the following part from the es-lint config.

Perhaps that pattern can be lifted into util.lua in this repo. We need to avoid copy-pasting lots of code in all of these configs.

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

Successfully merging this pull request may close these issues.

3 participants