Commit Graph
53 Commits
Author SHA1 Message Date
dloverin d65fbdcacf Allow preferences to be overridden by a configuration file.
src/extensions/default/JavaScriptCodeHints/Preferences.js
    New class to parse JSON preferences object and store preferences.
src/extensions/default/JavaScriptCodeHints/ScopeManager.js
    Look for preference file, .jscodehints, in the project root directory.
    Remove obsolete "shouldPrimePump" parameter.
src/extensions/default/JavaScriptCodeHints/main.js
    Remove obsolete "shouldPrimePump" parameter.
src/extensions/default/JavaScriptCodeHints/unittests.js
    Add new preference tests.

Add new preference tests under unittest-files/preference-test-files
2013-06-07 08:51:05 -04:00
dloverin bcba5e3779 modified: src/extensions/default/JavaScriptCodeHints/ScopeManager.js
Don't update the modified range when 'null' keys (ctrl-space) are hinted.

modified:   src/extensions/default/JavaScriptCodeHints/main.js
When changing files, reset documentChanges to null.

modified:   src/extensions/default/JavaScriptCodeHints/unittests.js
Restore that content of a file after each test.
Update a test to wait for hints after it asks for hints. If the hints are not waited for the editor will be torn down before the hint completes, causing a null pointer exception.
2013-06-04 10:04:50 -04:00
dloverin cb8a0e9746 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.
2013-05-30 14:47:58 -04:00
Peter Flynn 427914df4b Hoist out a util for creating a mock Editor given an already-created
document, so JS code hints unit tests can share SpecRunnerUtils' mock-Editor
creation code instead of duplicating it.
2013-05-21 17:18:20 -07:00
dloverin 8642920d8c fix hinting on non-ascii characters 2013-05-17 07:43:08 -04:00
dloverin 18dd7a144b update the current file in tern when a new file is opened
exclude less*.min.js files
2013-05-16 16:13:45 -04:00
jzhang bd4feb5611 add more code hint tests for html file and module file 2013-05-16 14:45:36 -04:00
dloverin 8142ccdeb6 Fix a bug where the hinter was not failing over to gueses. Added code to Session.getHints to detect when guesses are needed so the caller can get the guesses from tern and call getHints again. 2013-05-15 12:37:43 -04:00
Narciso Jaramillo 9b2e9c4611 Merge pull request #3822 from adobe/dangoor/3589-underscore-names
Fix 3589 sort _ names to the bottom.
2013-05-14 15:50:09 -07:00
Erik Tierney dfb35c30f5 Update tern and acorn to latest - fixes a number of bugs.
Modified some of the expected output for unittests as tern was updated to produce arguably better results, particularly for jump-to-def.

Changed the jump to def logic so that it doesn't stomp on all the pending requests, and instead plays nicely with the other request types.
2013-05-14 14:34:06 -04:00
Kevin Dangoor 9672c7e19d Fix for #3589. In code hints, sort leading _ names to bottom.
This also alters StringMatch.multiFieldSort to use an array to define the sort order,
though I stopped short of deprecating the old { key: priority } format.
2013-05-14 12:42:16 -04:00
Erik Tierney e30c71f969 Don't need to call initializeSession from unittests anymore 2013-05-14 12:37:13 -04:00
dloverin 432ae558b9 Merge branch 'jump-to-def-tests' of https://github.com/eztierney/brackets into eztierney-jump-to-def-tests 2013-05-13 17:05:16 -04:00
Erik Tierney 6e5bce81b4 Make unittests for jump-to-def work when jumping to a new file.
Register a fake FILE_OPEN command with the command manager, since that's what the jump-to-def code will call to switch files.
2013-05-13 10:08:31 -04:00
dloverin 67e615c866 fixup for moved index.hmtl file 2013-05-13 09:02:27 -04:00
dloverin 47de2cb19c Merge branch 'master' into load-subdirs 2013-05-13 08:29:31 -04:00
dloverin 3f4314ba55 cleanup 2013-05-13 08:22:09 -04:00
Erik Tierney dfdff356a6 Fix Issue #3614
Don't hint on function, parameter, or variable declarations.
no hints for
var fo// we used to pop up hints here
2013-05-10 16:00:16 -04:00
dloverin 0558c97cf7 Merge pull request #3740 from jodyzhang/mywork4
add new test cases
2013-05-10 10:19:46 -07:00
dloverin dc9aba5fca Merge branch 'master' into load-subdirs 2013-05-10 12:43:28 -04:00
dloverin f2ba60c17f load additional files if the loaded files are not using modules.
refactored unittest files.
2013-05-10 12:34:17 -04:00
Erik Tierney 678ae5aed0 Code review cleanup - mostly in the unittests 2013-05-09 14:54:40 -04:00
jzhang fbf2437740 add new test cases 2013-05-07 14:50:46 -04:00
Randy Edmunds 53bf87ed22 Revert "Merge pull request #3697 from jeffslofish/Issue-3676"
This reverts commit 9e99101057, reversing
changes made to a9e27717f4.
2013-05-05 10:46:07 -07:00
Erik Tierney 84c239cf39 Merge branch 'master' into html-script-hinting
Fixup branch so it will merge cleanly again.

Conflicts:
	src/extensions/default/JavaScriptCodeHints/unittests.js
2013-05-03 14:50:57 -04:00
Erik Tierney a5b7100bd8 Merge pull request #3692 from dloverin/first-hint-perf
prime pump to improve first hint performance
2013-05-03 10:16:06 -07:00
dloverin d8b960d12f Merge pull request #3598 from eztierney/iss-3511
[JS Code Hints] Fix Issue #3511
2013-05-03 08:19:29 -07:00
Erik Tierney 9416e75828 Add tests for jscodehints in an html file.
Also fix some bugs with jump-to-def and function type hints uncovered by the tests.
2013-05-02 16:28:40 -04:00
dloverin 520ab57716 bypass pump when unittesting 2013-05-01 14:04:52 -04:00
dloverin 3a22861211 small changes for code review 2013-04-26 16:57:15 -04:00
dloverin 52d98980f0 Close hints when the cursor moves to a new hinting context 2013-04-26 09:57:08 -04:00
Erik Tierney a4c87a6bba Fix Issue #3511
when inserting a hint which is not a valid property name, such as 'my-key', insert the hint as ["my-key"] instead of .my-key.

insertHint now runs the hint through the acorn tokenizer to see if it looks like a valid property name.  If it's invalid, it replaces the '.' with brackets.
Refactored some code in Session.getType() - pulled out a method to find the leading '.' in a property lookup, and use that method from the insertHint logic as well.
Added 3 new unittests to test this new behavior.
2013-04-24 15:40:05 -04:00
Erik Tierney 10f8896d46 cleanup based on codereview comments:
Update jsdoc
use ExtensionUtils.getModulePath instead of manually slicing up path
use FileUtils.readAsText instead of DocumentManager when we only need the text on disk
Call CollectionUtils.hasProperty instead of Object.prototype.hasOwnProperty...
Add comment explaining logic around finding location of called function for function type hinting
remove unnecessary calls to setCursorPos
remove stale comments in unittests
pull out hint invalidation check into a function and remove check for query.length === 0, not necessary anymore
2013-04-18 16:38:40 -04:00
dloverin f6a073ca3d When typing, only automatically show hints for the "." character and JS identifier characters. 2013-04-17 17:29:48 -04:00
Erik Tierney c5052f8e33 Add a couple of unit tests for jump to definition
Only tests in file, inter file needs more work - have to figure out how to make CommandManager work from the unittester.
2013-04-16 18:49:09 -04:00
Erik Tierney ebc6b647c6 Add some more unit tests
covers require support, jsdoc, function types
2013-04-16 11:51:41 -04:00
Erik Tierney d96d73d895 cleanup jslint warnings 2013-04-15 09:43:37 -04:00
dloverin 3eee0bef6f use .value instead of .label to reduce confusion 2013-04-13 11:01:46 -04:00
dloverin ab0b3728a1 Get hint value from 'label' property instead of 'value' property 2013-04-13 09:50:54 -04:00
Erik Tierney e46d260a09 Get all unit tests passing
Fix a caching problem where old hints were getting used.
Update selection tests to search for the index to insert instead of hardcoding the index so the tests are less fragile.
2013-04-12 15:14:26 -04:00
Erik Tierney 5e11b5abf1 Updates to expected results. 2013-04-12 13:30:11 -04:00
Erik Tierney ee2dd1d518 Fix for issue when multiple requests were made
Were creating a new Promise for each request, but only resolving the last one.  Now check to see if we already have a promise for a particular request, and return the already existing one if there is one.
2013-04-11 16:31:36 -04:00
Erik Tierney 8131900e9b Some unit test cleanup 2013-04-11 15:49:07 -04:00
Peter Flynn 821b7b2e19 Move status bar code out of EditorManager into a new module. Keeps
EditorManager tightly focused on maintaining the set of Editors and gives
the status bar code room to grow for future UI additions.

This removes EditorManager._init() and the manual calls to it from unit
tests, which seem unnecessary. EditorStatusBar._init() is still called on
htmlReady - just not manually called by any unit tests.

Also, change the status bar code to use active editor more consistently
(used to use focused editor sometimes).
2013-03-06 20:09:50 -08:00
Peter Flynn 5a026ec9ff Update JS code hints (including unit tests) to work with new language and
Editor APIs.
2013-02-26 15:45:23 -08:00
Joel Brandt 1f1d074180 more doc fixups 2013-02-26 09:53:54 -08:00
Joel Brandt bc8d9d8e2a more fixes to jsdocs 2013-02-26 06:16:30 -08:00
Ian Wehrman c8b53c7153 type capitalization typos and additional JSDoc annotations 2013-02-25 17:53:00 -08:00
Ian Wehrman 3d66c59b7e Typos and clarifications 2013-02-24 12:51:01 -08:00
Ian Wehrman c0e75bcc7e Add remaining JSDoc annotations 2013-02-24 12:45:58 -08:00