extensions/html-language-features/server/src/requests.ts/getRequestService
export function getRequestService(handledSchemas: string[], connection: Connection, runtime: RuntimeEnvironment): RequestService {
	const builtInHandlers: { [protocol: string]: RequestService | undefined } = {};
	for (let protocol of handledSchemas) {
		if (protocol === 'file') {
			builtInHandlers[protocol] = runtime.file;
		} else if (protocol === 'http' || protocol === 'https') {
			builtInHandlers[protocol] = runtime.http;
		}
	}
	return {
		async stat(uri: string): Promise<FileStat> {
			const handler = builtInHandlers[getScheme(uri)];
			if (handler) {
				return handler.stat(uri);
			}
			const res = await connection.sendRequest(FsStatRequest.type, uri.toString());
			return res;
		},
		readDirectory(uri: string): Promise<[string, FileType][]> {
			const handler = builtInHandlers[getScheme(uri)];
			if (handler) {
				return handler.readDirectory(uri);
			}
			return connection.sendRequest(FsReadDirRequest.type, uri.toString());
		},
		getContent(uri: string, encoding?: string): Promise<string> {
			const handler = builtInHandlers[getScheme(uri)];
			if (handler) {
				return handler.getContent(uri, encoding);
			}
			return connection.sendRequest(FsContentRequest.type, { uri: uri.toString(), encoding });
		}
	};
}