Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

always specify return-type of api-calls#5

Open
MaZderMind wants to merge 3 commits into
grandsilence:masterfrom
MaZderMind:compat/always-specify-explicit-return-type
Open

always specify return-type of api-calls#5
MaZderMind wants to merge 3 commits into
grandsilence:masterfrom
MaZderMind:compat/always-specify-explicit-return-type

Conversation

@MaZderMind

Copy link
Copy Markdown

currently, the response-type of the data-attribute of the response of an api-call has to be deduced by following the lambda to the parametrized request function and evaluating it return type. This confuses the JetBrains (ie. IntelliJ / WebStorm) language server and it can't deduce the return-type of an await or then-statement correctly. I'm not sure if the VSCode language server handles this better, but I would expect it to have similar problems.

By specifying the return-type explicitly, the language-servers can easily deduce the type of the response.

Peter Körner added 2 commits June 30, 2022 08:47
this enhances compatibility with language-servers, especially it allowa the JetBrains language server to correctly resolve the return-type
Comment thread templates/default/procedure-call.eta Outdated
}
default: {
return `Promise<HttpResponse<${type}, ${errorType}>`
return `Promise<HttpResponse<${type}, ${errorType}>>`

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no Idea how that worked in the past 😬

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant