mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
Use language id
This commit is contained in:
1 parent
cb738dd992
commit
04d63b1fae
4 files changed
+39
-40
No files matched your search
@@ -27,7 +27,7 @@
|
||||
define(function (require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var MODE_NAME = "javascript",
|
||||
var LANGUAGE_ID = "javascript",
|
||||
SCOPE_MSG_TYPE = "outerScope",
|
||||
SINGLE_QUOTE = "\'",
|
||||
DOUBLE_QUOTE = "\"";
|
||||
@@ -380,7 +380,7 @@ define(function (require, exports, module) {
|
||||
exports.BUILTIN_GLOBALS = BUILTIN_GLOBALS;
|
||||
exports.KEYWORDS = KEYWORDS;
|
||||
exports.LITERALS = LITERALS;
|
||||
exports.MODE_NAME = MODE_NAME;
|
||||
exports.LANGUAGE_ID = LANGUAGE_ID;
|
||||
exports.SCOPE_MSG_TYPE = SCOPE_MSG_TYPE;
|
||||
exports.SINGLE_QUOTE = SINGLE_QUOTE;
|
||||
exports.DOUBLE_QUOTE = DOUBLE_QUOTE;
|
||||
|
||||
@@ -440,8 +440,8 @@ define(function (require, exports, module) {
|
||||
file = split.file;
|
||||
|
||||
if (file.indexOf(".") > 1) { // ignore /.dotfiles
|
||||
var mode = LanguageManager.getLanguageForPath(entry.fullPath).getMode();
|
||||
if (mode === HintUtils.MODE_NAME) {
|
||||
var languageID = LanguageManager.getLanguageForPath(entry.fullPath).getId();
|
||||
if (languageID === HintUtils.LANGUAGE_ID) {
|
||||
DocumentManager.getDocumentForPath(path).done(function (document) {
|
||||
refreshOuterScope(dir, file, document.getText());
|
||||
});
|
||||
|
||||
@@ -400,7 +400,7 @@ define(function (require, exports, module) {
|
||||
cachedHints = null;
|
||||
cachedType = null;
|
||||
|
||||
if (editor && editor.getModeForDocument() === HintUtils.MODE_NAME) {
|
||||
if (editor && editor.getLanguageForSelection().getId() === HintUtils.LANGUAGE_ID) {
|
||||
initializeSession(editor);
|
||||
$(editor)
|
||||
.on(HintUtils.eventName("change"), function () {
|
||||
@@ -447,7 +447,7 @@ define(function (require, exports, module) {
|
||||
installEditorListeners(EditorManager.getActiveEditor());
|
||||
|
||||
var jsHints = new JSHints();
|
||||
CodeHintManager.registerHintProvider(jsHints, [HintUtils.MODE_NAME], 0);
|
||||
CodeHintManager.registerHintProvider(jsHints, [HintUtils.LANGUAGE_ID], 0);
|
||||
|
||||
// for unit testing
|
||||
exports.jsHintProvider = jsHints;
|
||||
|
||||
Reference in new issue
Block a user