edition in superscript before author in citations

it's me again. My advisor looked through my first drafts for my thesis and was overall very pleased but pointed out that she wants to see the edition of a work (@book or @collection) in superscript before the author in every citation like this:

"Very smart quote." (Dürscheid ⁵2016: 13)

\documentclass[paper=a4,12pt,numbers=endperiod]{scrartcl}

\usepackage[backend=biber,style=authoryear]{biblatex}
\DefineBibliographyStrings{english}{references={Bibliography}}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\renewbibmacro*{byeditor+others}{%
\ifnameundef{editor}
{}
{\printnames[byeditor]{editor}%
\clearname{editor}%
\newunit}%
\usebibmacro{byeditorx}%
\usebibmacro{bytranslator+others}}
\renewbibmacro*{bytypestrg}[2]{%
\iffieldundef{#1type}
{\bibstring{#2}}
{\ifbibxstring{\thefield{#1type}}
{\bibstring{\thefield{#1type}}}
{\printtext{\thefield{#1type}}}}}

\renewcommand*{\multinamedelim}{/}
\renewcommand*{\finalnamedelim}{\multinamedelim}

\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}

\DeclareFieldFormat{superedition}{\textsuperscript{#1}}

\providecommand*{\iflabeldateisdate}{%
\ifboolexpr{%
not test {\iffieldundef{labeldatesource}}
and
(test {\iffieldequalstr{labeldatesource}{}}
or test {\iffieldequalstr{labeldatesource}{year}})}}

\renewbibmacro*{date+extrayear}{%
\iffieldundef{labelyear}
{}
{\usebibmacro{origdate}%
\printtext[parens]{%
\iflabeldateisdate
{\iffieldnum{edition}
{\printfield[superedition]{edition}%
\global\clearfield{edition}}
{}%
\printdateextra}
{\printlabeldateextra}}}}

\newbibmacro*{origdate}{%
\iffieldundef{origyear}
{}
{\printtext[brackets]{\printorigdate}}}

\DeclareFieldFormat{pages}{#1}

\DeclareNameAlias{sortname}{family-given}

\DeclareFieldFormat[article,periodical]{number}{\mkbibparens{#1}}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\printfield{number}%
\printfield{eid}}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{durscheid2016a,
Title                    = {Einführung in die Schriftlinguistik \textup{(UTB\,3740)}},
Author                   = {Dürscheid, Christa},
Keywords                 = {sek},
Location                 = {Göttingen},
Publisher                = {Andenhoeck \& Ruprecht},
Year                     = {2016},
Edition                  = {5},
Origyear                 = {2002} }
\end{filecontents}

\begin{document}
Another example sentence \parencite[][16]{durscheid2016a}.

\printbibliography
\end{document}

• What do you do for @incollection or @inbook entries? Do they still get the edition superscript even though, strictly speaking, it refers to their booktitle and not title. – moewe Oct 14 '18 at 4:04
• Just in case you really use that entry in your document, please double check the publisher field. The publisher in Göttingen is called Vandenhoeck \& Ruprecht with a V. – moewe Oct 14 '18 at 6:38

We just need to tell the citation macros to copy what the bibliography does

\renewbibmacro*{cite:labeldate+extradate}{%
\iffieldundef{labelyear}
{}
{\printtext[bibhyperref]{%
\ifboolexpr{test {\iffieldnum{edition}}
and test {\iflabeldateisdate}}
{\printfield[superedition]{edition}}
{}%
\printlabeldateextra}}}


If you are still using an outdated pre-3.8 version of biblatex (I think you used to use 3.6, cf. the discussion below the answer in Citing two authors/Journals: Issue(Number)), replace cite:labeldate+extradate with cite:labelyear+extrayear, see https://github.com/plk/biblatex/wiki/Name-Changes.