Skip to content
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

Multi-query files #126

Merged
merged 73 commits into from
Nov 19, 2022
Merged

Multi-query files #126

merged 73 commits into from
Nov 19, 2022

Conversation

kubukoz
Copy link
Owner

@kubukoz kubukoz commented Oct 16, 2022

This PR does waaaaaaay to many things to count, but I'll do my best:

Main features (multi-query files)

  • Add support for 0-n use clauses in a file (previously 0-1)
  • Add support for 0-n queries in a file (without passing results, as that's out of scope for now) - previously "exactly 1"
  • Remove limitation of having either a use clause or an operation-specific service reference (qualified operation name syntax) - the latter takes priority and is required when the service can't be uniquely determined from use clauses alone
  • Support completions for queries when the file parses (it didn't make sense before, as the file was limited to just one query anyway)
  • Rename code lens to "Run SmithyQL file"

Extra changes

  • Disallow running queries in the output panel
  • Rewrite some parts of the formatter, making formatting more consistent wrt handling structures vs lists (e.g. the indentation in lists has finally been fixed and looks reasonable)
  • Add tests for formatting of each significant piece of syntax, so that all formatting behavior is intentional or at least a known issue
  • Improve completions for union members
  • Improve completions for queries (a struct is auto-inserted and the cursor is placed inside)
  • Optimize LSP<->model conversions by reusing a location map
  • Improve parsing errors (e.g. "expected end of string", showing whitespace characters more visibly)
  • Tons of internal refactors and improvements for testing and future work.

TODOs (that I know of):

  • some end to end tests for the main functionality would be nice to have (even better if they work before this PR)
    • completions
    • diagnostics
    • lens provider
  • make compilation work on queries
  • a file can be run if it has exactly one query
  • a file can be run if it has more queries
  • zero queries
  • remove "conflicting service references". Prefer what's on the query.
  • Add run keyword #150
  • "run query" lens aware of multiple queries. I'm not sure how to do this best UX-wise tbh, possibly the lens should go to the first query in the file
  • fix completions
  • fix document symbols
  • fix formatting
  • fix resolution error ranges
  • validate use clauses for service existence
  • move service deprecation notes to the prelude
  • fix remaining deprecations/warnings
  • clear/issue TODOs added in this PR
  • Document language changes for multi-operation files #151

pending bugs:

  • failing queries (E.g. connection refused) still don't block subsequent queries from running

@kubukoz kubukoz marked this pull request as ready for review November 19, 2022 04:09
@kubukoz
Copy link
Owner Author

kubukoz commented Nov 19, 2022

lgtm xD

@kubukoz kubukoz changed the base branch from main to series/0.6 November 19, 2022 04:14
@kubukoz kubukoz merged commit 9f893fa into series/0.6 Nov 19, 2022
@kubukoz kubukoz deleted the multiple-queries branch November 19, 2022 04:14
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.

None yet

1 participant