typescript-language-server / typescript-language-server

TypeScript & JavaScript Language Server

Home Page:https://www.npmjs.com/package/typescript-language-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax highlighting issue when generic input spans multiple lines

sachaw opened this issue · comments

Take the two following snippets:

getUsers: UnaryImpl<GetUsersRequest, GetUsersResponse> = async (req, ctx) => {

and

getAuthenticator: UnaryImpl<
    GetAuthenticatorRequest,
    GetAuthenticatorResponse
  > = async (req, ctx) => {

The first snippet formatted to occupy one line correctly colours the property name.
The second however does not.

image

This issue only occurs when a generic input spans multiple lines

How does the more complete code look like? Those methods need to be inside and object literal or something, to be valid.

In any case, it's likely an issue with syntax highlighting provided by the editor you are using and not with this server.

If your editor supports LSP semantic highlighting then server might even improve editor's highlighting in this case but I'm not sure your editor supports it.

Thanks for the reply,
this code is sitting inside a class:

export class Model
  extends BaseService<string>
  implements ServiceImpl<typeof ModelService>

My editor is VSCode 1.81.1. If this is not the correct place please let me know and I'll re-file it elsewhere, thanks.

You should report this in the VSCode repo.