Граф коммитов

28 Коммитов

Автор SHA1 Сообщение Дата
Will Lorey 328a2cb675
Switch to ESLint (#1851) 2021-04-29 15:36:37 -07:00
Eric Jizba ad073a99b8
Turn on several auto-fixable lint rules 🧹 (#1316) 2020-01-28 14:50:56 -08:00
Prashanth 1139946191
Add conditions to RegexLiteral to avoid matching with multi-line comment '/*' (#901) 2018-10-31 15:05:25 -07:00
Ayush Rawal 33d6637c0c Update grammer/README.md (#890)
Remove redundant information from readme
2018-10-24 09:33:45 -07:00
Prashanth f503533e98
Set method chaining to flag; use it to execute command in shell (#850)
* Set method chaining to flag; use it to execute command in shell
* Add tests
2018-10-16 13:56:10 -07:00
Prashanth 4117863eab
Add regex support for find commands in the scrapbook (#761)
* parser arguments -  Use EJSON to stringify
* Account for escaped '/' in regexes
* 1.Split according to trailing slash.
2. Show an error for malformed regexes (user is halfway typing)
3. Add tests
2018-09-24 12:26:13 -07:00
Prashanth 9fbae9a94c
Allow unquoted strings for property values, Allow collection names to have dots (#729)
* Rename STRING_LITERAL to identifier

* propertyName: Allow identifiers too

* Modiify error in failing test to match new implementation.

* 1. Allow collection names to have dots.
2. Modify some tests to check for strings in double quotes, single quotes
and no quotes
3. Add test cases from user-filed issues.

* One more test

* Merge commit from rebase:
1. Regenerate grammar from rebase.
2. Modify outputs from tests to make them pass the new grammar.
3. getAllcommands- sort the errors based on starting position

* Add test for issue #722: Unrecognized child type.

* Address feedback.

* Add test case from user filed issue
2018-06-28 20:17:36 -07:00
Stephen Weatherford (MSFT) 46520b2a88
Use error listeners and catch errors not associated with command (#711) 2018-06-26 17:18:46 -07:00
Prashanth e41cdd30d1
Handle single quotes in scrapbook (#685)
* Initial commit + tests. TESTS WILL FAIL.

* Initial commit. EOD work draft.

* Parse property name value tokens. Works for single-quoted strings.
TODO: Remove command.arguments and use command.argumentObjects.

* Fix handling of ArrayLiteralContexts to pass tests

* Handle numbers, booleans properly in the input.
Handling undefined still fails.

* Fix errors popping up when the user is still typing.

* Remove unused import

* Changes based on feedback

* Implement filterType, findType.
RandomUtils: Remove getRandomHexString (unused)

* Changes based on Feedback

* Throw errors based on feedback.
g4: Ensure '1.' (incomplete decimal) is an error node.

* Changes based on feedback

* Feedback

* prevent functionCallContext from throwing. Make some tests smaller.

* STRING_LITERAL  : disallow single quotes.
Hinders the parser from tokenizing as functionCallContext needlessly.

* Tests: nested objects, incomplete calls (replicate user typing)

* Fix failing tests

* Add more test cases

* Handle empty arrays in argument - accompanying test

* Ensure this._query & this._proj are undefined if query is [].
Fixes #715 that this PR introduces.
2018-06-26 14:35:17 -07:00
Stephen Weatherford (MSFT) 33b1e8658a
More instructions for debugging .g4 (#690) 2018-06-18 14:52:03 -07:00
Stephen Weatherford (MSFT) b617b25de8
Enable debugging Mongo grammar via mike-lischke.vscode-antlr4 extension (#651) 2018-05-31 11:05:22 -07:00
Stephen Weatherford (MSFT) 768d2a8f58
Format mongo.g4 (no functional changes) (#650) 2018-05-30 17:23:59 -07:00
Stephen Weatherford (MSFT) a8c1a0e626
argumentList -> argument, fixes #469 (#542) 2018-04-19 11:34:58 -07:00
Stephen Weatherford (MSFT) 1664e8fa5b
Stop publishing JS grammar, fixes #464 (#490)
* Stop publishing JS grammar, fixes #464

* fix
2018-04-04 14:11:45 -07:00
Prashanth 0ca7e6320f
Recognize multiple parameters in a command, and support them for find, findOne, insertMany (#460)
* Initial Commit

* Accept multiple arguments from the parser.

* remove commented code

* Support findOne

* InsertMany -> conform to Mongo shell 3.2 (allow collectionWriteOptions)

* Support find with  a query and projection

* rename and fix collectionWriteOptions

* Based on Feedback

* Add tests. Rebuild mongo grammar files in light of merge

* Revert antlr version

* tests - use deepEqual instead of equal to pass object comparison test.

* More parse tests

* fix single argument case

* Add test for missing commas

* Add comma requirement to arguments token.
Throw error if the visitor hits an ErrorNode

* mongo.g4: Add case for 0 arguments
tests:
- Make nested params (array) compliant
- Add empty object argument db.test.find({})

* Change the no-argument rule
2018-04-02 16:20:26 -07:00
Stephen Weatherford (MSFT) 63f5828855
Fix handling of CRLF and add some unit tests, fixes #386 (#456)
* Fix handling of CRLF and add some unit tests, fixes #386

* More unit tests

* fix
2018-03-30 14:09:35 -07:00
Sandeep Somavarapu 5c64c92329 Fix grammar to exclude , in string 2017-05-11 17:07:35 +02:00
Sandeep Somavarapu 2100140256 Fix arguments parsing - Parse only command function arguments 2017-05-09 16:44:34 +02:00
Sandeep Somavarapu a6af2cbbf6 Fix #18 2017-05-09 12:42:18 +02:00
Sandeep Somavarapu 558bbc378c Support negative numeric literals 2017-05-08 21:28:18 +02:00
Sandeep Somavarapu ae2b7f3be7 Implement update mongo document 2017-05-08 15:12:10 +02:00
Sandeep Somavarapu d559f427ff Support multi line commands 2017-05-05 17:42:21 +02:00
Sandeep Somavarapu aa01176343 Support CRLF in antlr grammar 2017-04-27 15:59:02 +02:00
Sandeep Somavarapu c8fc4405e6 Fix #10 2017-04-27 11:17:17 +02:00
Sandeep Somavarapu 3d431b5542 Fix grammar 2017-04-20 18:53:55 +02:00
Sandeep Somavarapu 7b47bc0953 Fix Grammar and completion proposals 2017-04-20 18:21:14 +02:00
Sandeep Somavarapu 300b4b3a16 Language configuration
- Auto closing pairs
2017-04-20 15:30:11 +02:00
Sandeep Somavarapu 914c9b3cfd Mongo language server
- Completion item provider
2017-04-20 13:42:55 +02:00