iamcco / coc-angular

Angular Language Service coc extension for (neo)vim
146 stars 17 forks source link

Working in single project however does not work on a mono repo #64

Open theTechGoose opened 1 year ago

theTechGoose commented 1 year ago

Describe the bug This works if you install @angular/language-service in the project however in a mono repo the language service is not working.

To Reproduce Steps to reproduce the behavior: start a monrepo with your favorite flavor. Mine is nx Create an angular project in the mono repo try to go to definition or auto complete a custom component in html. it does not work

Expected behavior For coc to auto complete events and input properties

Screenshots

image

Desktop (please complete the following information):

Log:

NgrNxk commented 1 year ago

Could that be due to the fact, that nx doesn't have an angular.json, but instead uses a workspace.json and many project.jsons?

NgrNxk commented 1 year ago

Yeah, this seems to be the issue, changing coc-angular's project.json to

  "activationEvents": [
    "workspaceContains:angular.json",
    "workspaceContains:workspace.json",
    "workspaceContains:node_modules/@angular/core/core.d.ts"
  ],

seems to work. But, the workspace.json is not a sign for angular, just for nx (which could contain only non-angular projects). It would be better to use the @angular/core matcher; however, this matcher does not work. I didn't understand everything in coc.nvim's code, but I think the whole "node_modules" can't be checked.

EJIqpEP commented 8 months ago

@NgrNxk thanks that helped me a lot. Any way to configure it from the project itself without need to fork coc-angular?