When working on a new Visual Studio Code extension, how can I determine the current class that my cursor is in?
For instance:
export class MyClassA {
parameter1: number = 5;
myFunc() {
return parameter1 * 2;
}
}
export class MyClassB {
anotherParamenter = null;
}
If I am editing within the myFunc
method and trigger registerHoverProvider
, I want to be able to identify that I'm inside the MyClassA
class.
Is there a way to access the object or just the cursor position for this purpose?