minad / cape

🦸cape.el - Completion At Point Extensions
GNU General Public License v3.0
573 stars 20 forks source link

Add cape-keyword-web.el to support keyword completion on web-mode. #66

Closed jado4810 closed 1 year ago

jado4810 commented 1 year ago

Works with html-mode, css-mode and web-mode. Depends on cape-keyword.el for completion on JavaScript (script elems or ejs inline scripts), PHP (php inline scripts) or Ruby part (erb inline scripts) inside HTML in web-mode, so named "cape-keyword-web", not "cape-web".

Regards.

minad commented 1 year ago

Hey @jado4810, thanks for the proposal, but this goes way beyond the scope of Cape. Two suggestions:

What do you think?

minad commented 1 year ago

Maybe my second proposal is not good since you also support html/css mode. But I wonder why do you even have to support css-mode here since css-mode already comes with its own Capf builtin.

The most useful part in your PR from the perspective of Cape seems to be the html tag/attribute completion. I could consider adding this to Cape but it may make even more sense to add it to html-mode itself if you are willing to contribute upstream to Emacs itself.

jado4810 commented 1 year ago

it may make even more sense to add it to html-mode itself if you are willing to contribute upstream to Emacs itself.

It seems a good idea, however there are some difficulties on it cause html rules necessary for css completions (like attribute selectors), and vice versa (style elems). Of course, it may be able to do, but it would be troublesome to separate them.

Publish this as a separate package web-capf without a Cape dependency.

Sure, my capf have almost no linkage with cape-keyword.el even at this time, so it is more easy to republish it as an independent capf.

I'll consider this way. thanks.