Skip to content

Parse tspconfig as yaml to be able to figure out where errors are#2273

Merged
timotheeguerin merged 28 commits into
microsoft:mainfrom
timotheeguerin:feature/yaml-ast
Sep 8, 2023
Merged

Parse tspconfig as yaml to be able to figure out where errors are#2273
timotheeguerin merged 28 commits into
microsoft:mainfrom
timotheeguerin:feature/yaml-ast

Conversation

@timotheeguerin

@timotheeguerin timotheeguerin commented Aug 8, 2023

Copy link
Copy Markdown
Member

fix #2298
Update yaml parser library from js-yaml to yaml which allow us to have an ast and resolve where values are coming from.

Before

image Now: image

On top of providing error locations for config errors that the compiler can resolve this also setup the base to provide the ability for an emitter to report na error on its emitter options and show where it is.

@github-actions

github-actions Bot commented Aug 8, 2023

Copy link
Copy Markdown
Contributor

Changes in this PR will be published to the following url to try(check status of TypeSpec Pull Request Try It pipeline for publish status):
Playground: https://cadlplayground.z22.web.core.windows.net/prs/2273/

Website: https://cadlwebsite.z1.web.core.windows.net/prs/2273/

Comment thread packages/compiler/src/config/config-loader.ts
@timotheeguerin timotheeguerin changed the title Feature/yaml ast Parse tspconfig as yaml to be able to figure out where errors are Aug 8, 2023
Comment thread packages/compiler/src/yaml/types.ts Outdated
@timotheeguerin
timotheeguerin marked this pull request as ready for review August 9, 2023 17:58

@markcowl markcowl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would also be nice to see the impact on typespec-azure

Comment thread packages/samples/test/output/grpc-library-example/@typespec/openapi3/openapi.yaml Outdated

@markcowl markcowl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please file an uptake PR in Azure/typespec-azure before merging.

@timotheeguerin

Copy link
Copy Markdown
Member Author

Please file an uptake PR in Azure/typespec-azure before merging.

PR Azure/typespec-azure#3513

@timotheeguerin
timotheeguerin merged commit 1098447 into microsoft:main Sep 8, 2023
@timotheeguerin
timotheeguerin deleted the feature/yaml-ast branch September 8, 2023 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Load config yaml as ast to be able to report errors position

3 participants