Comments (9)
@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.
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.
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.
from scnvim.
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.
@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.
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 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.
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)
- [FR]: More documentation on how to use it: describe how you can run code HOT 5
- [FR]: Implement Arrays in SCNvimJSON:stringify HOT 3
- [BUG] Error executing vim.schedule lua callback: […] Unrecognized handler HOT 2
- [BUG] Toggle post window leaves empty buffers HOT 6
- [BUG] scnvim foobar HOT 5
- [BUG] Syntax highlighting is not consistent with multiline strings HOT 2
- [BUG] s.meter only works after recompiling class library HOT 3
- [BUG] Editor commands do not work HOT 2
- [BUG] Error using pandoc on Linux HOT 1
- [BUG] Reloading a session with scnvim using Startify causes errors HOT 1
- [BUG] need help with tags file on wsl HOT 6
- [BUG] SCNvim crashes out of Neovim from too fast input. HOT 15
- [BUG] HOT 1
- [BUG] Return cached results from help.get_docmap
- [BUG] ERROR: Class not defined, ERROR: Could not iterate on directory, HOT 2
- [BUG] UGen Arguments not visible HOT 2
- [FR]: Send commands to remote sclang HOT 2
- [BUG] error message when typing (Done.freeSelf, \gate.kr(1)) in a SynthDef HOT 2
- [BUG] checkhealth lua functions deprecated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scnvim.