Skip to content

No comment injection for latex grammar #4921

Closed
@epbuennig

Description

@epbuennig

Summary

Currently, the injection of comment highlights which add highlights such as #1234 for issue numbers @username for usernames and perhaps most importantly TODO and friends for comments related to bugs and todos are not correctly injected for LaTeX.

It seems that this was partially fixed in #4528, however I noticed that the highlights.scm query for LaTeX also mentions comment_environment and block_comment, and if we highlight those as comments then we also want comment injections for them.

Reproduction Steps

I tried this:

  1. Create a file like this:
\begin{document}
	Lorem Ipsum
\end{document}


\begin{comment}
	comment invironment
	FIXME: lorem @username ipsum #12333
\end{comment}


\iffalse
	block comment
	FIXME: lorem @username ipsum #12333
\fi


% line comment
% FIXME: lorem @username ipsum #12333
  1. hx <file>

I expected this to happen:
Things such as TODO or @username are highlighted as for languages like rust or bash for all comment types.

Instead, this happened:
Things such as TODO or @username are only highlighted for line_comments on master and not at all on stable.

Helix log

~/.cache/helix/helix.log
2022-11-28T11:50:14.937 helix_view::theme [WARN] Theme: malformed hexcode: fg
2022-11-28T11:50:14.941 helix_view::editor [ERROR] Failed to initialize the LSP for `source.tsq` { LSP not defined }
2022-11-28T11:51:06.674 helix_view::theme [WARN] Theme: malformed hexcode: fg
2022-11-28T11:51:06.680 helix_view::editor [ERROR] Failed to initialize the LSP for `source.tsq` { LSP not defined }
2022-11-28T11:51:58.949 helix_view::theme [WARN] Theme: malformed hexcode: fg
2022-11-28T11:51:58.954 helix_view::editor [ERROR] Failed to initialize the LSP for `source.tsq` { LSP not defined }
2022-11-28T11:53:36.276 helix_view::theme [WARN] Theme: malformed hexcode: fg
2022-11-28T11:53:36.283 helix_view::editor [ERROR] Failed to initialize the LSP for `source.tsq` { LSP not defined }
2022-11-28T11:59:43.518 helix_view::theme [WARN] Theme: malformed hexcode: fg
2022-11-28T12:00:17.727 helix_view::theme [WARN] Theme: malformed hexcode: fg

Platform

Linux 6.0.9-arch1-1

Terminal Emulator

alacritty 0.11.0

Helix Version

helix 22.08.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-language-supportArea: Support for programming/text languagesC-bugCategory: This is a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions