Skip to content

Using @angular/language-service with language server report errors with HTML files #104

Closed

Description

@yanxi0830

Hi, I am trying to integrate @angular/language-service plugin with the language server via the global plugins initializationOptions. This works with template inside Typescript files, but not with templates as html files. If I execute the language server with HTML content types, it reports a bunch of typescript errors.

typescript-ls

Is there any options to disable the errors while enabling the @angular/language-service for HTML files?

Possibly related? microsoft/TypeScript#17151

Activity

  1. mickaelistria commented on May 16, 2019

    @mickaelistria

    I've reported it upstream as I think it's an issue that tsserver even tries to parse the .html file if there is no plugin instructing it to do it: microsoft/TypeScript#31423

  2. apexskier commented on Jul 5, 2021

    @apexskier
    Contributor

    If I execute the language server with HTML content types, it reports a bunch of typescript errors.

    I think this is the core issue. If you don't execute the language server with html files, it won't report issues for them. To my knowledge, most client language server implementations require you to specify which languages/syntaxes to apply the language server to - Sublime text, Nova as two examples - so something in your setup is instructing language-service-plugin to process HTML files without any real support for it.

    In this case though, I'd need much more detail to know how Eclipse/@angular/language-service/language-service-plugin are working together to try to understand this issue.

  3. rchl commented on Nov 21, 2021

    @rchl
    Member

    I've investigated this a bit.

    The typescript plugin doesn't support HTML files, only inline templates in TS files.

    https://github.com/angular/vscode-ng-language-service also includes a dedicated language server that supports HTML templates also. I believe they only provide VSCode extension but if you search a bit you might be able to find server adapted for your editor. For example there is https://github.com/sublimelsp/LSP-angular for Sublime Text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions