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

Can't complete on < #20

Open
Compro-Prasad opened this issue Jun 16, 2018 · 11 comments
Open

Can't complete on < #20

Compro-Prasad opened this issue Jun 16, 2018 · 11 comments
Assignees

Comments

@Compro-Prasad
Copy link

I am using spacemacs where I want to complete when I type the < character. But it doesn't complete. The company-minimum-prefix-length for me is 1. So, I have to type an extra alphabet after < to get completion. How do I resolve this?
See: syl20bnr/spacemacs#8222

@Compro-Prasad
Copy link
Author

It might be unrelated to react layer which I don't use. But I tested this on an HTML file.

@osv
Copy link
Owner

osv commented Jun 21, 2018

I use spacemacs too
But my version is outdatted: 4bb4cb46 2017-11-01
For web-mode company-minimum-prefix-length is 0 for me. Maybe for you is 1 because of some perfomance issue. Try to set to 0 and check how perfomance decrased.

Few month ago there was performance issue for company-web and that is why they might decide to increase from 0 to 1 :). I'm closing this

@osv osv closed this as completed Jun 21, 2018
@osv osv reopened this Jun 21, 2018
@osv
Copy link
Owner

osv commented Jun 21, 2018

Ah, you are about react + company-web... I reopen, newer tried to work with react + company-web, need to check

@Compro-Prasad
Copy link
Author

No, spacemacs has the value 0 but I manually set company-minimum-prefix-length to 1.

@Compro-Prasad
Copy link
Author

It happens in a normal HTML file too.

@osv
Copy link
Owner

osv commented Jun 21, 2018

autocomplete

What exactly happens? you want autocomplete after < ? Than set company-minimum-prefix-length to 0

@Compro-Prasad
Copy link
Author

Compro-Prasad commented Jun 21, 2018

But I don't want to complete after >. Setting it to 0 means it will give me completion even after >.

@Compro-Prasad
Copy link
Author

Compro-Prasad commented Jun 21, 2018

company-clang can complete on ::, -> insertions irrespective of company-minimum-prefix-length. Why can't this package do it?

@osv
Copy link
Owner

osv commented Jun 25, 2018

@Compro-Prasad Ah, reason why autocomplete in any place even after > is because web-mode is designed for emmet mode too!.

In case if you are ok to work without emmet support in react layer we can update next function and add some switcher for disable emmet.

(defun company-web-html-emmet-grab ()
  (let* ((limit (company-web-backward-min-tag-bound))
         (bound (save-excursion
                  (if (re-search-backward ">" limit t)
                      (point)
                    limit))))
    (and company-web-html-emmet-enable
         (bound-and-true-p emmet-mode)
         (or
          (company-grab company-web-html-emmet-tag-regexp 1 bound)
          (company-grab company-web-html-emmet-class-regexp 2 bound)
          (company-grab company-web-html-emmet-id-regexp 2 bound)
          (company-grab company-web-html-emmet-attr-regexp 2 bound)
          (company-grab company-web-html-emmet-value-regexp 3 bound)))))

@osv
Copy link
Owner

osv commented Jun 25, 2018

I will add switcher soon. I think it should help you

@osv osv self-assigned this Jun 25, 2018
@Compro-Prasad
Copy link
Author

Compro-Prasad commented Aug 13, 2018

This is a bug IMO.

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

No branches or pull requests

2 participants