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

Make prisma-fmt logs to work with language server #1193

Closed
pimeys opened this issue Jun 30, 2022 · 3 comments · Fixed by prisma/prisma-engines#4919
Closed

Make prisma-fmt logs to work with language server #1193

pimeys opened this issue Jun 30, 2022 · 3 comments · Fixed by prisma/prisma-engines#4919
Assignees
Labels
domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/improvement An improvement to existing feature and code. kind/tech A technical change.
Milestone

Comments

@pimeys
Copy link
Contributor

pimeys commented Jun 30, 2022

Would help the development a lot if the rust side would display logs for the TS engineer.

@pimeys pimeys added kind/improvement An improvement to existing feature and code. process/candidate Candidate for next Milestone. size/s Issue estimated to take days for one engineer domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/tech A technical change. labels Jun 30, 2022
@tomhoule
Copy link
Contributor

tomhoule commented Jul 1, 2022

There is a wasm-logger feature on prisma-fmt-wasm (link). I remember it causing problem but not the details, it may be worth looking into the commit history.

@jkomyno jkomyno added this to Formatting, Validation (`prisma-fmt` functionality) in 🌐 Language Tools Issue Categorization Jul 7, 2022
@tomhoule tomhoule removed the process/candidate Candidate for next Milestone. label Jul 20, 2022
@janpio janpio removed the size/s Issue estimated to take days for one engineer label Nov 2, 2022
@Druue
Copy link
Contributor

Druue commented Mar 20, 2023

I think this has been, at least partially, caught by #1396

@Druue
Copy link
Contributor

Druue commented Jun 12, 2024

I took a look through the commit history (all three of them 😅). I can't see any mention of any issues.

I also just noticed that we still have the following endpoint at the bottom of the lib file.

#[cfg(feature = "wasm_logger")]
#[wasm_bindgen]
pub fn enable_logs() {
    wasm_logger::init(wasm_logger::Config::default());
}

This feels somewhat clunky to me as that then requires language-tools (/ I guess any other consumer of this package) to first make a call to enable_logs. So if I want to test code actions I first have to update the codeActions in language-tools to also call this first? I'm not sure if that was the actual intent but it's marked as pub and wasm_bindgen so that's my assumption.

We have a call_once hook on the rest of the fmt-wasm api now so I think it makes more sense to remove this enable_logs function and just add the wasm_logger::init to this hook :) That way if it's already being built with the feature flag enabled, it's assumed that logs are wanted.

Druue added a commit to prisma/prisma-engines that referenced this issue Jun 12, 2024
@Jolg42 Jolg42 added this to the 5.16.0 milestone Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/improvement An improvement to existing feature and code. kind/tech A technical change.
Projects
Development

Successfully merging a pull request may close this issue.

5 participants