293b98151a
Auto completion menu triggers too frequently in react-mode, for example, the completion menu will pop up right after user finishes typing a javascript statement. The root cause is that the 'company-minimum-prefix-length variable has been set to 0 in "html" layer, which is used by "react" layer. Overriding this variable to 2, as defined in "auto-completion" layer, will resolve this issue.
27 lines
881 B
EmacsLisp
27 lines
881 B
EmacsLisp
;;; funcs.el --- React Layer functions File for Spacemacs
|
||
;;
|
||
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
||
;;
|
||
;; Author: Muneeb Shaikh <muneeb@reversehack.in>
|
||
;; URL: https://github.com/syl20bnr/spacemacs
|
||
;;
|
||
;; This file is not part of GNU Emacs.
|
||
;;
|
||
;;; License: GPLv3
|
||
|
||
|
||
;; react mode
|
||
|
||
(defun spacemacs//setup-react-mode ()
|
||
"Adjust web-mode to accommodate react-mode"
|
||
(emmet-mode 0)
|
||
;; See https://github.com/CestDiego/emmet-mode/commit/3f2904196e856d31b9c95794d2682c4c7365db23
|
||
(setq-local emmet-expand-jsx-className? t)
|
||
;; Enable js-mode snippets
|
||
(yas-activate-extra-mode 'js-mode)
|
||
;; Force jsx content type
|
||
(web-mode-set-content-type "jsx")
|
||
;; Don't auto-quote attribute values
|
||
(setq-local web-mode-enable-auto-quoting nil)
|
||
;; See https://github.com/syl20bnr/spacemacs/issues/8222
|
||
(set (make-local-variable 'company-minimum-prefix-length) 2))
|