You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just discovered the plugin and getting up to speed. I've seen that with some languages, the plugin is smart enough to comment out an argument in a function call:
-- from thisvim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
-- to thisvim.keymap.set('n',--[[ '<space>e' ]], vim.diagnostic.open_float, opts)
In Python, however, the plugin doesn't return a valid syntax if we comment out an argument.
# from thisdefmy_function(a, b):
returnb# to thisdefmy_function( #a, b):returnb
I would have expected it to return something like this...
defmy_function(b): #a):returnb
I'm assuming this is because Python doesn't have inline comments, but I was wondering if there was a way to achieve something similar to what I described. It would be particularly useful when refactoring code.
Yes, this is expected because python doesn't have block commentstring. And I am not sure, how is this achievable? Maybe using treesitter? But that being said, this is certainly out of scope for the plugin to support this OOTB.
I thought this could have been possible by leveraging treesitter. I'm not super familiar with what treesitter exposes and how comment.nvim interfaces with it. Perhaps I can look into that and resume the discussion later on. Thank you for now!
Repository owner locked and limited conversation to collaborators on Sep 8, 2022
Activity
numToStr commentedon Sep 8, 2022
Yes, this is expected because python doesn't have block commentstring. And I am not sure, how is this achievable? Maybe using treesitter? But that being said, this is certainly out of scope for the plugin to support this OOTB.
IamGianluca commentedon Sep 8, 2022
I thought this could have been possible by leveraging treesitter. I'm not super familiar with what treesitter exposes and how comment.nvim interfaces with it. Perhaps I can look into that and resume the discussion later on. Thank you for now!