npm install nx --global
npx create-nx-workspace@latest myWorkspaceVscode --preset angular --appName "vscode-references-test" --style "css" --nx-cloud false
cd my-workspace-vscode
nx generate @nrwl/angular:library --name=myLibrary --skipModule
libs>my-library>src>lib
export interface Todo {
title: string;
}
libs>my-library>src>lib
export * from './lib/data';
import { Component } from '@angular/core';
import { Todo } from '@my-workspace-vscode/my-library';
@Component({
selector: 'my-workspace-vscode-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'vscode-references-test';
todos: Todo[] = [{ title: 'Todo 1' }, { title: 'Todo 2' }];
}
- Open workspace with vscode with no editors open.
- Open libs>my-library>src>lib>data.ts.
- Right click on
Todo
and select 'Find All References'. - Notice that
app.component.ts
is not in the results.
Cannot find all references to shared lib's interfaces in VS Code nrwl/nx#3106
fix(language-service): Add resource files as roots to their associate angular/angular#45601