Git Product home page Git Product logo

Comments (7)

cheptsov avatar cheptsov commented on July 30, 2024 1

"Foo!" may be confusing as such syntax is not used in any language...

from advancedexpressionfolding.

cypressious avatar cypressious commented on July 30, 2024

In Kotlin, Foo! means platform type, i.e. the compiler doesn't known whether it's nullable or not. Kotlin has the !! operator that asserts that a value is not null. Maybe it would be better to use its syntax.

from advancedexpressionfolding.

ddimtirov avatar ddimtirov commented on July 30, 2024

Perhaps use the double exclamation mark glyph (U+203C)?
It takes slightly less space than !!

https://en.wikipedia.org/wiki/!!

from advancedexpressionfolding.

petteyg avatar petteyg commented on July 30, 2024

I think it would be better to use what is "valid" code (at least in one language), and use a font like FiraCode if you want to collapse !! to .
I also think it would be better to not use any suffix at all on @NotNull, as normal rules assume any unannotated field is @NotNull by default. The only place where you might need to differentiate is a @NotNull method/parameter overriding a @Nullable method/parameter.
I also think folding @Nullable would be confusing given Foo? already has a well-defined meaning.

from advancedexpressionfolding.

cheptsov avatar cheptsov commented on July 30, 2024

Do you think it's worth to also highlight nullable with special foreground/background different from non-nullable?

from advancedexpressionfolding.

petteyg avatar petteyg commented on July 30, 2024

Highlighting might actually be nice. My first thought would be fold away @NonNull and apply the "bold underscored" effect, and "dotted line" effect for @Nullable. Not immediately sure what colors on those underline effects would be most appropriate though, given they might need to be different for Darcula and light color schemes.

If implemented, pulling the same annotations from "@NotNull/@Nullable problems" inspection would be nice.

from advancedexpressionfolding.

ciscorucinski avatar ciscorucinski commented on July 30, 2024

from advancedexpressionfolding.

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.