Skip to content

Can we have actions to copy an expression's full value? #1474

@foxt451

Description

@foxt451

Problem Statement

I saw there is an action in the hover widget "Copy as expression", which copies the field's path (I'm talking about vtsls, but I guess it works the same everywhere), but it would be great to be able to copy the expression's value itself (especially when it's a very long string, which gets truncated with an ellipsis somewhere in the middle - both in repl and hover).

Possible Solutions

With repl I currently use sth like this

custom_commands = {
          ['.copy'] = function(text)
            local evaluated = repl.execute(text, {
              context = 'clipboard',
            })
            -- vim.fn.setreg(register, response.result)
          end,
        },

and with hover widget actions I guess it would be similar - just add an action that copies the expression with clipboard context

Considered Alternatives

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions