fxbois / web-mode

web template editing mode for emacs
https://web-mode.org
GNU General Public License v3.0
1.63k stars 262 forks source link

No highlighting in .blade.php file using engine blade #1283

Closed leafarbelm closed 10 months ago

leafarbelm commented 10 months ago

When i open a .blade.php file i don't get the correct highlight: image

when i start a new file it highlights correct but when i try to reopen the file i have this issue.

I tried to have only web-mode in my config but no luck

my current config:

(use-package web-mode
  :elpaca (:host github :repo "fxbois/web-mode")
  :mode (("\\.html?\\'" . web-mode)
         ("\\.blade\\.php\\'" . web-mode)
         ("\\.vue\\'" . vue-mode))
  :custom
  (web-mode-engines-alist
   '(("blade"  . "\\.blade\\.")))
  :config
  (setf (alist-get "javascript" web-mode-comment-formats nil nil #'equal) "//")
  :custom
  (web-mode-markup-indent-offset 2)
  (web-mode-css-indent-offset 2)
  (web-mode-code-indent-offset 2)
  (web-mode-block-padding 2)
  (web-mode-comment-style 2)
  (web-mode-enable-heredoc-fontification t)
  (web-mode-enable-auto-quoting t)
  (web-mode-enable-auto-closing t)
  (web-mode-enable-css-colorization t)
  (web-mode-enable-auto-pairing t)
  (web-mode-enable-comment-keywords t)
  (web-mode-enable-current-element-highlight t)
  (web-mode-enable-auto-indentation t)
  (web-mode-enable-current-column-highlight t))

code for reference:

@php
use Illuminate\Support\Facades\Auth;
@endphp

@section('content')
  <div>
  @if(Auth::user()->access === 'Admin')
  <div class="text-white">

      </div>
    @endif
  </div>
@endsection
--- WEB-MODE DEBUG BEG ---
versions: emacs(30.0) web-mode("17.3.14")
vars: engine("blade") minor("blade") content-type("html") file("/tmp/asdasd.blade.php")
system: window(x) config("x86_64-pc-linux-gnu")
colors: fg(nil) bg(nil) 
minor modes: (visual-line-mode global-visual-line-mode show-paren-mode global-eldoc-mode override-global-mode elpaca-use-package-mode subword-mode global-subword-mode pixel-scroll-precision-mode repeat-mode savehist-mode global-auto-revert-mode windmove-mode doom-modeline-mode corfu-mode global-corfu-mode corfu-popupinfo-mode corfu-history-mode vertico-mode marginalia-mode persp-mode brazilian-holidays-mode global-treesit-auto-mode emms-playing-time-mode emms-playing-time-display-mode emms-mode-line-mode emms-mode-line-cycle mpvi-emms-integrated-mode org-edna-mode org-super-agenda-mode persistent-scratch-autosave-mode hl-todo-mode electric-pair-mode hl-line-mode winner-mode denote-rename-buffer-mode citar-denote-mode telega-active-stories-mode telega-patrons-mode telega-active-locations-mode telega-active-video-chats-mode telega-root-auto-fill-mode server-mode jinx-mode global-jinx-mode which-key-mode mu4e-modeline-mode mu4e-column-faces-mode emmet-mode global-git-commit-mode)
vars:
web-mode-enable-current-column-highlight=t 
web-mode-enable-current-element-highlight=t 
indent-tabs-mode=nil 
--- WEB-MODE DEBUG END ---

EDIT: i pin the package to version 17 and its working fine now

fxbois commented 10 months ago

I don't understand

leafarbelm commented 10 months ago

Sorry for the inconvenience, my problem was that the highlight was not working when opening a file with the extension .blade.php but it seems that downloading version 17 of the package solved it.

maybe it was a problem with my configuration but it was strange because it was working and stopped a few days ago.

Thanks for the great package.