src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetPreviewModel.ts/SuggestWidgetPreviewModel/updateCache
class SuggestWidgetPreviewModel:	private async updateCache() {
		const state = this.suggestionInlineCompletionSource.state;
		if (!state || !state.selectedItem) {
			return;
		}

		const info: SelectedSuggestionInfo = {
			text: state.selectedItem.normalizedInlineCompletion.insertText,
			range: state.selectedItem.normalizedInlineCompletion.range,
			isSnippetText: state.selectedItem.isSnippetText,
			completionKind: state.selectedItem.completionItemKind,
		};

		const position = this.editor.getPosition();

		if (
			state.selectedItem.isSnippetText ||
			state.selectedItem.completionItemKind === CompletionItemKind.Snippet ||
			state.selectedItem.completionItemKind === CompletionItemKind.File ||
			state.selectedItem.completionItemKind === CompletionItemKind.Folder
		) {
			// Don't ask providers for these types of suggestions.
			this.cache.clear();
			return;
		}

		const promise = createCancelablePromise(async token => {
			let result: TrackedInlineCompletions;
			try {
				result = await provideInlineCompletions(this.languageFeaturesService.inlineCompletionsProvider, position,
					this.editor.getModel(),
					{ triggerKind: InlineCompletionTriggerKind.Automatic, selectedSuggestionInfo: info },
					token
				);
			} catch (e) {
				onUnexpectedError(e);
				return;
			}
			if (token.isCancellationRequested) {
				result.dispose();
				return;
			}
			this.cache.setValue(
				this.editor,
				result,
				InlineCompletionTriggerKind.Automatic
			);
			this.onDidChangeEmitter.fire();
		});
		const operation = new UpdateOperation(promise, InlineCompletionTriggerKind.Automatic);
		this.updateOperation.value = operation;
		await promise;
		if (this.updateOperation.value === operation) {
			this.updateOperation.clear();
		}
	}