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

Bug: Format Query action removes commented queries #436

Open
2 tasks done
teddy-otieno opened this issue Sep 15, 2024 · 1 comment
Open
2 tasks done

Bug: Format Query action removes commented queries #436

teddy-otieno opened this issue Sep 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@teddy-otieno
Copy link

Describe the bug

Format Query action removes commented queries
Before
image

After
image

Steps to reproduce

Steps

  1. Write two queries
  2. Comment out the first query
  3. Format the query

Expected behaviour

I expect the comments to be preserved

Surrealist Environment

Version: 3.0.0-beta.2
Flags: feature_flags: false, query_view: true, explorer_view: true, graphql_view: true, designer_view: true, auth_view: true, functions_view: true, models_view: true, apidocs_view: true, cloud_view: true, themes: true, newsfeed: true, database_version_check: false, highlight_tool: false, legacy_serve: false, cloud_endpoints: production, cloud_access: false, cloud_killswitch: true, changelog: hidden

Contact Details

tedd.juma@outlook.com

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@teddy-otieno teddy-otieno added bug Something isn't working triage This issue is new labels Sep 15, 2024
@macjuul macjuul removed the triage This issue is new label Sep 17, 2024
@macjuul
Copy link
Contributor

macjuul commented Sep 17, 2024

This is currently expected behaviour since we use the internal SurrealDB parser for formatting queries which strips out any encountered comments. We are planning on expanding editor functionality with a custom language server and eventually create a formatter which doesn't strip comments.

For now, a workaround is to select only the part of the editor that you want to format, as formatting will be limited to an active selection when present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants