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

Unescaped 'type' keyword in package (directory) name #288

Closed
Dr-Nikson opened this issue Jun 7, 2020 · 6 comments · Fixed by #305
Closed

Unescaped 'type' keyword in package (directory) name #288

Dr-Nikson opened this issue Jun 7, 2020 · 6 comments · Fixed by #305
Labels
bug Something isn't working

Comments

@Dr-Nikson
Copy link

Dr-Nikson commented Jun 7, 2020

Hello! I tried to generate scala files with latest mu-scalaand I've faced this error:

Failed to parse package name: <input>:1: error: identifier expected but type found
google.logging.type
               ^

This error raises when it tries to process this file - google/logging/type/http_request.proto. Package name (directory) contains type keyword so we are not able to properly parse it here:

val packageName = protocol.pkg // "google.logging.type"
      .getOrElse("proto")
      .parse[Term]
      .toEither
      .leftMap(e => s"Failed to parse package name: $e")
      .flatMap(_.as[Term.Ref])

As far as these protos comes with kinda "standard" google library (https://github.com/googleapis/api-common-protos) skeuomorph have to process it properly

@juanpedromoreno juanpedromoreno added the bug Something isn't working label Jun 7, 2020
@Dr-Nikson Dr-Nikson changed the title Unescape 'type' keyword in package (directory) name Unescaped 'type' keyword in package (directory) name Jun 7, 2020
@Dr-Nikson
Copy link
Author

@juanpedromoreno Is there anything I could help with?
It seems like skeuomorph already has some "escaping" stuff, maybe if you can point me where to start I can fix&PR it by myself

@juanpedromoreno
Copy link
Member

Hi @Dr-Nikson , thanks for reporting this bug, I triaged it but completely forgot to reply/address the issue.

I've just submitted #305

juanpedromoreno added a commit that referenced this issue Jul 3, 2020
@Dr-Nikson
Copy link
Author

Dr-Nikson commented Jul 3, 2020

@juanpedromoreno so, thank you :) You're doing a really good job with this lib 👍🏼

As I can see mu-scala was released today, but sbt-mu-srcgen wasn't. Can I ask you to bump dependencies to ship this release to production? Or I can make a PR by myself if it's make sense somehow

@juanpedromoreno
Copy link
Member

Yeah, the mu-scala artifacts were just released, and they should go on its way to maven central. As soon as they are ready, @ scala-steward (or any of us) can submit to PR updating the libraries.

@juanpedromoreno
Copy link
Member

@Dr-Nikson
Copy link
Author

@juanpedromoreno thank you so much for this!)

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

Successfully merging a pull request may close this issue.

2 participants