Permalink
Browse files

Merge pull request #15 from DaBungalow/implement-language-manager

Implement language manager
  • Loading branch information...
2 parents dced8b5 + 39f61d3 commit 50f2b09f73b7c7f401e2e99c6ef10f0b8cdab26e @cfjedimaster cfjedimaster committed Jul 1, 2013
Showing with 14 additions and 13 deletions.
  1. +14 −13 main.js
View
@@ -4,21 +4,22 @@
define(function (require, exports, module) {
'use strict';
- var Commands = brackets.getModule("command/Commands"),
+ var AppInit = brackets.getModule("utils/AppInit"),
+ Commands = brackets.getModule("command/Commands"),
CommandManager = brackets.getModule("command/CommandManager"),
- EditorManager = brackets.getModule("editor/EditorManager"),
DocumentManager = brackets.getModule("document/DocumentManager"),
- AppInit = brackets.getModule("utils/AppInit"),
+ EditorManager = brackets.getModule("editor/EditorManager"),
+ ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
+ LanguageManager = brackets.getModule("language/LanguageManager"),
Menus = brackets.getModule("command/Menus"),
- PanelManager = brackets.getModule("view/PanelManager"),
- ExtensionUtils = brackets.getModule("utils/ExtensionUtils");
+ PanelManager = brackets.getModule("view/PanelManager");
var panelHtml = require("text!templates/bottom-panel.html"),
tableHtml = require("text!templates/csslint-table.html");
require("csslint/csslint");
- //commands
+ // Commands
var VIEW_HIDE_CSSLINT = "csslint.run";
//Determines if we are enabled or not. Previously we based this on if we could
@@ -28,14 +29,14 @@ define(function (require, exports, module) {
var $csslint;
function isCSSDoc(fileEntry) {
- var filename = fileEntry.file.name;
- var ext = filename.split(".").pop();
- //maybe in the future SASS/LESS
- return (ext === "css");
+ var language = LanguageManager.getLanguageForPath(fileEntry);
+ // Maybe in the future LESS
+ return (language === "css" || language === "sass");
}
function _handleLint() {
- var messages, results;
+ var messages,
+ results;
var editor = EditorManager.getCurrentFullEditor();
if (!editor) {
@@ -95,7 +96,7 @@ define(function (require, exports, module) {
cssLintEnabled = false;
CommandManager.get(VIEW_HIDE_CSSLINT).setChecked(false);
$(DocumentManager).off("currentDocumentChange documentSaved", null, _handleLint);
- //if visible, hide
+ // if visible, hide
$csslint.hide();
EditorManager.resizeEditor();
@@ -129,4 +130,4 @@ define(function (require, exports, module) {
});
-});
+});

0 comments on commit 50f2b09

Please sign in to comment.