Skip to content

Commit

Permalink
bump and workaround julia-vscode/julia-vscode#2441
Browse files Browse the repository at this point in the history
  • Loading branch information
thautwarm committed Jan 10, 2023
1 parent b16373e commit 580c3f7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ObjectOriented"
uuid = "5736bd91-ca84-4f49-a8c7-a30743b4409d"
authors = ["thautwarm <[email protected]>"]
version = "0.1.2"
version = "0.1.3"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,27 @@ end
some_func(MyType(1, 2)) # 3
some_func(MyDerivedType(1, 2, 3)) # 3
```

## Troubleshooting

1. [The integrated debugger implemented in Julia-VSCode cannot handle `@generated` functions](https://github.com/julia-vscode/julia-vscode/issues/2441), which causes a bug when entering `@mk` expressions. A workaround can be made as follows:

```julia
@oodef mutable struct YourClass
x::Int
y::Int
function new(x, y)
# you can debug here
self = @mk begin
# you can debug here
x = x
# you can debug here
y = y
# do not reach here!
# please jump over the end of '@mk' expression!
end
# you can debug here
return self
end
end
```
1 change: 1 addition & 0 deletions src/compile-time.reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ end

function parse_function(ln :: LineNumberNode, ex; fallback :: T = _undefined, allow_short_func :: Bool = false, allow_lambda :: Bool = false) where T
self :: FuncInfo = FuncInfo()
self.ln = ln
@switch ex begin
@case Expr(:function, header, body)
self.body = body
Expand Down

2 comments on commit 580c3f7

@thautwarm
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/75427

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.3 -m "<description of version>" 580c3f75051a139be4cc1af184f58ac171e17461
git push origin v0.1.3

Please sign in to comment.