Skip to content

Commit

Permalink
fix(vscode): launch json for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
emil14 committed Feb 7, 2024
1 parent 7c15b57 commit 8254460
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 31 deletions.
92 changes: 64 additions & 28 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,108 +31,144 @@
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["do_nothing"]
"args": ["run", "0_do_nothing"]
},
{
"name": "Interpreter: echo",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["echo"]
"args": ["run", "1_echo"]
},
{
"name": "Interpreter: hello_world/verbose",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["hello_world/verbose"]
"args": ["run", "2_hello_world/0_verbose"]
},
{
"name": "Interpreter: hello_world/with_const_sender",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["hello_world/with_const_sender"]
"args": ["run", "2_hello_world/1_with_const_sender"]
},
{
"name": "Interpreter: hello_world/with_then_connection",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["hello_world/with_then_connection"]
"args": ["run", "2_hello_world/2_with_then_connection"]
},
{
"name": "Interpreter: add_numbers/naive",
"name": "Interpreter: hello_world/with_then_connection",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["add_numbers/naive"]
"args": ["run", "2_hello_world/3_with_literal_senders"]
},
{
"name": "Interpreter: interfaces",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["run", "3_interfaces"]
},
{
"name": "Interpreter: add_numbers/naive",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["run", "4_add_numbers/verbose"]
},
{
"name": "Interpreter: add_numbers/naive",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["interfaces"]
"args": ["run", "4_add_numbers/with_bridge"]
},
{
"name": "Interpreter: struct_fields/verbose",
"name": "Interpreter: 5_add_real_numbers/naive",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["struct_fields/verbose"]
"args": ["run", "5_add_real_numbers/naive"]
},
{
"name": "Interpreter: struct_fields/with_selectors",
"name": "Interpreter: 5_add_real_numbers/with_err_handling",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["struct_fields/with_selectors"]
"args": ["run", "5_add_real_numbers/with_err_handling"]
},
{
"name": "Interpreter: map_keys",
"name": "Interpreter: 5_add_real_numbers/with_sub_components",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["map_keys"]
"args": ["run", "5_add_real_numbers/with_sub_components"]
},
{
"name": "Interpreter: struct_builder/verbose",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["struct_builder/verbose"]
"args": ["run", "6_struct_builder/verbose"]
},
{
"name": "Interpreter: struct_builder/with_sugar",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["run", "6_struct_builder/with_sugar"]
},
{
"name": "Interpreter: struct_selectors/verbose",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["run", "7_struct_selectors/verbose"]
},
{
"name": "Interpreter: struct_selectors/with_sugar",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}/examples",
"args": ["struct_builder/with_sugar"]
"args": ["run", "7_struct_selectors/with_sugar"]
},
// === Other ===
{
Expand Down
6 changes: 3 additions & 3 deletions internal/compiler/analyzer/component_nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ func (a Analyzer) analyzeComponentNode(node src.Node, scope src.Scope) (src.Node
}
}

runtimeMsgArgs, hasRuntimeMsg := node.Directives[compiler.BindDirective]
if hasRuntimeMsg && len(runtimeMsgArgs) != 1 {
bindDirectiveArgs, usesBindDirective := node.Directives[compiler.BindDirective]
if usesBindDirective && len(bindDirectiveArgs) != 1 {
return src.Node{}, src.Interface{}, &compiler.Error{
Err: ErrBindDirectiveArgs,
Location: &location,
Meta: entity.Meta(),
}
}

iface, aerr := a.getResolvedNodeInterface(entity, hasRuntimeMsg, location, node, scope)
iface, aerr := a.getResolvedNodeInterface(entity, usesBindDirective, location, node, scope)
if aerr != nil {
return src.Node{}, src.Interface{}, aerr
}
Expand Down

0 comments on commit 8254460

Please sign in to comment.