Find implementation of specific class in source code
It depends whether the operator is from an add-on or implemented in Blender itself. The former will be from a Python script, while the latter is implemented in C or C++ and is accessible through the Python API.

For operators from Python add-ons it's necessary to know the command for the operator, therefore enable the Developer Extras in Edit > Preferences > Interface > Display. Once enabled, you can right click on buttons and choose Copy Python Command from the context menu.





When the command is known, the inspect module can be used to find the source file and the source code. Replace bpy.ops.export_mesh.stl with the operator you would like to inspect.

import bpy
import inspect


cls = getattr(bpy.types, bpy.ops.export_mesh.stl.idname())
print(inspect.getfile(cls))
print(inspect.getsource(cls))


Alternatively, if the class name is already known, it can be used directly.

import bpy
import inspect


cls = getattr(bpy.types, 'EXPORT_MESH_OT_stl')
print(inspect.getfile(cls))
print(inspect.getsource(cls))




The source code of operators, that are implemented in C or C++, can be found by opening an IDE (e.g. Visual Studio Code) or advanced text editor of your choice (e.g. Notepad++) and searching the cloned repository of Blender for the definition of the class name. This approach works for any programming language, including Python scripts.

Alternatively you can use the:


Diffusion for Blender or Blender Add-ons and search the class name through the Pattern Search
GitHub mirror and search the repository using repo:blender/blender followed by the class name.




The SCREEN_OT_screenshot class can be found in  /source/blender/editors/screen/screendump.c. The EXPORT_MESH_OT_stl class, which is actually named ExportSTL, can be found in /release/scripts/addons/io_mesh_stl/__init__.py.