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

No known way to have multiline expressions in dap repl #665

Open
alok opened this issue Aug 29, 2022 · 1 comment · May be fixed by #773
Open

No known way to have multiline expressions in dap repl #665

alok opened this issue Aug 29, 2022 · 1 comment · May be fixed by #773
Labels

Comments

@alok
Copy link

alok commented Aug 29, 2022

Debug adapter definition and debug configuration

No response

Debug adapter version

No response

Steps to Reproduce

Open DAP repl in python project

Expected Result

Was attempting to run this python code in the repl

 with tf.io.gfile.GFile(filename, 'rb+') as f:
            cctx = zstandard.ZstdDecompressor()
            reader_stream = io.BufferedReader(cctx.stream_reader(f))
            reader = jsonlines.Reader(reader_stream, loads=json_parser)
            for item in reader:
                result = dict()
                if isinstance(item, str):
                    result['text'] = item
                else:
                    text = item['text']
                    if isinstance(text, list):
                        text = self.para_joiner.join(text)
                        result['text'] = text
                yield result

Actual Result

After typing the first line, I can't find a way to insert further text without running line 1, which gives a syntax error.

@mfussenegger
Copy link
Owner

I think this is a limitation of the prompt buffer type in neovim.

As an alternative you could use the debug_selection functionality of nvim-dap-python to execute selected code.

@LiadOz LiadOz linked a pull request Dec 7, 2022 that will close this issue
mfussenegger added a commit that referenced this issue Jun 2, 2024
Creates a new window with a `dap-eval://` scratch buffer
Supports range mode to pre-fill it with the selected content.
Supports bang to immediately evaluate the content

This is a variant addressing #665
mfussenegger added a commit that referenced this issue Jun 2, 2024
Creates a new window with a `dap-eval://` scratch buffer
Supports range mode to pre-fill it with the selected content.
Supports bang to immediately evaluate the content

This is a variant addressing #665
mfussenegger added a commit that referenced this issue Jun 2, 2024
Creates a new window with a `dap-eval://` scratch buffer
Supports range mode to pre-fill it with the selected content.
Supports bang to immediately evaluate the content

This is a variant addressing #665
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants