code: func WithFileContext(e error, realFilename string, r io.Reader, matcher LineMatcherFn) (error, bool) {
  	if e == nil {
  		panic("error missing")
  	}
  	le := UnwrapFileError(e)
  
  	if le == nil {
  		var ok bool
  		if le, ok = ToFileError("", e).(FileError); !ok {
  			return e, false
  		}
  	}
  
  	var errCtx ErrorContext
  
  	posle := le.Position()
  
  	if posle.Offset != -1 {
  		errCtx = locateError(r, le, func(m LineMatcher) bool {
  			if posle.Offset >= m.Offset && posle.Offset < m.Offset+len(m.Line) {
  				lno := posle.LineNumber - m.Position.LineNumber + m.LineNumber
  				m.Position = text.Position{LineNumber: lno}
  			}
  			return matcher(m)
  		})
  	} else {
  		errCtx = locateError(r, le, matcher)
  	}
  
  	pos := &errCtx.position
  
  	if pos.LineNumber == -1 {
  		return e, false
  	}
  
  	pos.Filename = realFilename
  
  	if le.Type() != "" {
  		errCtx.ChromaLexer = chromaLexerFromType(le.Type())
  	} else {
  		errCtx.ChromaLexer = chromaLexerFromFilename(realFilename)
  	}
  
  	return &ErrorWithFileContext{cause: e, ErrorContext: errCtx}, true
  }
docs: // WithFileContextForFile will try to add a file context with lines matching the given matcher.
  // If no match could be found, the original error is returned with false as the second return value.