How to use the @reactivex/rxjs.Observable.empty function in @reactivex/rxjs

To help you get started, we’ve selected a few @reactivex/rxjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sourcegraph / javascript-typescript-langserver / src / typescript-service.ts View on Github external
return (() => {
			try {
				config.ensureAllFiles(span);

				const program = config.getProgram(span);
				if (!program) {
					return Observable.empty();
				}

				if (query) {
					let items: Observable<[number, ts.NavigateToItem]>;
					if (typeof query === 'string') {
						// Query by text query
						items = Observable.from(config.getService().getNavigateToItems(query, limit, undefined, false))
							// Same score for all
							.map(item => [1, item]);
					} else {
						const queryWithoutPackage = omit(query, 'package') as SymbolDescriptor;
						// Query by name
						items = Observable.from(config.getService().getNavigateToItems(query.name || '', limit, undefined, false))
							// Get a score how good the symbol matches the SymbolDescriptor (ignoring PackageDescriptor)
							.map((item): [number, ts.NavigateToItem] => [getMatchScore(queryWithoutPackage, {
								kind: item.kind,