Giter Site home page Giter Site logo

Comments (9)

davidgranstrom avatar davidgranstrom commented on July 20, 2024 1

@daveriedstra Thanks for the report. I can reproduce the behaviour you are describing (no signature shown while triggering the mapping in insert mode), I'll take a look.

@salkin-mada The float window opens automatically for me when typing the opening paren, perhaps there is some sort of conflict with another plugin and or mapping that causes the issue you are describing?

In case someone stumbles upon this issue in the future while searching, I would just like to share this specific configuration option that changes the "close" behaviour of the signature pop-up.

You will find all possible configuration options in this help file: :h vim.lsp.util.open_floating_preview()

local scnvim = require('scnvim')
scnvim.setup {
  editor = {
    signature = {
      config = {
        -- Keep the signature visible until exiting insert mode, or if cursor moves in normal mode
        close_events = {'InsertLeave', 'CursorMoved'},
      },
    },
  }
}

from scnvim.

davidgranstrom avatar davidgranstrom commented on July 20, 2024 1

Currently there is no such function, but it should be possible to save the winid returned by this function call and implement a signature.close() function to close the window with said winid. By setting the close_events option to an empty table would mean that you would have to manually close the window so I think it would be a good addition. PR is welcome :)

from scnvim.

daveriedstra avatar daveriedstra commented on July 20, 2024 1

So in my config I was not setting the editor = { signature = { config = { } } }

I've made that mistake before too, with scnvim and other plugins. Easy to get lost in levels of nesting.

But I am wondering why is the default of signature/config/close_events not InsertLeave and CursorMoved?

I'm also curious, I find the default behaviour unintuitive. The signature hint disappears right when I need it. My guess is that it's because there's no event to hook into for reaching the end of the argument list in insert mode, and without one, the hint remains for any time spent in insert mode after the user finishes writing the argument list.

Is there a link to lsp.util float preview in the docs or?

I don't think so. FWIW and for future visitors, the config object is passed directly to open_floating_preview, and the possible close_events are the same as autocmd events (see :h autocmd-events)

from scnvim.

salkin-mada avatar salkin-mada commented on July 20, 2024

#241

from scnvim.

salkin-mada avatar salkin-mada commented on July 20, 2024

For me signature hints only pop up with <C-k> and disappears as soon as I start to type. It does not show after SomeUgen.kr(|.

['<C-k>'] = map('signature.show', {'n', 'i'}, {desc ="signature show"}),

from scnvim.

daveriedstra avatar daveriedstra commented on July 20, 2024

@davidgranstrom thanks for the config example, that's very helpful and probably what I'll end up using with some tweaks. Is there a way to manually close the signature window? I haven't been able to find a scnvim.signature.close and haven't been successful with User autocmd events.

from scnvim.

daveriedstra avatar daveriedstra commented on July 20, 2024

Thanks for the push to write this little PR, @davidgranstrom!

I noticed in another issue that some features relating to syntax could be rewritten to integrate upcoming supercollider LSP. Is that also the case here? Maybe it's worth waiting for that?

from scnvim.

salkin-mada avatar salkin-mada commented on July 20, 2024

@salkin-mada The float window opens automatically for me when typing the opening paren, perhaps there is some sort of conflict with another plugin and or mapping that causes the issue you are describing?

Thanks <3 soo nice to have it sticking until I leave insertmode.

Håhåhå you wont believe it, I dont. So in my config I was not setting the editor = { signature = { config = { } } }
Just adding the signature part after hightlight in the editor table and restarting scnvim. Now the signature hint starts on SinOsc.ar(|.. weird.

Nevermind.. too esoteric. But I am wondering why is the default of signature/config/close_events not InsertLeave and CursorMoved?

from scnvim.

salkin-mada avatar salkin-mada commented on July 20, 2024

You will find all possible configuration options in this help file: :h vim.lsp.util.open_floating_preview()

I have not been able to find this because I have been searching the scnvim help docs. Did I miss it? Is there a link to lsp.util float preview in the docs or?

from scnvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.