Skip to content

Conversation

@tigersoldier
Copy link
Contributor

If the server provides trigger characters and the point is after one of them,
set :company-prefix-length to t so that company-capf always shows completion
candidates regardless the actual length of the prefix (which is likely to be 0).

If the server provides trigger characters and the point is after one of them,
set :company-prefix-length to t so that company-capf always shows completion
candidates regardless the actual length of the prefix (which is likely to be 0).
@bkchr
Copy link
Contributor

bkchr commented Oct 25, 2017

Works for me :)

@vibhavp anything against merging? :)

@vibhavp
Copy link
Member

vibhavp commented Oct 25, 2017

No issues as such, but this ends up adding a soft dependency on company-mode, right?

@bkchr
Copy link
Contributor

bkchr commented Oct 25, 2017

You mean that it only works with company? Yeah you are probably right. Maybe the annotation could be made configurable

@tigersoldier
Copy link
Contributor Author

@vibhavp It does provide company-only feature, since trigger character doesn't make sense to completion-at-point.

@bkchr I'm on the fence whether to add a custom variable to toggle it. It doesn't take much time to get the trigger characters. IMO it's not a good experience to have a long list of customizable settings for every tiny details.

@bkchr
Copy link
Contributor

bkchr commented Oct 26, 2017

@tigersoldier I came across your https://github.com/tigersoldier/company-lsp project. I think, if that supports the trigger characters for company, it is okay to not merge the feature into lsp-mode directly.
While looking over your code, I saw that some functionality like:
(advice-add 'lsp--parser-on-message :after 'company-lsp--on-message)
Could be integrated into lsp-mode by providing a hook instead of hacking into the process.

@sebastiencs
Copy link
Member

sebastiencs commented Oct 26, 2017

While looking over your code, I saw that some functionality like:
(advice-add 'lsp--parser-on-message :after 'company-lsp--on-message)
Could be integrated into lsp-mode by providing a hook instead of hacking into the process.

@bkchr My fault, I've wrote that functionality.
I didn't know the code of lsp-mode enough to make a PR to support async.
But it seems that there is now a PR for this purpose: #138

@bkchr
Copy link
Contributor

bkchr commented Oct 26, 2017

@sebastiencs yeah no problem! :) Just thought loud about how the projects could be working together :)

@tigersoldier
Copy link
Contributor Author

@bkchr I agree both projects can work better together and would love to push features upstream. Just wanted to get the feature landed quickly so I can use it :)

Back to the topic of this PR. My original plan was to implement all company-related feature here and just deprecate company-lsp in favor of company-capf. Now company-lsp is implementing some features that are hard to port to completion-at-point-function (e.g async completion, post-completion actions), the original goal is no longer feasible.

Let's close this PR.

@vibhavp
Copy link
Member

vibhavp commented Oct 27, 2017

@tigersoldier I've added support for async requests in b56a06e. If that helps, company-lsp should use it instead of advising internal functions.

@tigersoldier
Copy link
Contributor Author

Sure, I'll update it.

wkirschbaum pushed a commit to wkirschbaum/lsp-mode that referenced this pull request Jun 1, 2021
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.

4 participants