I have three files:
- index.js
- employee.js
- employer.js
index.js
import Employer from "./employer.js"
import Employee from "./employee.js"
const employer = new Employer();
const employee = new Employee(employer);
employee.js
class Employee {
constructor(employer) {
this.employer = employer;
}
getEmployer() {
return this.employer.name();
}
}
employer.js
class Employer() {
name() {
return "Default Employer";
}
}
The problem here in VS code is that if I CTRL + Click
on the employer.name()
it does not navigate to employer.js
file since it is not referenced via "import" but passed via constructor parameter. Since I am in a vanilla JS environment, is there a way to tell VS Code that employer
is an instance of “Employer” class and make it navigate when I click on it?