title: Typescript Compiler API or Language Service get function argument type
body: <p>I would like to get the type of a method argument on a class using the typescript compiler API to provide code completion.</p>
  
  <p>My class has the method <code>byId(id: sap.ui.core.ID)</code>. I would like to check if the byId() method has this id parameter. So I start typing <code>this.byId(|)</code> 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.</p>
  
  <p>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.</p>
  
  <p>Is there a straight forward way to get the type of a method parameter during code completion?</p>
  
  <p>EDIT: Better Example for what I would like to do:</p>
  
  <pre><code>namespace app.controller {
      import Controller = sap.ui.core.mvc.Controller;
      export class App extends Controller {
          onInit() {
              this.byId(|)
              console.log("Initializing App Controller");
          }
      }
  }
  </code></pre>
  
  <p>The | marks the position for the code completion.</p>