Function: web-mode-scan-region

web-mode-scan-region is a natively compiled function defined in web-mode.el.

Signature

(web-mode-scan-region BEG END &optional CONTENT-TYPE)

Documentation

Identify nodes/parts/blocks and syntactic symbols (strings/comments/etc.).

Source Code

;; Defined in /nix/store/2qgnz1rp30nzfz6w0apx4kdm14if1bbs-emacs-packages-deps/share/emacs/site-lisp/elpa/web-mode-20260831.219/web-mode.el
(defun web-mode-scan-region (beg end &optional content-type)
  "Identify nodes/parts/blocks and syntactic symbols (strings/comments/etc.)."
  ;;(message "scan-region: beg(%d) end(%d) content-type(%S)" beg end content-type)
  (setq web-mode-scan-beg beg
        web-mode-scan-end end)
  (with-silent-modifications
   (save-excursion
     (save-restriction
       (save-match-data
         (let ((inhibit-point-motion-hooks t)
               (inhibit-quit t))
           (remove-list-of-text-properties beg end web-mode-scan-properties)
           (cond
             ((and content-type (string= content-type "php"))
              )
             ((and content-type (member content-type web-mode-part-content-types))
              (put-text-property beg end 'part-side
                                 (cond
                                   ((string= content-type "javascript") 'javascript)
                                   ((string= content-type "json") 'json)
                                   ((string= content-type "jsx") 'jsx)
                                   ((string= content-type "css") 'css)
                                   ((string= content-type "sql") 'sql)
                                   ((string= content-type "pug") 'pug)
                                   ((string= content-type "sass") 'sass)
                                   ((string= content-type "stylus") 'stylus)
                                   ((string= content-type "markdown") 'markdown)
                                   ((string= content-type "ruby") 'ruby)
                                   ((string= content-type "typescript") 'typescript)
                                   ))
              (web-mode-scan-blocks beg end)
              (web-mode-part-scan beg end content-type))
             ((member web-mode-content-type web-mode-part-content-types)
              (web-mode-scan-blocks beg end)
              (web-mode-part-scan beg end))
             ((string= web-mode-engine "riot")
              (web-mode-scan-elements beg end)
              (web-mode-scan-blocks beg end)
              (web-mode-part-foreach beg end 'web-mode-part-scan))
             (t
              (web-mode-scan-blocks beg end)
              (web-mode-scan-elements beg end)
              (web-mode-part-foreach beg end 'web-mode-part-scan))
             ) ;cond
           (cons beg end)
           ))))))