<commit_before>(defun /lsp/activate ()
  (interactive)

  (require-package 'lsp-mode)
  (require-package 'lsp-ui)
  (require-package 'company-lsp)

  (setq lsp-prefer-flymake nil) ;; use flycheck
  (setq lsp-session-file (concat dotemacs-cache-directory ".lsp-session-v1"))
  (setq lsp-keep-workspace-alive nil)

  (setq lsp-ui-doc-include-signature t)
  (setq lsp-ui-doc-header t)

  (lsp))

(defun /lsp/suggest-project-root ()
  "Suggests the nearest project that is not a dependency."
  (locate-dominating-file
   (buffer-file-name)
   (lambda (dir)
     (if (string-match-p "node_modules" dir)
         nil
       (file-exists-p (concat dir "package.json"))))))

(after 'lsp-mode
  (advice-add #'lsp--suggest-project-root :override #'/lsp/suggest-project-root))

(provide 'config-lsp)
<commit_msg>fallback to projectile for non-node projects<commit_after>(defun /lsp/activate ()
  (interactive)

  (require-package 'lsp-mode)
  (require-package 'lsp-ui)
  (require-package 'company-lsp)

  (setq lsp-prefer-flymake nil) ;; use flycheck
  (setq lsp-session-file (concat dotemacs-cache-directory ".lsp-session-v1"))
  (setq lsp-keep-workspace-alive nil)

  (setq lsp-ui-doc-include-signature t)
  (setq lsp-ui-doc-header t)

  (lsp))

(defun /lsp/suggest-project-root ()
  "Suggests the nearest project that is not a dependency."
  (or
   (locate-dominating-file
    (buffer-file-name)
    (lambda (dir)
      (if (string-match-p "node_modules" dir)
          nil
        (file-exists-p (concat dir "package.json")))))
   (projectile-project-root)))

(after 'lsp-mode
  (advice-add #'lsp--suggest-project-root :override #'/lsp/suggest-project-root))

(provide 'config-lsp)

{'fraction_non_alphanumeric': 0.15582089552238806, 'fraction_numerical': 0.0011940298507462687, 'mean_word_length': 3.481283422459893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6095667', 'n_tokens_mistral': 652, 'n_tokens_neox': 629, 'n_words': 129}