Add Rename Symbol Capability
What needs to be done in order to add the ability to rename symbols?
It shouldn't be that much work. But one would need to read up on the LSP protocol.
Yeah, that would be a great feature!
I'm willing to put up $100 (to you or a charity of the implementors choice) towards a bounty on this if anyone is interested.
Also willing to put down $1k from the Dokku Open Collective in addition to my personal $100 (redeemable in March, as that's when we'll have 1k) towards the bounty as well. I also welcome others to chip in further :)
My reason for putting so much is that Dokku itself uses a significant amount of bash and this sort of functionality was sorely missed by a refactoring I was doing last night...
@josegonzalez that is a really nice offer! Donating to charity would be a great incentive to fix this.
Let me know what you expect from this feature. Same file symbol renaming? Cross file renaming? The last part is a bit more tricky but could be doable.
I think same file seems like a reasonable first pass, especially for variables. Not sure how cross-file renaming might work, but would definitely be useful for Dokku since we typically source things from other files.
Honestly I'd love if this project was as good as the golang lsp in sublime text (with the hovercard and everything) as it would make lots of tooling in bash much easier to develop. Anything I can do to push in that direction is great.
Which features are you missing the most? Feel free to share a screenshot (I haven't used the LSP you mentioned). :)
Mind joining the gliderlabs slack? I can probably more easily send you screenshots and discuss there :) . My nick is savant.
A few notes on how the golang one shows:
For bash:
- The window box here doesn't always appear (seems mostly miss, not hit).
- Variable declaration doesn't include how the variable was declared, and doesn't work at all when hovering over the actual declaration. Would be cool to include what the variable type was declared as (Guessing based on the initial value declared and saying "unknown" if not specified would be fine imo).
- The function definition is not shown. Would be cool if we could perform reflection on the command and fetch any declared
descvariable, and maybe arguments as well. I think maybe usingdeclareto fetch properties and then maybe introspect if they are arguments ($1,$2,$@) might be neat as a standard. - References only ever shows references in opened files, not across the entire codebase.
- There is no
Format document. I realize this is somewhat subjective. Would be awesome if this project was written in golang as then you could useshfmtfor it's formatter, but thats probably implementable in this project as well.- Dokku uses
shfmtwith a few args, though honestly we'd be fine with removing those args and just using the project as is. We use it with:shfmt -bn -ci -i 2 -w ..-
-bn: Binary ops like && and | may start a line. -
-ci: Switch cases will be indented. -
-i 2: indent 2 -
-w: write the output
-
- Dokku uses
Thanks for this comprehensive list! We should probably split this up into a few different issues and evaluate what provides the most value.
For the rename symbol capability, then I hope to have a stab at this and figure out what needs to be done. 👍 Would be great to donate the ~$1K to charity!
References only ever shows references in opened files, not across the entire codebase.
By quickly looking at some Dokku repositories it seems that you are not using any file extensions for shell scripts. We currently preparse all files matching this glob.
We do not pre-parse files without any file extension (but we could do that!).
Context: https://github.com/bash-lsp/bash-language-server/issues/47#issuecomment-594370106
Just wanted to pop in and see if there's any progress happening on this. Thank everyone.
I was thinking the same thing @mike-lloyd03!
Has there been any progress on this? This project is so close to reaching its full potential :)
With rename and the new Shellcheck integration merged https://github.com/bash-lsp/bash-language-server/pull/342 bash-language-server will be feature complete and amazing! :)
Well, that's great news. Thanks everyone!
Would love to see this happening, also putting in 20-30$ into charity if that happens.
Charity would be great! I’m also wondering if we should enable GitHub sponsors to encourage more people to contribute.
The amount of code contributions is a bit lower for this project than my other OSS projects. Wondering if the combination of TypeScript tooling for a diverse crowd doing bash script is the reason.
Charity would be great! I’m also wondering if we should enable GitHub sponsors to encourage more people to contribute.
The amount of code contributions is a bit lower for this project than my other OSS projects. Wondering if the combination of TypeScript tooling for a diverse crowd doing bash script is the reason.
Maybe, not sure, I might guess that bash is more used in *nix envs where Go/Rust etc... is at play too. So its a different skill set, sadly than in the Web/Typescript world...
Released as 5.1.0 and vscode client 1.40.
Thanks you @mcecode