-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Diagnostic
type and remove ariadne from public API
#963
Conversation
🦋 Changeset detectedLatest commit: 4e85c4d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
I have to rebase this as #962 landed in the meantime. |
crates/codegen/runtime/cargo/src/runtime/napi_interface/parse_error.rs
Outdated
Show resolved
Hide resolved
crates/testlang/outputs/cargo/slang_testlang/src/generated/diagnostic.rs
Show resolved
Hide resolved
@@ -33,7 +33,9 @@ required-features = ["cli"] | |||
|
|||
[features] | |||
default = ["cli"] | |||
cli = ["dep:anyhow", "dep:clap", "dep:serde_json"] | |||
cli = ["dep:anyhow", "dep:clap", "dep:serde_json", "__private_ariadne"] | |||
# This is meant to be used by the CLI or internally only. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: I wonder why are we adding an extra feature here, instead of just adding dep:ariadne
to the existing default cli
feature (enabled by default). This will also mean that we won't need to explicitly enable it in other crates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the comment, because it's also used internally (by our other crates crates in the workspace) and not only via the CLI, see https://github.com/NomicFoundation/slang/pull/963/files#diff-059ed3ad7d6d34ada23bb6a205ff05636f0f434ff9fa8ebf7c1a0c596b81b893R22 for instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really exciting! Thank you!
I left a few questions/suggestions.
I've resolved your final concerns @OmarTawfik:
We might decide to get rid of the napi-exported |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing). If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @nomicfoundation/slang@0.15.0 ### Minor Changes - [#975](#975) [`46b1dde`](46b1dde) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename `QueryResult` to `QueryMatch`, and its `bindings` to `captures`. - [#971](#971) [`be943b7`](be943b7) Thanks [@Xanewok](https://github.com/Xanewok)! - Rename `RuleKind` to `NonterminalKind`, `TokenKind` to `TerminalKind`, and `NodeLabel` to `EdgeLabel`. - [#963](#963) [`a5593f9`](a5593f9) Thanks [@Xanewok](https://github.com/Xanewok)! - Introduce a `Diagnostic` API for compiler errors, warnings etc. ### Patch Changes - [#996](#996) [`cdc153d`](cdc153d) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add support for version `0.8.26`. - [#983](#983) [`ea31417`](ea31417) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Expose the language root non-terminal kind at `Language.rootKind()`. - [#965](#965) [`61b6b06`](61b6b06) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - refactor CST building and querying utilities into a separate `metaslang_cst` crate. - [#997](#997) [`84ad856`](84ad856) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - Support stack assignments in Yul before `0.5.0`. ## @nomicfoundation/slang-darwin-arm64@0.15.0 ### Minor Changes - [#975](#975) [`46b1dde`](46b1dde) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename `QueryResult` to `QueryMatch`, and its `bindings` to `captures`. - [#971](#971) [`be943b7`](be943b7) Thanks [@Xanewok](https://github.com/Xanewok)! - Rename `RuleKind` to `NonterminalKind`, `TokenKind` to `TerminalKind`, and `NodeLabel` to `EdgeLabel`. - [#963](#963) [`a5593f9`](a5593f9) Thanks [@Xanewok](https://github.com/Xanewok)! - Introduce a `Diagnostic` API for compiler errors, warnings etc. ### Patch Changes - [#996](#996) [`cdc153d`](cdc153d) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add support for version `0.8.26`. - [#983](#983) [`ea31417`](ea31417) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Expose the language root non-terminal kind at `Language.rootKind()`. - [#965](#965) [`61b6b06`](61b6b06) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - refactor CST building and querying utilities into a separate `metaslang_cst` crate. - [#997](#997) [`84ad856`](84ad856) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - Support stack assignments in Yul before `0.5.0`. ## @nomicfoundation/slang-darwin-x64@0.15.0 ### Minor Changes - [#975](#975) [`46b1dde`](46b1dde) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename `QueryResult` to `QueryMatch`, and its `bindings` to `captures`. - [#971](#971) [`be943b7`](be943b7) Thanks [@Xanewok](https://github.com/Xanewok)! - Rename `RuleKind` to `NonterminalKind`, `TokenKind` to `TerminalKind`, and `NodeLabel` to `EdgeLabel`. - [#963](#963) [`a5593f9`](a5593f9) Thanks [@Xanewok](https://github.com/Xanewok)! - Introduce a `Diagnostic` API for compiler errors, warnings etc. ### Patch Changes - [#996](#996) [`cdc153d`](cdc153d) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add support for version `0.8.26`. - [#983](#983) [`ea31417`](ea31417) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Expose the language root non-terminal kind at `Language.rootKind()`. - [#965](#965) [`61b6b06`](61b6b06) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - refactor CST building and querying utilities into a separate `metaslang_cst` crate. - [#997](#997) [`84ad856`](84ad856) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - Support stack assignments in Yul before `0.5.0`. ## @nomicfoundation/slang-linux-arm64-gnu@0.15.0 ### Minor Changes - [#975](#975) [`46b1dde`](46b1dde) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename `QueryResult` to `QueryMatch`, and its `bindings` to `captures`. - [#971](#971) [`be943b7`](be943b7) Thanks [@Xanewok](https://github.com/Xanewok)! - Rename `RuleKind` to `NonterminalKind`, `TokenKind` to `TerminalKind`, and `NodeLabel` to `EdgeLabel`. - [#963](#963) [`a5593f9`](a5593f9) Thanks [@Xanewok](https://github.com/Xanewok)! - Introduce a `Diagnostic` API for compiler errors, warnings etc. ### Patch Changes - [#996](#996) [`cdc153d`](cdc153d) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add support for version `0.8.26`. - [#983](#983) [`ea31417`](ea31417) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Expose the language root non-terminal kind at `Language.rootKind()`. - [#965](#965) [`61b6b06`](61b6b06) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - refactor CST building and querying utilities into a separate `metaslang_cst` crate. - [#997](#997) [`84ad856`](84ad856) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - Support stack assignments in Yul before `0.5.0`. ## @nomicfoundation/slang-linux-arm64-musl@0.15.0 ### Minor Changes - [#975](#975) [`46b1dde`](46b1dde) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename `QueryResult` to `QueryMatch`, and its `bindings` to `captures`. - [#971](#971) [`be943b7`](be943b7) Thanks [@Xanewok](https://github.com/Xanewok)! - Rename `RuleKind` to `NonterminalKind`, `TokenKind` to `TerminalKind`, and `NodeLabel` to `EdgeLabel`. - [#963](#963) [`a5593f9`](a5593f9) Thanks [@Xanewok](https://github.com/Xanewok)! - Introduce a `Diagnostic` API for compiler errors, warnings etc. ### Patch Changes - [#996](#996) [`cdc153d`](cdc153d) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add support for version `0.8.26`. - [#983](#983) [`ea31417`](ea31417) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Expose the language root non-terminal kind at `Language.rootKind()`. - [#965](#965) [`61b6b06`](61b6b06) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - refactor CST building and querying utilities into a separate `metaslang_cst` crate. - [#997](#997) [`84ad856`](84ad856) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - Support stack assignments in Yul before `0.5.0`. ## @nomicfoundation/slang-linux-x64-gnu@0.15.0 ### Minor Changes - [#975](#975) [`46b1dde`](46b1dde) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename `QueryResult` to `QueryMatch`, and its `bindings` to `captures`. - [#971](#971) [`be943b7`](be943b7) Thanks [@Xanewok](https://github.com/Xanewok)! - Rename `RuleKind` to `NonterminalKind`, `TokenKind` to `TerminalKind`, and `NodeLabel` to `EdgeLabel`. - [#963](#963) [`a5593f9`](a5593f9) Thanks [@Xanewok](https://github.com/Xanewok)! - Introduce a `Diagnostic` API for compiler errors, warnings etc. ### Patch Changes - [#996](#996) [`cdc153d`](cdc153d) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add support for version `0.8.26`. - [#983](#983) [`ea31417`](ea31417) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Expose the language root non-terminal kind at `Language.rootKind()`. - [#965](#965) [`61b6b06`](61b6b06) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - refactor CST building and querying utilities into a separate `metaslang_cst` crate. - [#997](#997) [`84ad856`](84ad856) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - Support stack assignments in Yul before `0.5.0`. ## @nomicfoundation/slang-linux-x64-musl@0.15.0 ### Minor Changes - [#975](#975) [`46b1dde`](46b1dde) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename `QueryResult` to `QueryMatch`, and its `bindings` to `captures`. - [#971](#971) [`be943b7`](be943b7) Thanks [@Xanewok](https://github.com/Xanewok)! - Rename `RuleKind` to `NonterminalKind`, `TokenKind` to `TerminalKind`, and `NodeLabel` to `EdgeLabel`. - [#963](#963) [`a5593f9`](a5593f9) Thanks [@Xanewok](https://github.com/Xanewok)! - Introduce a `Diagnostic` API for compiler errors, warnings etc. ### Patch Changes - [#996](#996) [`cdc153d`](cdc153d) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add support for version `0.8.26`. - [#983](#983) [`ea31417`](ea31417) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Expose the language root non-terminal kind at `Language.rootKind()`. - [#965](#965) [`61b6b06`](61b6b06) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - refactor CST building and querying utilities into a separate `metaslang_cst` crate. - [#997](#997) [`84ad856`](84ad856) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - Support stack assignments in Yul before `0.5.0`. ## @nomicfoundation/slang-win32-arm64-msvc@0.15.0 ### Minor Changes - [#975](#975) [`46b1dde`](46b1dde) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename `QueryResult` to `QueryMatch`, and its `bindings` to `captures`. - [#971](#971) [`be943b7`](be943b7) Thanks [@Xanewok](https://github.com/Xanewok)! - Rename `RuleKind` to `NonterminalKind`, `TokenKind` to `TerminalKind`, and `NodeLabel` to `EdgeLabel`. - [#963](#963) [`a5593f9`](a5593f9) Thanks [@Xanewok](https://github.com/Xanewok)! - Introduce a `Diagnostic` API for compiler errors, warnings etc. ### Patch Changes - [#996](#996) [`cdc153d`](cdc153d) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add support for version `0.8.26`. - [#983](#983) [`ea31417`](ea31417) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Expose the language root non-terminal kind at `Language.rootKind()`. - [#965](#965) [`61b6b06`](61b6b06) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - refactor CST building and querying utilities into a separate `metaslang_cst` crate. - [#997](#997) [`84ad856`](84ad856) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - Support stack assignments in Yul before `0.5.0`. ## @nomicfoundation/slang-win32-ia32-msvc@0.15.0 ### Minor Changes - [#975](#975) [`46b1dde`](46b1dde) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename `QueryResult` to `QueryMatch`, and its `bindings` to `captures`. - [#971](#971) [`be943b7`](be943b7) Thanks [@Xanewok](https://github.com/Xanewok)! - Rename `RuleKind` to `NonterminalKind`, `TokenKind` to `TerminalKind`, and `NodeLabel` to `EdgeLabel`. - [#963](#963) [`a5593f9`](a5593f9) Thanks [@Xanewok](https://github.com/Xanewok)! - Introduce a `Diagnostic` API for compiler errors, warnings etc. ### Patch Changes - [#996](#996) [`cdc153d`](cdc153d) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add support for version `0.8.26`. - [#983](#983) [`ea31417`](ea31417) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Expose the language root non-terminal kind at `Language.rootKind()`. - [#965](#965) [`61b6b06`](61b6b06) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - refactor CST building and querying utilities into a separate `metaslang_cst` crate. - [#997](#997) [`84ad856`](84ad856) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - Support stack assignments in Yul before `0.5.0`. ## @nomicfoundation/slang-win32-x64-msvc@0.15.0 ### Minor Changes - [#975](#975) [`46b1dde`](46b1dde) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - rename `QueryResult` to `QueryMatch`, and its `bindings` to `captures`. - [#971](#971) [`be943b7`](be943b7) Thanks [@Xanewok](https://github.com/Xanewok)! - Rename `RuleKind` to `NonterminalKind`, `TokenKind` to `TerminalKind`, and `NodeLabel` to `EdgeLabel`. - [#963](#963) [`a5593f9`](a5593f9) Thanks [@Xanewok](https://github.com/Xanewok)! - Introduce a `Diagnostic` API for compiler errors, warnings etc. ### Patch Changes - [#996](#996) [`cdc153d`](cdc153d) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - add support for version `0.8.26`. - [#983](#983) [`ea31417`](ea31417) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Expose the language root non-terminal kind at `Language.rootKind()`. - [#965](#965) [`61b6b06`](61b6b06) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - refactor CST building and querying utilities into a separate `metaslang_cst` crate. - [#997](#997) [`84ad856`](84ad856) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - Support stack assignments in Yul before `0.5.0`. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Part of or might close #804
Rather than coming up with perfect API that ties everything together, let's start with the
Diagnostic
and iterate from there.