Code Monkey home page Code Monkey logo

Comments (4)

ya-goodfella avatar ya-goodfella commented on June 22, 2024

Motivation: allow Scala annotations to be added after type ascription of a message field.

For example, it's impossible to append @nowarn to a deprecated class. We should be able to do this:

message M {
    DeprecatedType the_field = 1 [(scalapb.field).type_annotations = "@nowarn"];
}

to generate

case class M(theField: DeprecatedType @nowarn)

First of all, you must use the canonical name for the annotation:

message M {
    DeprecatedType the_field = 1 [(scalapb.field).annotations = "@scala.annotation.nowarn"];
}

secondly, in case of use of deprecated type (scalapb.field).annotations should work fine.

Can you try to reproduce it with canonical annotation name?

from scalapb.

thesamet avatar thesamet commented on June 22, 2024

@enzief , see https://scalapb.github.io/docs/customizations#adding-annotations for documentation on (scalapb.field).annotations. It prepends the annotation though so I am not sure if it makes a difference in this case. Another suggestion which may eliminate the need for this in your use case is to compile protos in a seperate subproject for which you ignore its warnings.

from scalapb.

thesamet avatar thesamet commented on June 22, 2024

Hi @enzief , were you able to check if the suggestions above work for your use case?

from scalapb.

enzief avatar enzief commented on June 22, 2024

They work. Thank you @thesamet .

from scalapb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.