Skip to content

Commit

Permalink
feat: show "print" code lens for some nullable types
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Oct 31, 2024
1 parent 2930357 commit 50f659e
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,14 @@ export class SafeDsTypeChecker {
canBePrinted = (type: Type): boolean => {
return (
!type.equals(this.coreTypes.Nothing) &&
!type.equals(this.coreTypes.NothingOrNull) &&
[
this.coreTypes.Boolean,
this.coreTypes.Float,
this.coreTypes.Int,
this.coreTypes.List(UnknownType),
this.coreTypes.Map(UnknownType, UnknownType),
this.coreTypes.String,
].some((it) => this.isSubtypeOf(type, it, { ignoreTypeParameters: true }))
].some((it) => this.isSubtypeOf(type.withExplicitNullability(false), it, { ignoreTypeParameters: true }))
);
};

Expand Down

0 comments on commit 50f659e

Please sign in to comment.