Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module with docstring doesn't allow in-module eval #2078

Closed
baggepinnen opened this issue Mar 27, 2021 · 3 comments · Fixed by julia-vscode/LanguageServer.jl#919
Closed

Module with docstring doesn't allow in-module eval #2078

baggepinnen opened this issue Mar 27, 2021 · 3 comments · Fixed by julia-vscode/LanguageServer.jl#919

Comments

@baggepinnen
Copy link

From slack:

Lately, vscode evaluates the whole module if I have my cursor on a line inside the module definition. Has it always been like that? It causes the module to be replaced and all code using it breaks and I have to restart.

I have configured my keymap and used the same for six months so I'm confident that when I pres ctrl-enter it should evaluate the current line/block. It appears as if a module is treated as a single block now

@pfitzseb
Copy link
Member

I can't repro this on 1.1.37. Can you share a screenshot/gif of what's going on?

@baggepinnen
Copy link
Author

baggepinnen commented Mar 27, 2021

If I place the cursor anywhere inside the module defined in https://github.com/baggepinnen/Robotlib.jl/blob/master/src/Frames.jl and hit execute code in repl it evaluates the whole module instead of the line/block the cursor is at.
If I try to simplify the example down to

module Mod
a = sin(1)
end

in a new file and evaluate the line a = sin(1) it does what I expect, only evaluates that particular line.

@pfitzseb
Copy link
Member

Seems like the docstring is the issue.

@pfitzseb pfitzseb changed the title Module body treated as block Module with docstring doesn't allow in-module eval Mar 27, 2021
@davidanthoff davidanthoff added this to the Backlog milestone May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants