mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
Implement requests with partial file text to reduce memory usage for large files.
Add large comment to file1.js test file so it will be considered a large file and partial text updates can be tested. For now, move two failing tests apart so they pass. Partial text updates are notas good a full text updates but save memory.
This commit is contained in:
1 parent
ae950bdfce
commit
cb8a0e9746
6 files changed
+480
-182
No files matched your search
@@ -54,7 +54,8 @@ define(function (require, exports, module) {
|
||||
cachedHints = null, // sorted hints for the current hinting session
|
||||
cachedType = null, // describes the lookup type and the object context
|
||||
cachedToken = null, // the token used in the current hinting session
|
||||
matcher = null; // string matcher for hints
|
||||
matcher = null, // string matcher for hints
|
||||
ignoreChange; // can ignore next "change" event if true;
|
||||
|
||||
/**
|
||||
* Get the value of current session.
|
||||
@@ -377,6 +378,8 @@ define(function (require, exports, module) {
|
||||
// Compute fresh hints if none exist, or if the session
|
||||
// type has changed since the last hint computation
|
||||
if (this.needNewHints(session)) {
|
||||
ScopeManager.handleFileChange({from: cursor, to: cursor, text: [key]});
|
||||
ignoreChange = true;
|
||||
var scopeResponse = ScopeManager.requestHints(session, session.editor.document);
|
||||
|
||||
if (scopeResponse.hasOwnProperty("promise")) {
|
||||
@@ -530,8 +533,11 @@ define(function (require, exports, module) {
|
||||
if (editor && HintUtils.isSupportedLanguage(LanguageManager.getLanguageForPath(editor.document.file.fullPath).getId())) {
|
||||
initializeSession(editor, previousEditor, true);
|
||||
$(editor)
|
||||
.on(HintUtils.eventName("change"), function () {
|
||||
ScopeManager.handleFileChange(editor.document);
|
||||
.on(HintUtils.eventName("change"), function (event, editor, changeList) {
|
||||
if (!ignoreChange) {
|
||||
ScopeManager.handleFileChange(changeList);
|
||||
}
|
||||
ignoreChange = false;
|
||||
});
|
||||
} else {
|
||||
session = null;
|
||||
@@ -567,7 +573,7 @@ define(function (require, exports, module) {
|
||||
* Handle JumptoDefiniton menu/keyboard command.
|
||||
*/
|
||||
function handleJumpToDefinition() {
|
||||
var offset = session.getOffset(),
|
||||
var offset = session.getCursor(),
|
||||
response = ScopeManager.requestJumptoDef(session, session.editor.document, offset);
|
||||
|
||||
if (response.hasOwnProperty("promise")) {
|
||||
@@ -597,7 +603,7 @@ define(function (require, exports, module) {
|
||||
* Helper for QuickEdit jump-to-definition request.
|
||||
*/
|
||||
function quickEditHelper() {
|
||||
var offset = session.getOffset(),
|
||||
var offset = session.getCursor(),
|
||||
response = ScopeManager.requestJumptoDef(session, session.editor.document, offset);
|
||||
|
||||
return response;
|
||||
|
||||
Reference in new issue
Block a user