What does getImplementorsAtPosition do?

Topics: Language Specification
Aug 20, 2013 at 5:25 AM
I'm playing around with the LanguageService class in src/services/pullLanguageService.ts and I cannot seem to figure out what it does. On this commit from the development branch

commit 5fd4a43fdd60759cf218a5e757b94f7ea187cc30
Author: Ryan Cavanaugh ryanca@microsoft.com
Date: Mon Aug 19 16:45:08 2013 -0700
Baseline update for merge

It either throws an error:

TypeError: Cannot call method 'forEach' of null
at LanguageService.getImplementorsAtPosition (/Users/tadams/git/eclipse-typescript/com.palantir.typescript/bin/bridge.js:59717:35)
at LanguageService.getImplementorsAtPosition (/Users/tadams/git/eclipse-typescript/com.palantir.typescript/bin/bridge.js:64451:41)
at Main.processRequest (/Users/tadams/git/eclipse-typescript/com.palantir.typescript/bin/bridge.js:64551:37)
at Interface.<anonymous> (/Users/tadams/git/eclipse-typescript/com.palantir.typescript/bin/bridge.js:64537:23)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
at Interface.<anonymous> (readline.js:322:12)
at Array.forEach (native)
at Interface._normalWrite (readline.js:321:11)
at Socket.ondata (readline.js:91:10)
Or it returns []. If somebody could tell me how to use this and where in a file I should call it, I would be most grateful. Thanks!
Aug 20, 2013 at 8:33 AM
A similar bug was supposedly fixed in https://typescript.codeplex.com/workitem/1494 . I also asked for some explanations there.

It would be great if there was some documentation (inline, blog post, ...) on what the language service methods and APIs are supposed to do.
Currently, I'm trying to guess from interfaces, use in test harness, and even code. The harness isn't as helpful as one might think because the
shims have different types/interfaces from the things they are shimming, and because some methods are stubbed out (non-functional, buggy).

In addition to getImplementorsAtPosition, I am also unsure about the precise intended meaning of getOccurrencesAtPosition and getReferencesAtPosition.
Also, when is getDefinitionAtPosition supposed to return more than one definition? And how are these methods supposed to be used in finding a method implementation (eg, from a getImplementorsAtPosition call to its definition in pullLanguageService.ts, not just to the interface in languageService.ts).