Visual studio code extensions
Answered
Noronha posted this in #help-forum
NoronhaOP
In visual studio code I have this function for example:
And when I try to call it like:
When i press control + space bar it doesnt show me the params. Why?
Using next14, typescript, ESLint, Prettier extention, Tailwind CSS IntelliSense.
Oh, any other critical extension I'm missing? 🙂
export async function list(
page: number,
query?: string,
sort?: Sort,
): Promise<FormResponse<PaginatedResponse<FuelType>>> {And when I try to call it like:
const fuels = await list();When i press control + space bar it doesnt show me the params. Why?
Using next14, typescript, ESLint, Prettier extention, Tailwind CSS IntelliSense.
Oh, any other critical extension I'm missing? 🙂
Answered by Ray
I think it should show if you turn it to object
export async function list({
page: number,
query?: string,
sort?: Sort,
}):6 Replies
@Noronha In visual studio code I have this function for example:
JSX
export async function list(
page: number,
query?: string,
sort?: Sort,
): Promise<FormResponse<PaginatedResponse<FuelType>>> {
And when I try to call it like:
JSX
const fuels = await list();
When i press control + space bar it doesnt show me the params. Why?
Using next14, typescript, ESLint, Prettier extention, Tailwind CSS IntelliSense.
Oh, any other critical extension I'm missing? 🙂
I think it should show if you turn it to object
export async function list({
page: number,
query?: string,
sort?: Sort,
}):Answer
NoronhaOP
Is that a good practice? If it is I'll change. Otherwise I need stronger arguments for changing the param list to an object. I think its fishy changing the structure just to get the IDE working properly. Is what I'm saying making any sense?
NoronhaOP
so from now on all of my functions (or most of them) should receive one typed object as param and extract the values from it?
It's interesting because this bypasses the "order" you need to pass params around.
It's interesting because this bypasses the "order" you need to pass params around.
Plus, you're right, autocomplete works
@Noronha so from now on all of my functions (or most of them) should receive one typed object as param and extract the values from it?
It's interesting because this bypasses the "order" you need to pass params around.
yep, so you don't need to do something like this
list(1, undefined, 'desc')