leafgarland/typescript-vim

Is there a way to highlight class functions?

bluz71 opened this issue · 2 comments

Hello,

I am new to TypeScript after a while doing JavaScript/ES6.

I use pangloss/vim-javascript for JS and the first thing I notice when switching over to TypeScript is that class functions don't appear to be highlightable when using this plugin.

For example:

class Car { 
   //field 
   engine:string; 
 
   //constructor 
   constructor(engine:string) { 
      this.engine = engine 
   }  

   //function 
   disp():void { 
      console.log("Engine is  :   "+this.engine) 
   } 
}

I would really like to highlight disp in a custom color (aka the base Function color of my Vim theme). Currently disp is not highlighted at all.

Is there anyway to do this?
I am so used to seeing function highlights with Ruby, JavaScript & Go language plugins that TypeScript looks naked and under-colored without it.

P.S. Just tested both Atom and VSCode and both of them do highlight class functions in color.

I no longer need this.

The vim-polyglot language pack plugin has recently switched TypeScript providers, it now uses yats.vim for TypeScript files.

👍yats is also likely going into the vim distribution so that’s a good move.