-
Notifications
You must be signed in to change notification settings - Fork 9
Insert link #16
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
Insert link #16
Conversation
@lyz-code This feature uses an API extension proposed in PR #731 in nvim-orgmode. It does not break existing functionality, but as soon as a user creates a mapping and triggers it (or trys to run the Telescope extension with You can try it out on your machine by cloning my fork of nvim-orgmode. |
lua/telescope-orgmode/typehints.lua
Outdated
@@ -0,0 +1,61 @@ | |||
-- Type-hints copied from nvim-orgmode to simplify development |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why these need to be copied over?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LSP doesn't see types from a different lua module during development. Copying them into this file helped me a lot to see the types which got returned from the API functions.
Is there a way to tell the LSP where to look for them without copying them over?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using https://github.com/folke/neodev.nvim ?
If yes, you can have it load all the plugins in the LSP so you get the autocompletion like this:
require('neodev').setup({
override = function(_, options)
if not options.plugins then
options.plugins = true
end
return options
end,
})
This is happening anyway when you are loading your config, but when you develop in a plugin it needs to explicit. I use only this by default since I don't need other:
require('neodev').setup({
override = function(_, options)
if not options.plugins then
options.plugins = { 'nvim-treesitter', 'plenary.nvim' }
end
return options
end,
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. I stumbled upon this plugin a while ago but didn't take a deeper look. Will catch up on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I will keep the typehints here in the Telescope plugin. I actually installed the plugin but I'm probably to dumb and too impacient to configure it correctly for plugin development with nvim-orgmode.
Would you mind to provide a correct setup as a hint in the contributor section of the nvim-orgmode documentation?
@seflue the PR is merged, you can now refactor |
This feature provides a convenient way to create links to existing org-files and headlines via telescope. It leverages the already existing search for headlines. It relies on an extension of the API of nvim-orgmode, which exposes its existing feature to insert links. The Telescope feature acts as a drop-in-replacement to create/select the Link target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again! Can't wait to try it
This feature relies on a refactoring proposed in PR #15.
@lyz-code After that PR has been merged, I would rebase the current one, which consists actually only of one commit and only adds code.