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

2817 Коммитов

Автор SHA1 Сообщение Дата
Nick Guerrera 49385ddfb5 Introduce language server and add live parse errors to VS Code 2021-03-11 16:37:51 -08:00
Nick Guerrera 0975c022fc Use wasm version of oniguruma (#366) 2021-03-11 14:28:42 -08:00
David Wilson 0b491e6f2f Merge pull request #364 from daviwil/publish-0.3.0
Prepare @azure-tools/adl 0.3.0 for publishing
2021-03-11 14:08:28 -08:00
David Wilson 25fa27a36e Prepare @azure-tools/adl 0.3.0 for publishing 2021-03-11 11:15:12 -08:00
Nick Guerrera d6b42466eb Fix off-by-one error preventing empty string literals (#361) 2021-03-09 15:01:01 -08:00
James Casey aa12229c7b Merge pull request #360 from nguerrera/fix-typo
Fix typo in format scripts
2021-03-05 13:09:18 -08:00
Nick Guerrera 50954d6b80 Fix typo in format scripts 2021-03-05 12:55:30 -08:00
Nick Guerrera 3fd267eed1 Keep diagnostic data structured in DiagnosticError (#358) 2021-03-05 12:05:24 -08:00
Nick Guerrera 346670ab43 Track extension version with rush change (#322) 2021-03-05 12:04:55 -08:00
Nick Guerrera b5ae16c98c Run prettier and check formatting on more files (#348) 2021-03-05 12:01:35 -08:00
Brian Terlson 338ff4a187 Merge pull request #324 from bterlson/new-checker
Refactor checker, implemented nested namespaces, fix bugs
2021-03-04 15:56:00 -08:00
Brian Terlson f9a2d3ce7b move some throwDiag to regular exceptions 2021-03-04 15:36:51 -08:00
Brian Terlson e993c2355c format 2021-03-04 13:50:24 -08:00
Brian Terlson 3773cb1c04 Fix type name generation 2021-03-04 13:44:04 -08:00
Brian Terlson ca96f9cf3b It's ok to run decorators on non-templated models 2021-03-04 12:29:24 -08:00
Brian Terlson 47866d53d8 Finish namespace implementation, fix circularity 2021-03-04 11:57:26 -08:00
David Wilson 55ac2208f5 Implement nested namespace parsing, rename some core types 2021-03-04 10:05:37 -08:00
Brian Terlson d617fe3000 Remove ast-node type caching, fix bugs, refactor. 2021-03-03 17:12:30 -08:00
James Casey 8c6c5cb97b Merge pull request #306 from jamesc/jc/tags
Add tag decorator
2021-03-02 14:12:51 -08:00
James Casey 865bca432f Add tag decorator
This applies to both namespaces and operations.  The tags for a
operation is the union of the oeration and namespace tags.

Empty tags sections are added to an operation if no tags are specified.

Sample usage:
```
@tag("foo")
@tag("bar")
namespace test {
  @tag("my_ops")
  op create(@path id:int32): null;
}
```
2021-03-02 14:03:50 -08:00
Nick Guerrera 3ddff8ef08 Make sure to build before packaging (#318) 2021-03-01 14:16:59 -08:00
Nick Guerrera d0dbe22e0c Introduce vscode extension with syntax highlighting (#314) 2021-03-01 13:35:48 -08:00
Nick Guerrera dbe9ffd544 Prettier (#316)
* Setup prettier with config borrowed from azure-sdk-for-js
* Run prettier to format existing code
* Turn format on save on so VS Code with prettier will auto-format
* Add rush check-format / rush format to check formatting / run prettier on whole repo
* Add check-format to PR validation
2021-03-01 12:55:14 -08:00
Brian Terlson 9094a8a7c8 Add nostdlib (#317) 2021-03-01 12:33:35 -08:00
Brian Terlson 4c67999669 Fix class extends t (#315) 2021-03-01 11:37:36 -08:00
Nick Guerrera 02141ec9ba Improve programmer productivity with diagnostics (#301)
1. Make throwDiagnostic take the target directly and figure out the
   location rather than having the programmer call getSourceLocation.

2. If getting location or formatting message fails, include as much of
   the diagnostic as possible in the internal compiler error.
2021-02-16 10:41:51 -08:00
Nick Guerrera ba844ea8e5 Log source location with all errors (#295)
Everywhere we throw an error now reports a location. Use
throwDiagnostic plus getSourceLocationOfXxx helpers going forward
for new errors. (We still need to do error recovery and not just
throw at the first sign of trouble, but that isn't part of this
initial pass.)

Fix duplicate name reporting in binder to report duplicates in
the same file as an error and to report locations of all
duplicates up to the first bound source file that introduced at
least one.

Fix issue where failed compilation was saying "Compilation
completed successfully" and ensure process exits with non-zero
code on failure.
2021-02-12 15:33:02 -08:00
Brian Terlson d0e9927db2 Merge pull request #291 from bterlson/compref
Implement #276 composition reform.

Closes #276. Closes #233.
2021-02-12 14:43:00 -08:00
Brian Terlson 08cc454619 Fix language.md conflicT 2021-02-12 14:34:39 -08:00
Brian Terlson 4709e4db1f move visibility decorators into lib 2021-02-12 14:32:32 -08:00
Brian Terlson 6fd5cb1757 Add better error message 2021-02-12 14:32:31 -08:00
Brian Terlson 632ff0840e move to explicit body for Ok<T>, support explicit body in openapi emitter 2021-02-12 14:32:31 -08:00
Brian Terlson 04129fd15a cleanup 2021-02-12 14:32:31 -08:00
Brian Terlson abce858641 cleanup 2021-02-12 14:32:31 -08:00
Brian Terlson fcbb7603ef Implement #276 composition reform 2021-02-12 14:32:27 -08:00
Nick Guerrera 2a7e9394d5 Update to grammarkdown 3.1.2 (#296)
Fixes issue with git warnings about CRLF
2021-02-12 14:01:34 -08:00
Nick Guerrera a0ea765fbf Add optional properties and missing punctuation to grammar (#289) 2021-02-10 11:26:10 -08:00
Nick Guerrera a8b5456762 Remove some casts (#283) 2021-02-10 11:24:53 -08:00
David Wilson 38f915eb87 Merge pull request #288 from daviwil/testserver-media-types
Add converted autorest.testserver media-types spec
2021-02-10 09:36:58 -08:00
David Wilson 289c504a82 Enable minLength and maxLength to be applied to model properties 2021-02-09 16:16:28 -08:00
Nick Guerrera d9b9a590d9 Merge pull request #287 from nguerrera/parse-error-file-path
Include source file path in parse error log
2021-02-09 15:25:18 -08:00
Nick Guerrera 1dad0e6bfb Include source file path in parse error log 2021-02-09 14:03:10 -08:00
Nick Guerrera 48f1f7c633 Turn off eslint, format on save (#284) 2021-02-09 09:42:34 -08:00
Nick Guerrera 2418aa6f8d Add back line and column tracking (#282) 2021-02-08 15:48:53 -08:00
David Wilson 14a268db3b Merge pull request #280 from daviwil/interface-to-namespace
Rename 'interface' concept to 'namespace'
2021-02-08 13:19:35 -08:00
David Wilson ab08676c37 Fix namespace examples in unit tests 2021-02-08 11:49:56 -08:00
David Wilson 4f704c9cc3 Add `op` keyword for namespace properties 2021-02-08 11:45:07 -08:00
David Wilson f056c012e4 Update grammar file to reflect interface -> namespace 2021-02-08 11:44:07 -08:00
David Wilson 73ddb6858b Change 'interface' keyword to 'namespace' 2021-02-08 11:44:05 -08:00
Nick Guerrera 3198caebe3 Refactor scanner to use less state (#281)
The scanner was doing a lot of work per character. While this may have
been a performance problem, the motivation here is maintainability. This
change makes it so that advancing by one character is simply Scanner.position++.
It also does more work lazily: allocating substrings on demand.

Highlights:

* Remove unused tokens
* Rename Kind to Token
* Remove token position map
* Remove character size bookkeeping
* Remove (ch, chNext, chNext) state
* Convert class to closure

Note: Line and column tracking was temporarily removed to facilitate
refactoring and will be re-added in the following change.
2021-02-08 11:38:10 -08:00