Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
source: 'ng'
};
return result;
}
function tryOperation(attempting, callback) {
try {
return callback();
}
catch (e) {
info.project.projectService.logger.info("Failed to " + attempting + ": " + e.toString());
info.project.projectService.logger.info("Stack trace: " + e.stack);
return null;
}
}
var serviceHost = new typescript_host_1.TypeScriptServiceHost(info.languageServiceHost, info.languageService);
var ls = language_service_1.createLanguageService(serviceHost);
serviceHost.setSite(ls);
projectHostMap.set(info.project, serviceHost);
proxy.getCompletionsAtPosition = function (fileName, position, options) {
var base = oldLS.getCompletionsAtPosition(fileName, position, options) || {
isGlobalCompletion: false,
isMemberCompletion: false,
isNewIdentifierLocation: false,
entries: []
};
tryOperation('get completions', function () {
var e_1, _a;
var results = ls.getCompletionsAt(fileName, position);
if (results && results.length) {
if (base === undefined) {
base = {
isGlobalCompletion: false,
function createLanguageServiceFromTypescript(host, service) {
var ngHost = new TypeScriptServiceHost(host, service);
var ngServer = language_service_1.createLanguageService(ngHost);
ngHost.setSite(ngServer);
return ngServer;
}
exports.createLanguageServiceFromTypescript = createLanguageServiceFromTypescript;