Index: wp-admin/includes/misc.php
===================================================================
--- wp-admin/includes/misc.php	(revision 10593)
+++ wp-admin/includes/misc.php	(working copy)
@@ -238,4 +238,38 @@
 	echo "<p>$message</p>\n";
 }
 
+function wp_doc_link_parse( $content ) {
+	if ( !is_string( $content ) || empty( $content ) )
+		return array();
+		
+	$tokens = token_get_all( $content );
+	$functions = array();
+	$ignore_functions = array();
+	for ( $t = 0, $count = count( $tokens ); $t < $count; $t++ ) {
+		if ( !is_array( $tokens[$t] ) ) continue;
+		if ( T_STRING == $tokens[$t][0] && ( '(' == $tokens[ $t + 1 ] || '(' == $tokens[ $t + 2 ] ) ) {
+			// If it's a function or class defined locally, there's not going to be any docs available
+			if ( 'class' == $tokens[ $t - 2 ][1] || 'function' == $tokens[ $t - 2 ][1] || T_OBJECT_OPERATOR == $tokens[ $t - 1 ][0] ) {
+				$ignore_functions[] = $tokens[$t][1];
+			}
+			// Add this to our stack of unique references
+			$functions[] = $tokens[$t][1];
+		}
+	}
+	
+	$functions = array_unique( $functions );
+	sort( $functions );
+	$ignore_functions = apply_filters( 'documentation_ignore_functions', $ignore_functions );
+	$ignore_functions = array_unique( $ignore_functions );
+	
+	$out = array();
+	foreach ( $functions as $function ) {
+		if ( in_array( $function, $ignore_functions ) )
+			continue;
+		$out[] = $function;
+	}
+	
+	return $out;
+}
+
 ?>
Index: wp-admin/theme-editor.php
===================================================================
--- wp-admin/theme-editor.php	(revision 10593)
+++ wp-admin/theme-editor.php	(working copy)
@@ -87,7 +87,19 @@
 	if (!$error && filesize($real_file) > 0) {
 		$f = fopen($real_file, 'r');
 		$content = fread($f, filesize($real_file));
-		$content = htmlspecialchars($content);
+
+		if ( 'php' == mb_substr( $real_file, mb_strrpos( $real_file, '.' ) + 1 ) ) {
+			$functions = wp_doc_link_parse( $content );
+			
+			$docs_select = '<select name="docs-list" id="docs-list">';
+			$docs_select .= '<option value="">' . __( 'Function Name...' ) . '</option>';
+			foreach ( $functions as $function) {					
+				$docs_select .= '<option value="' . urlencode( $function ) . '">' . htmlspecialchars( $function ) . '()</option>';
+			}
+			$docs_select .= '</select>';
+		}
+
+		$content = htmlspecialchars( $content );
 	}
 
 	?>
@@ -187,6 +199,9 @@
 		 <input type="hidden" name="file" value="<?php echo $file ?>" />
 		 <input type="hidden" name="theme" value="<?php echo $theme ?>" />
 		 </div>
+		<?php if ( count( $functions ) ) : ?>
+		<div id="documentation"><label for="docs-list">Documentation:</label> <?php echo $docs_select ?> <input type="button" class="button" value=" <?php _e( 'Lookup' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_locale() ) ?>&version=<?php echo urlencode( $wp_version ) ?>&redirect=true'); }" /></div>
+		<?php endif; ?>
 
 		<div>
 <?php if ( is_writeable($real_file) ) : ?>
Index: wp-admin/css/theme-editor.css
===================================================================
--- wp-admin/css/theme-editor.css	(revision 10593)
+++ wp-admin/css/theme-editor.css	(working copy)
@@ -64,3 +64,12 @@
 div.tablenav {
 	margin-right: 210px;
 }
+
+#documentation {
+	margin-top: 10px;
+}
+#documentation label {
+	line-height: 22px;
+	vertical-align: top;
+	font-weight: bold;
+}
\ No newline at end of file
Index: wp-admin/plugin-editor.php
===================================================================
--- wp-admin/plugin-editor.php	(revision 10593)
+++ wp-admin/plugin-editor.php	(working copy)
@@ -81,8 +81,22 @@
 	if ( ! is_file($real_file) )
 		$error = 1;
 
-	if ( ! $error )
-		$content = htmlspecialchars(file_get_contents($real_file));
+	if ( ! $error ) {
+		$content = file_get_contents( $real_file );
+		
+		if ( 'php' == mb_substr( $real_file, mb_strrpos( $real_file, '.' ) + 1 ) ) {
+			$functions = wp_doc_link_parse( $content );
+			
+			$docs_select = '<select name="docs-list" id="docs-list">';
+			$docs_select .= '<option value="">' . __( 'Function Name...' ) . '</option>';
+			foreach ( $functions as $function) {
+				$docs_select .= '<option value="' . urlencode( $function ) . '">' . htmlspecialchars( $function ) . '()</option>';
+			}
+			$docs_select .= '</select>';
+		}
+		
+		$content = htmlspecialchars( $content );
+	}
 
 	?>
 <?php if (isset($_GET['a'])) : ?>
@@ -124,7 +138,7 @@
 	<h4><?php _e('Plugins'); ?></h4>
 	<ul>
 <?php foreach($plugin_files as $plugin_file) : ?>
-		<li><a href="plugin-editor.php?file=<?php echo $plugin_file; ?>"><?php echo $plugins[$plugin_file]['Name']; ?></a></li>
+		<li<?php echo $file == $plugin_file ? ' class="highlight"' : ''; ?>><a href="plugin-editor.php?file=<?php echo $plugin_file; ?>"><?php echo $plugins[$plugin_file]['Name']; ?></a></li>
 <?php endforeach; ?>
 	</ul>
 	</div>
@@ -135,6 +149,9 @@
 		<input type="hidden" name="action" value="update" />
 		<input type="hidden" name="file" value="<?php echo $file ?>" />
 		</div>
+		<?php if ( count( $functions ) ) : ?>
+		<div id="documentation"><label for="docs-list">Documentation:</label> <?php echo $docs_select ?> <input type="button" class="button" value=" <?php _e( 'Lookup' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_locale() ) ?>&version=<?php echo urlencode( $wp_version ) ?>&redirect=true'); }" /></div>
+		<?php endif; ?>
 <?php if ( is_writeable($real_file) ) : ?>
 	<?php if ( in_array($file, (array) get_option('active_plugins')) ) { ?>
 		<p><?php _e('<strong>Warning:</strong> Making changes to active plugins is not recommended.  If your changes cause a fatal error, the plugin will be automatically deactivated.'); ?></p>

