kickstart.nvim icon indicating copy to clipboard operation
kickstart.nvim copied to clipboard

Syntax highlighting for TSX files

Open ubmit opened this issue 3 years ago • 1 comments

Describe the bug The syntax highlighting for TSX isn't working properly. You can take a look at the color of the HTML tags and the content inside them, they are the same color. I'm using the same theme settings that are in the init.lua repo. However, I've also tried another theme, the Catppuccin, and I faced inconsistencies with the syntax highlighting as well.

image

To Reproduce Steps to reproduce the behavior:

  1. Follow the guide in the README
  2. Open a TSX file

Desktop (please complete the following information):

  • OS: macOS Ventura 13.1
  • Terminal: Kitty 0.26.4

** Neovim Version **

  • Output of running :version from inside of neovim: NVIM v0.8.2

File example

import React from "react";

type Props = { text: string; color?: string };

function Title({ text, color }: Props) {
  const style = { color: color ?? "blueviolet" };
  return <h1 style={style}>{text}</h1>;
}

const Header = () => <header>Header component</header>;

export const App = () => (
  <>
    <Header />
    <Title text="Hello World" />
    <p>
      lorem ipsum dolor etc lorem ipsum dolor etc lorem ipsum dolor etc lorem
      ipsum dolor etc lorem ipsum dolor etc lorem ipsum dolor etc
    </p>
  </>
);

ubmit avatar Jan 16 '23 22:01 ubmit

I had to install tsx (https://github.com/tree-sitter/tree-sitter-typescript) for tree-sitter. Since this is a popular syntax people may want to have built-in and typescript is already supported in the ensure_installed array https://github.com/nvim-lua/kickstart.nvim/blob/32744c3f66ac9e66e4ac5cc9d181db50254c44b3/init.lua#L224, I think it would be nice to have tsx there by default as well. What do you think? I'll make a PR for it :+1:

ubmit avatar Jan 16 '23 22:01 ubmit

With all respect, I would argue that the ensured installed should only have the minimal defaults. Polluting that options will bloat the install and not everyone will need those configurations. But highly encourage adding documentation and notes even creating a section in the README on those tips.

cjgratacos avatar Jan 23 '23 16:01 cjgratacos

Thanks, sorry for the late reply. I will add tsx by default in #178

tjdevries avatar Feb 15 '23 20:02 tjdevries

Closed in favor of #178

ubmit avatar Feb 16 '23 19:02 ubmit