Skip to content

Commit

Permalink
merge: #2841
Browse files Browse the repository at this point in the history
2841: feat: change interfaces to types for quickinfo r=sprutton1 a=sprutton1

Same as described [here](microsoft/TypeScript#38040), the Typescript system does not extract deep information from `interface`s, so if we want the details on the hover/hotkey, we need them to be `type`s.

I have no idea what implications this might have elsewhere, so insight there would be good. Everything seems good in my tests still.

Co-authored-by: Scott Prutton <sprutton1@gmail.com>
  • Loading branch information
si-bors-ng[bot] and sprutton1 authored Oct 10, 2023
2 parents 69427f4 + 3a97aae commit 12187cb
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/sdf-server/src/server/service/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,32 +590,32 @@ pub fn compile_return_types(ty: FuncBackendResponseType, kind: FuncBackendKind)
FuncBackendResponseType::String => "type Output = string | null;",
FuncBackendResponseType::Integer => "type Output = number | null;",
FuncBackendResponseType::Qualification => {
"interface Output {
"type Output {
result: 'success' | 'warning' | 'failure';
message?: string | null;
}"
}
FuncBackendResponseType::CodeGeneration => {
"interface Output {
"type Output {
format: string;
code: string;
}"
}
FuncBackendResponseType::Validation => {
"interface Output {
"type Output {
valid: boolean;
message: string;
}"
}
FuncBackendResponseType::Reconciliation => {
"interface Output {
"type Output {
updates: { [key: string]: unknown };
actions: string[];
message: string | null;
}"
}
FuncBackendResponseType::Action => {
"interface Output {
"type Output {
status: 'ok' | 'warning' | 'error';
payload?: { [key: string]: unknown } | null;
message?: string | null;
Expand Down Expand Up @@ -651,32 +651,32 @@ pub fn compile_return_types_2(ty: FuncBackendResponseType, kind: FuncBackendKind
FuncBackendResponseType::String => "type Output = string | null;",
FuncBackendResponseType::Integer => "type Output = number | null;",
FuncBackendResponseType::Qualification => {
"interface Output {
"type Output {
result: 'success' | 'warning' | 'failure';
message?: string | null;
}"
}
FuncBackendResponseType::CodeGeneration => {
"interface Output {
"type Output {
format: string;
code: string;
}"
}
FuncBackendResponseType::Validation => {
"interface Output {
"type Output {
valid: boolean;
message: string;
}"
}
FuncBackendResponseType::Reconciliation => {
"interface Output {
"type Output {
updates: { [key: string]: unknown };
actions: string[];
message: string | null;
}"
}
FuncBackendResponseType::Action => {
"interface Output {
"type Output {
status: 'ok' | 'warning' | 'error';
payload?: { [key: string]: unknown } | null;
message?: string | null;
Expand Down Expand Up @@ -851,7 +851,7 @@ async fn compile_action_types(
}

Ok(format!(
"interface Input {{
"type Input {{
kind: 'standard';
properties: {};
}}",
Expand Down

0 comments on commit 12187cb

Please sign in to comment.