@@ -56,6 +56,8 @@ define(function (require, exports, module) {
5656 noHintsOnDot = false , // preference setting to prevent hints on dot
5757 ignoreChange ; // can ignore next "change" event if true;
5858
59+ // Languages that support inline JavaScript
60+ var _inlineScriptLanguages = [ "html" , "php" ] ;
5961
6062 // Define the detectedExclusions which are files that have been detected to cause Tern to run out of control.
6163 PreferencesManager . definePreference ( "jscodehints.detectedExclusions" , "array" , [ ] , {
@@ -341,10 +343,11 @@ define(function (require, exports, module) {
341343 } ;
342344
343345 /**
344- * @return {boolean } - true if the document is a html file
346+ * @return {boolean } - true if the document supports inline JavaScript
345347 */
346- function isHTMLFile ( document ) {
347- return LanguageManager . getLanguageForPath ( document . file . fullPath ) . getId ( ) === "html" ;
348+ function isInlineScriptSupported ( document ) {
349+ var language = LanguageManager . getLanguageForPath ( document . file . fullPath ) . getId ( ) ;
350+ return _inlineScriptLanguages . indexOf ( language ) !== - 1 ;
348351 }
349352
350353 function isInlineScript ( editor ) {
@@ -442,7 +445,7 @@ define(function (require, exports, module) {
442445 JSHints . prototype . hasHints = function ( editor , key ) {
443446 if ( session && HintUtils . hintableKey ( key , ! noHintsOnDot ) ) {
444447
445- if ( isHTMLFile ( session . editor . document ) ) {
448+ if ( isInlineScriptSupported ( session . editor . document ) ) {
446449 if ( ! isInlineScript ( session . editor ) ) {
447450 return false ;
448451 }
0 commit comments