getCurrentDirectory is optional on LanguageServiceHost (as it inherits from GetEffectiveTypeRootsHost, and it is optional there), but calling createLanguageService with a host which does not implement getCurrentDirectory throws TypeError: host.getCurrentDirectory is not a function.