src/vs/workbench/browser/codeeditor.ts/OpenWorkspaceButtonContribution/shouldShowButton
class OpenWorkspaceButtonContribution:	private shouldShowButton(editor: ICodeEditor): boolean {
		const model = editor.getModel();
		if (!model) {
			return false; // we need a model
		}

		if (!hasWorkspaceFileExtension(model.uri)) {
			return false; // we need a workspace file
		}

		if (!this.fileService.hasProvider(model.uri)) {
			return false; // needs to be backed by a file service
		}

		if (isTemporaryWorkspace(this.contextService.getWorkspace())) {
			return false; // unsupported in temporary workspaces
		}

		if (this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE) {
			const workspaceConfiguration = this.contextService.getWorkspace().configuration;
			if (workspaceConfiguration && isEqual(workspaceConfiguration, model.uri)) {
				return false; // already inside workspace
			}
		}

		if (editor.getOption(EditorOption.inDiffEditor)) {
			// in diff editor
			return false;
		}

		return true;
	}