Skip to content

Factor out Angular into languages.angular #1575

Description

@snoweuph

I have verified that this feature request has not been made before

  • I have checked the issues tab, and did not find a similar feature request. I understand that my issue will be closed if it is a duplicate.

Feature Type

Other

Feature description

The Idea is to split the Angular out of the TypeScript and HTML Language Modules.

This would allow a better readability of those modules and make them more maintainable for the future.

For example, I plan to add in an Angular specific extensions, which would best live under languages.angular.extensions.<angular-nvim>.

Alternatives

Additional Context

Currently the Usage of Angular with NVF looks like this:

{pkgs, ...}: {
  vim = {
    lsp = {
      presets = {
        angular-language-server.enable = true;
        emmet-ls.enable = true;
      };
      servers = {
        angular-language-server.filetypes = ["htmlangular"];
        emmet-ls.filetypes = ["htmlangular"];
      };
    };
    treesitter.grammars = [pkgs.vimPlugins.nvim-treesitter-parsers.angular];
    languages = {
      typescript.lsp.servers = [
        "angular-language-server"
      ];
      # WRONG FT
      # html.lsp.servers = [
      #   "angular-language-server"
      # ];
    };
  };
}

The Problem arises, from the normal HTML Tree-sitter package not supporting the angular extras. That is fixed by pkgs.vimPlugins.nvim-treesitter-parsers.angular which introduces the htmlangular filetype and automatically detects it.

The angular-language-server has to run on the htmlangular files and their respective TypeScript files, to get its full feature support. On Top of that you still need and use the normal TypeScript LSP on TypeScript files.
The angular-language-server in TypeScript just allows jumping between the HTML and TS files, and Gives more accurate Information about References in TypeScript Files, - Including references inside Templates.

Besides the Reason of the extra Tree-sitter, introducing htmlangular, you also don't want angular-language-server mixed into the HTML Module, because only some HTML LSPs work fine with angular Templates. superhtml for example, doesn't, while emmet-ls does.

Metadata

Metadata

Labels

TBDMore discussion and research is in orderenhancementNew feature or requesttopic: modules

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions