Skip to content

assertion failed: start.raw <= end.raw #303

Closed
@Cikmo

Description

@Cikmo

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

The language server crashes when entering an incomplete string at the end of the file.

Error message:

Encountered an unexpected error

This is a bug in Postgres Tools, not an error in your code, and we would appreciate it if you could report it along with the following information to help us fixing the issue:

Source Location: /home/runner/work/postgres-language-server/postgres-language-server/crates/pgt_text_size/src/range.rs:48:9
Thread Name: tokio-runtime-worker
Message: assertion failed: start.raw <= end.raw

It seems to be triggered by typing an unfinished string or identifier at the end of the file.

For example writing out:

CREATE TABLE "

will instantly cause this error, exiting the program.

To Reproduce

  1. Start the language server
  2. Begin typing a CREATE TABLE statement, and start a quoted identifier without closing it:
    CREATE TABLE "
    
  3. Crash should happen immediately

Expected behavior

There should be a linter warning/error notifying the user there is an invalid string, rather than the program panicking.

System information

Linux

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions