oni icon indicating copy to clipboard operation
oni copied to clipboard

@angular/language-service not working with external template (.component.html)

Open wesselvdv opened this issue 8 years ago • 5 comments

Oni Version: 0.3.6 Neovim Version (Linux only): Operating System: macOS High Sierra

Issue: @angular/language-service is enabled in tsconfig.json, but it doesn't seem to work for template file. (.component.html).

Expected behavior: Autocompletion, syntax checking and linting inside .component.html files.

Actual behavior: Only provides basic HTML autocompletion, and syntax checking.

Steps to reproduce: Clone https://github.com/Ismaestro/angular6-example-app, add

"plugins": [
      { "name": "@angular/language-service" }
    ]

to ts.config.json, open a .component.html file and see the lack of syntax checking and auto completion.

I am hoping I am doing something wrong? I'd really love to use Oni as my main editor for angular development.

wesselvdv avatar Aug 13 '18 08:08 wesselvdv

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

oni-bot avatar Aug 13 '18 08:08 oni-bot

Hey!

Not sure who else around here is an angular developer, so I'm just going to have to take a guess that since the component file ends with .html, vim and therefore Oni are just seeing it as a HTML file, so the angular server is never started. You'd be able to check that by seeing what language is reported at the bottom in the status bar.

Its also possible we aren't picking up plugins from the tsconfig.json, but I've not checked the code for that yet.

CrossR avatar Aug 13 '18 10:08 CrossR

@CrossR The tslint not being picked up is actually a different story, and yes I cna see that the HTML mode is running when looking at a .component.html file. Anything I can edit to force a sort of hybrid Typescript/Web mode in .component.html?

wesselvdv avatar Aug 13 '18 11:08 wesselvdv

For anyone else, I rewrote the tslint plugin to typescript and I built in support for external angular templates:

screen shot 2018-08-14 at 22 42 49

@bryphe Should I open a pull request at https://github.com/bryphe/oni-plugin-tslint?

wesselvdv avatar Aug 14 '18 20:08 wesselvdv

@wesselvdv I think a PR would be hugely appreciated 👍

akinsho avatar Aug 16 '18 13:08 akinsho