-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added logic to control autocomplete #678
Changes from 7 commits
69ac49e
85e3a53
fb208bc
96af8d3
7bf5372
7e423d1
c82a850
c50d758
2b23253
b1dc373
7099880
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,6 +204,7 @@ define([ | |
self.getSidebarVisible = function() { return _state.sidebarVisible; }; | ||
self.getRootDir = function() { return _root; }; | ||
self.getWordWrap = function() { return _state.wordWrap; }; | ||
self.getAutoComplete = function() { return _state.allowAutoComplete; }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because you're changing the public API, please update the README as well, see https://github.com/mozilla/brackets#bramble-instance-getters |
||
self.getAutoCloseTags = function() { return _state.autoCloseTags; }; | ||
self.getAllowJavaScript = function() { return _state.allowJavaScript; }; | ||
self.getAutoUpdate = function() { return _state.autoUpdate; }; | ||
|
@@ -267,6 +268,7 @@ define([ | |
_state.wordWrap = data.wordWrap; | ||
_state.autoCloseTags = data.autoCloseTags; | ||
_state.allowJavaScript = data.allowJavaScript; | ||
_state.autoComplete = data.autoComplete; | ||
_state.autoUpdate = data.autoUpdate; | ||
|
||
setReadyState(Bramble.READY); | ||
|
@@ -309,6 +311,14 @@ define([ | |
_state.allowJavaScript = data.allowJavaScript; | ||
} else if (eventName === "tutorialVisibilityChange") { | ||
_tutorialVisible = data.visible; | ||
} else if (eventName === "TagHintsChange") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a leaky abstraction, and I'd like to harmonize these event types into a single |
||
_state.allowAutoComplete = data.value; | ||
} else if (eventName === "AttrHintsChange") { | ||
_state.allowAutoComplete = data.value; | ||
} else if (eventName === "JSHintsChange") { | ||
_state.allowAutoComplete = data.value; | ||
} else if (eventName === "CssPropHintsChange") { | ||
_state.allowAutoComplete = data.value; | ||
} else if (eventName === "autoUpdateChange") { | ||
_state.autoUpdate = data.autoUpdate; | ||
} | ||
|
@@ -426,6 +436,7 @@ define([ | |
previewMode: _state.previewMode, | ||
wordWrap: _state.wordWrap, | ||
allowJavaScript: _state.allowJavaScript, | ||
allowAutoComplete: _state.allowAutoComplete, | ||
autoCloseTags: _state.autoCloseTags, | ||
autoUpdate: _state.autoUpdate | ||
} | ||
|
@@ -909,6 +920,14 @@ define([ | |
this._executeRemoteCommand({commandCategory: "bramble", command: "BRAMBLE_DISABLE_SCRIPTS"}, callback); | ||
}; | ||
|
||
BrambleProxy.prototype.startAutoComplete = function(callback) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please change this to |
||
this._executeRemoteCommand({commandCategory: "bramble", command: "START_AUTO_COMPLETE"}, callback); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change the command name to |
||
}; | ||
|
||
BrambleProxy.prototype.stopAutoComplete = function(callback) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please change this to |
||
this._executeRemoteCommand({commandCategory: "bramble", command: "STOP_AUTO_COMPLETE"}, callback); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change the command name to |
||
}; | ||
|
||
BrambleProxy.prototype.enableInspector = function(callback) { | ||
this._executeRemoteCommand({commandCategory: "bramble", command: "BRAMBLE_ENABLE_INSPECTOR"}, callback); | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,6 +157,40 @@ define(function (require, exports, module) { | |
}); | ||
}); | ||
|
||
// Listen for changes to TagHints | ||
PreferencesManager.on("change", "codehint.TagHints", function () { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like the idea of sending 4 separate events for state changes on a variable that we're tracking in the StateManager as a single boolean. Can you harmonize these so they all send the same |
||
sendEvent({ | ||
type: "bramble:TagHintsChange", | ||
value: PreferencesManager.get("codehint.TagHints") | ||
}); | ||
}); | ||
|
||
// Listen for changes to AttrHints | ||
PreferencesManager.on("change", "codehint.AttrHints", function () { | ||
sendEvent({ | ||
type: "bramble:AttrHintsChange", | ||
value: PreferencesManager.get("codehint.AttrHints") | ||
}); | ||
}); | ||
|
||
|
||
// Listen for changes to JSHints | ||
PreferencesManager.on("change", "codehint.JSHints", function () { | ||
sendEvent({ | ||
type: "bramble:JSHintsChange", | ||
value: PreferencesManager.get("codehint.JSHints") | ||
}); | ||
}); | ||
|
||
|
||
// Listen for changes to CssPropHints | ||
PreferencesManager.on("change", "codehint.CssPropHints", function () { | ||
sendEvent({ | ||
type: "bramble:CssPropHintsChange", | ||
value: PreferencesManager.get("codehint.CssPropHints") | ||
}); | ||
}); | ||
|
||
//Listen for changes to auto update | ||
PreferencesManager.on("change", "autoUpdate", function () { | ||
sendEvent({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a general concern. In some places you use
Autocomplete
and in othersAutoComplete
. Once upon a time I implemented a bunch of code in Firefox related to the FullScreen API which later became the Fullscreen API, and it left me very nervous about the bugs that can creep in with such inconsistencies. When I Google this, most people seem to use "Autocomplete." Should we do that everywhere? I actually don't care as long as we're consistent in all places, here and in Thimble.