<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def openSourceFile(self, fileToOpen):
 		"""Finds and opens the source file for link target fileToOpen. 		When links like [test](test) are clicked, the file test.md is opened. 		It has to be located next to the current opened file. 		Relative paths like [test](../test) or [test](folder/test) are also possible. 		"""

		if self.fileName:
			currentExt = splitext(self.fileName)[1]
			basename, ext = splitext(fileToOpen)
			if ext in ('.html', '') and exists(basename + currentExt):
				self.p.openFileWrapper(basename + currentExt)
				return basename + currentExt
		if exists(fileToOpen) and get_markup_for_file_name(fileToOpen, return_class=True):
			self.p.openFileWrapper(fileToOpen)
			return fileToOpen