Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Allow JavaScript Code Hints only in its context #11263

Merged
merged 1 commit into from
Jun 22, 2015

Conversation

sprintr
Copy link
Contributor

@sprintr sprintr commented Jun 13, 2015

Fixes a regression I made in #11245 where JavaScript code hints were globally available in a PHP document. This will make sure they are only available inside script tags.

@marcelgerber marcelgerber added this to the Release 1.4 milestone Jun 13, 2015
@@ -341,10 +341,11 @@ define(function (require, exports, module) {
};

/**
* @return {boolean} - true if the document is a html file
* @return {boolean} - true if the document is a html or php file
*/
function isHTMLFile(document) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function name is now misleading. maybe change including usages to isHTMLOrPHPFile(document)
or alternatively move the check to a more localized place.

@abose abose self-assigned this Jun 15, 2015
@@ -56,6 +56,9 @@ define(function (require, exports, module) {
noHintsOnDot = false, // preference setting to prevent hints on dot
ignoreChange; // can ignore next "change" event if true;

// Languages that support inline JavaScript
var _inlineScriptLanguages = ["html", "php"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to define this as a preference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think so. These are the only two languages that support inline JS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case someone wants to disable JavaScript code hints in PHP, they can use language/php layer to disable them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsp/asp I remember can do similar js mixin as PHP.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abose jsp/asp files will be highlighted as html files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe is something that could be defined as part of the language in the LanguageManager?

abose added a commit that referenced this pull request Jun 22, 2015
Allow JavaScript Code Hints only in its context
@abose abose merged commit 4f7be02 into adobe:master Jun 22, 2015
@abose
Copy link
Contributor

abose commented Jun 22, 2015

Looks good. Merging.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants