Closed LaloHao closed 5 years ago
Took me a while to reverse engineer but i learned something about emacs' syntax tables!
(defun setup/ts-comments ()
(modify-syntax-entry ?/ ". 14")
(modify-syntax-entry ?* ". 23")
(setq-local comment-start "/**")
(setq-local comment-end "*/")
(setq-local poporg-comment-skip-regexp " *\\* *")
(setq-local poporg-delete-trailing-whitespace nil))
(add-hook 'typescript-mode-hook #'setup/ts-comments)
(add-hook 'typescript-tsx-mode-hook #'setup/ts-comments)
Thanks for the package
Thanks! This should be helpful for other people.
How does poporg find what to delete when running
M-x poporg-dwim
?On
C-h m
Both of these styles work (notice the doubled
**
at the start of coment on the second one.)But practically all of javascript modes (js/jsx/ts/tsx) fail to parse and remove the comment-only parts:
Gives me this buffer when running
M-x poporg-dwim
:On both of these modes
poporg-comment-skip-regexp
is set to[[:space:]*]*"
What would be the correct approach to finding the cause of this?
Thanks in advance