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

feat(fmt): completions <> DataSource property schemas #3541

Closed
wants to merge 3 commits into from

Conversation

Druue
Copy link
Contributor

@Druue Druue commented Dec 23, 2022

Co-authored-by: Tom Houlé <13155277+tomhoule@users.noreply.github.com>
@Druue Druue requested a review from a team as a code owner December 23, 2022 14:02
@Druue Druue added this to the 4.9.0 milestone Dec 23, 2022
@Druue Druue changed the title Added: DataSource property schemas completion feat(fmt): completions <> DataSource property schemas Jan 3, 2023
@Jolg42
Copy link
Member

Jolg42 commented Jan 9, 2023

@Druue How can anyone try this PR?
In language-tools repo, we can use the Gitpod link using the built version of the extension.
But here it's not obvious how, is there something in a README maybe?

@Druue
Copy link
Contributor Author

Druue commented Jan 9, 2023

@Druue How can anyone try this PR? In language-tools repo, we can use the Gitpod link using the built version of the extension. But here it's not obvious how, is there something in a README maybe?

This hasn't been merged into engines main yet, but you can read more here @Jolg42

@Druue Druue requested review from Jolg42 and pimeys January 9, 2023 13:13
@Jolg42
Copy link
Member

Jolg42 commented Jan 10, 2023

It seems I'm stuck and cannot review this, maybe someone else can, @pimeys ?
Posted in Slack

any idea what to do here?

I ran the script which runs cargo build --release --target=wasm32-unknown-unknown --manifest-path=./prisma-fmt-wasm/Cargo.toml
And I get a lot of errors like:

....
error[E0425]: cannot find function, tuple struct or tuple variant `Ok` in this scope
   --> /Users/j42/.cargo/registry/src/github.com-1ecc6299db9ec823/ucd-trie-0.1.5/src/owned.rs:265:5
    |
265 |     Ok((root, children))
    |     ^^ not found in this scope
Some errors have detailed explanations: E0405, E0412, E0425, E0433, E0463, E0531.
For more information about an error, try `rustc --explain E0405`.
error: could not compile `hashbrown` due to 887 previous errors
^C  Building [========>                 ] 41/114: ucd-trie, num-traits    

Copy link
Member

@Jolg42 Jolg42 left a comment

Choose a reason for hiding this comment

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

Currently, there is no completion if the cursor is at the start of a line, I think there was an issue about this?
Screenshot 2023-01-10 at 11 01 28

See suggestions before merging

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
<|>
Copy link
Member

Choose a reason for hiding this comment

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

Since we have a bug with no completion showing up at the beginning of a line, it would make sense to duplicate this test and also test the beginning of the line?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@Jolg42 Jolg42 left a comment

Choose a reason for hiding this comment

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

We need to figure out how to merge completions prisma/language-tools#1347 first before we can merge this

Or move all the datasource completions to Rust
Or alternatively redo this in the TS codebase

Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com>
Copy link
Member

@Jolg42 Jolg42 left a comment

Choose a reason for hiding this comment

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

I think we should fix prisma/prisma#17000

@janpio
Copy link
Member

janpio commented Jan 10, 2023

I think we should fix prisma/prisma#17000

Isn't that an existing, higher level problem though @Jolg42 that should not really block adding this completion?

@Jolg42
Copy link
Member

Jolg42 commented Jan 10, 2023

@janpio We decided with @Druue to

@Druue Druue mentioned this pull request Feb 10, 2023
29 tasks
@Druue Druue closed this Apr 6, 2023
@Druue Druue deleted the feat/ac-ds-schemas branch April 6, 2023 11:58
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.

Completions: for schemas property in datasource
3 participants