mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
Option to check the doc's language by default.
LanguageManager.getLanguageForPath is checking the document associated with the path if there's any open for language overrides. It can be optionally turned off (e.g. Document language updates).
This commit is contained in:
1 parent
aff5ed6a54
commit
193bfa8c26
4 files changed
+20
-24
No files matched your search
@@ -34,6 +34,7 @@ define(function (require, exports, module) {
|
||||
DocumentManager = brackets.getModule("document/DocumentManager"),
|
||||
Commands = brackets.getModule("command/Commands"),
|
||||
CommandManager = brackets.getModule("command/CommandManager"),
|
||||
LanguageManager = brackets.getModule("language/LanguageManager"),
|
||||
Menus = brackets.getModule("command/Menus"),
|
||||
AppInit = brackets.getModule("utils/AppInit"),
|
||||
ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
|
||||
@@ -300,7 +301,7 @@ define(function (require, exports, module) {
|
||||
* @return {boolean} - true if the document is a html file
|
||||
*/
|
||||
function isHTMLFile(document) {
|
||||
return document.getLanguage().getId() === "html";
|
||||
return LanguageManager.getLanguageForPath(document.file.fullPath).getId() === "html";
|
||||
}
|
||||
|
||||
function isInlineScript(editor) {
|
||||
@@ -577,7 +578,7 @@ define(function (require, exports, module) {
|
||||
// always clean up cached scope and hint info
|
||||
resetCachedHintContext();
|
||||
|
||||
if (editor && HintUtils.isSupportedLanguage(editor.document.getLanguage().getId())) {
|
||||
if (editor && HintUtils.isSupportedLanguage(LanguageManager.getLanguageForPath(editor.document.file.fullPath).getId())) {
|
||||
initializeSession(editor, previousEditor);
|
||||
$(editor)
|
||||
.on(HintUtils.eventName("change"), function (event, editor, changeList) {
|
||||
|
||||
Reference in new issue
Block a user