From 53cbe28bca553b0d9d5a7a62beeed0a9626a2fe5 Mon Sep 17 00:00:00 2001 From: Bernhard Sirlinger Date: Sat, 20 Apr 2013 07:14:52 +0200 Subject: [PATCH] Minor fixes after review --- src/language/HTMLUtils.js | 4 ++-- test/spec/CodeHintUtils-test.js | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/language/HTMLUtils.js b/src/language/HTMLUtils.js index 38478222694..00b051c1824 100644 --- a/src/language/HTMLUtils.js +++ b/src/language/HTMLUtils.js @@ -400,12 +400,12 @@ define(function (require, exports, module) { return createTagInfo(); } - // Check to see if this is the closing of a tag (either the start or end) self closing tag + // Check to see if this is the closing of a start tag or a self closing tag if (ctx.token.string === ">" || ctx.token.string === "/>") { return createTagInfo(); } - // Check to see if this is the closing of a tag (either the start or end) closing tag + // Check to see if this is a closing tag if (ctx.token.string.charAt(0) === "<" && ctx.token.string.charAt(1) === "/") { return createTagInfo(CLOSING_TAG, offset - 2, ctx.token.string.slice(2)); } diff --git a/test/spec/CodeHintUtils-test.js b/test/spec/CodeHintUtils-test.js index 34c92fb2ce0..302f0d3637b 100644 --- a/test/spec/CodeHintUtils-test.js +++ b/test/spec/CodeHintUtils-test.js @@ -186,16 +186,6 @@ define(function (require, exports, module) { expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.TAG_NAME)); }); - it("should not hint anything inside a closing tag", function () { - var pos = {"ch": 0, "line": 0}; - setContentAndUpdatePos(pos, - ["", "", "
"], - ""); - - var tag = HTMLUtils.getTagInfo(myEditor, pos); - expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.CLOSING_TAG, 2, "html")); - }); - it("should find the tagname of the current tag if two tags are right next to each other", function () { var pos = {"ch": 0, "line": 0}; setContentAndUpdatePos(pos, @@ -247,6 +237,16 @@ define(function (require, exports, module) { expect(tag).toEqual(HTMLUtils.createTagInfo()); }); + it("should not hint anything inside a closing tag", function () { + var pos = {"ch": 0, "line": 0}; + setContentAndUpdatePos(pos, + ["", "", "
"], + ""); + + var tag = HTMLUtils.getTagInfo(myEditor, pos); + expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.CLOSING_TAG, 2, "html")); + }); + it("should not find attributes in an empty editor", function () { var pos = {"ch": 0, "line": 0}; var attrs = HTMLUtils.getTagAttributes(myEditor, pos);