I would like to get the type of a method argument on a class using the typescript compiler API to provide code completion.
My class has the method byId(id: sap.ui.core.ID). I would like to check if the byId() method has this id parameter. So I start typing this.byId(|) and when I trigger code completion I would like to get the type at the position and if it is right I would look for the completion items in an XML file.
If I use the LanguageService class it only puts out the types after the brackets. The compiler API and the typechecker did not help, as they do not tend to get the symbols at the location.
Is there a straight forward way to get the type of a method parameter during code completion?
EDIT: Better Example for what I would like to do:
namespace app.controller {
import Controller = sap.ui.core.mvc.Controller;
export class App extends Controller {
onInit() {
this.byId(|)
console.log("Initializing App Controller");
}
}
}
The | marks the position for the code completion.