mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
Revert "Merge pull request #3697 from jeffslofish/Issue-3676"
This reverts commit9e99101057, reversing changes made toa9e27717f4.
This commit is contained in:
1 parent
9e99101057
commit
53bf87ed22
35 files changed
+996
-104
No files matched your search
@@ -332,7 +332,7 @@ define(function (require, exports, module) {
|
||||
// create Editor instance (containing a CodeMirror instance)
|
||||
runs(function () {
|
||||
testEditor = createMockEditor(testDoc);
|
||||
JSCodeHints.initializeSession(testEditor);
|
||||
JSCodeHints.initializeSession(testEditor, false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -731,6 +731,53 @@ define(function (require, exports, module) {
|
||||
});
|
||||
});
|
||||
|
||||
it("should insert hint as [\"my-key\"] since 'my-key' is not a valid property name", function () {
|
||||
var start = { line: 49, ch: 0 },
|
||||
middle = { line: 49, ch: 5 },
|
||||
end = { line: 49, ch: 13 };
|
||||
|
||||
testDoc.replaceRange("arr.m", start, start);
|
||||
testEditor.setCursorPos(middle);
|
||||
var hintObj = expectHints(JSCodeHints.jsHintProvider);
|
||||
selectHint(JSCodeHints.jsHintProvider, hintObj, "my-key");
|
||||
runs(function () {
|
||||
expect(testEditor.getCursorPos()).toEqual(end);
|
||||
expect(testDoc.getRange(start, end)).toEqual("arr[\"my-key\"]");
|
||||
expect(testDoc.getLine(end.line).length).toEqual(13);
|
||||
});
|
||||
});
|
||||
|
||||
it("should insert hint as [\"my-key\"] make sure this works if nothing is typed after the '.'", function () {
|
||||
var start = { line: 49, ch: 0 },
|
||||
middle = { line: 49, ch: 4 },
|
||||
end = { line: 49, ch: 13 };
|
||||
|
||||
testDoc.replaceRange("arr.", start, start);
|
||||
testEditor.setCursorPos(middle);
|
||||
var hintObj = expectHints(JSCodeHints.jsHintProvider);
|
||||
selectHint(JSCodeHints.jsHintProvider, hintObj, "my-key");
|
||||
runs(function () {
|
||||
expect(testEditor.getCursorPos()).toEqual(end);
|
||||
expect(testDoc.getRange(start, end)).toEqual("arr[\"my-key\"]");
|
||||
expect(testDoc.getLine(end.line).length).toEqual(13);
|
||||
});
|
||||
});
|
||||
|
||||
it("should insert hint as '.for' since keywords can be used as property names", function () {
|
||||
var start = { line: 49, ch: 0 },
|
||||
middle = { line: 49, ch: 5 },
|
||||
end = { line: 49, ch: 7 };
|
||||
|
||||
testDoc.replaceRange("arr.f", start, start);
|
||||
testEditor.setCursorPos(middle);
|
||||
var hintObj = expectHints(JSCodeHints.jsHintProvider);
|
||||
selectHint(JSCodeHints.jsHintProvider, hintObj, "for");
|
||||
runs(function () {
|
||||
expect(testEditor.getCursorPos()).toEqual(end);
|
||||
expect(testDoc.getRange(start, end)).toEqual("arr.for");
|
||||
expect(testDoc.getLine(end.line).length).toEqual(7);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user