Skip to content

How can I force curly braces for typescript enums in props autocompletion? #938

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

Open
aomini opened this issue Jan 9, 2025 · 0 comments
Open

Comments

@aomini
Copy link

aomini commented Jan 9, 2025

I know this is a weird question but I've an element component which I use a lot for my UI. And every time I accept autocomplete suggestion, it gives me =''. Example

enum Fonts{
  Regular: 'Okra-regular',
  Medium: 'Okra-Medium'
}

type Props = {
  size: number;
  fontFamily: Fonts // enum type
}         

export const Typography = ({size, fontFamily}: Props) => {...}

When I import the Typography component and autocomplete it's props, the editor auto resolves size={} // since it's a number but fontFamily resolves to fontFamily=''. So, I have to hit extra keystrokes to make it to fontFamily={}.

Therefore, is there any way that I can make the language server understand that I want to dynamically resolve fontFamily value and need a {} instead of a string completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant