Skip to content

Add Rename Symbol Capability #915

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

Merged
merged 58 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
470f8cf
Add rename handlers
mcecode Jul 17, 2023
47ad106
Implement onPrepareRename
mcecode Jul 18, 2023
a18090c
Improve and refactor onPrepareRename checks
mcecode Jul 20, 2023
e79d598
Implement onRenameRequest checks
mcecode Jul 20, 2023
bd69d87
Implement renaming not defined variables
mcecode Jul 20, 2023
b2e2256
Implement local variable rename naively for single-level functions
mcecode Jul 21, 2023
894a724
Skip renaming shadowed local variables in nested functions
mcecode Jul 24, 2023
bf9a422
Make findParentFunction find functions defined with function keyword
mcecode Jul 24, 2023
63e5360
Extract nodeAtPoints from findOccurrencesWithin
mcecode Jul 24, 2023
e4b73e1
Allow renaming local variables within nested functions
mcecode Jul 24, 2023
5829d95
Rename only variables inside functions
mcecode Jul 25, 2023
bbe6a45
Handle renaming variables and functions inside subshells
mcecode Jul 26, 2023
316b609
Skip renaming shadowed variables and functions in nested subshells
mcecode Jul 26, 2023
d68ad68
Only rename functions inside subshells
mcecode Jul 27, 2023
ae97012
Implement findOriginalDeclaration initially and use
mcecode Jul 31, 2023
caa704a
Recurse through nodes serially in findOriginalDeclaration
mcecode Jul 31, 2023
6f11cac
Handle function defintions in findOriginalDeclaration
mcecode Aug 1, 2023
5e114ee
Improve findOriginalDeclaration heuristics
mcecode Aug 1, 2023
3fbea1e
Replace serialForEach with breadthForEach
mcecode Aug 3, 2023
91dd91d
Initial reimplementation of findOccurrencesWithin
mcecode Aug 7, 2023
d365b90
Improve findOccurrencesWithin scope awareness
mcecode Aug 8, 2023
87eba86
Clean method interfaces, refactor, and add comments
mcecode Aug 8, 2023
0d37f68
Handle var="$var" cases in findOccurrencesWithin
mcecode Aug 11, 2023
8a0ca5c
Remove breadthForEach and just use forEach
mcecode Aug 11, 2023
64b9c1e
Handle var="$var" cases in findOriginalDeclaration
mcecode Aug 11, 2023
33012ab
Handle functions in findOccurrencesWithin
mcecode Aug 14, 2023
611a962
Improve scope awareness when renaming not defined symbols
mcecode Aug 14, 2023
e91761d
Fix findOriginalDeclaration for for statements
mcecode Aug 15, 2023
2bde696
Remove checks against renaming builtins and executables
mcecode Aug 17, 2023
63f7286
Improve findParentScopeNode implementation
mcecode Aug 17, 2023
3a17ca6
Improve findOriginalDeclaration signature and refactor
mcecode Aug 18, 2023
ac48675
Refactor names and checks
mcecode Aug 18, 2023
e44ce78
Change signatures to use SymbolKind rather than custom type
mcecode Aug 21, 2023
4fb3080
Initial implementation of global rename
mcecode Aug 21, 2023
6dea0b5
Rename within workspace
mcecode Aug 22, 2023
9abde3c
Improve search for connected URIs
mcecode Sep 1, 2023
b6a95e4
Change global rename logic and refactor
mcecode Sep 1, 2023
2ba4128
Improve workspace-wide rename and refactor
mcecode Sep 4, 2023
c61370c
Improve renaming of multiline self-assignments and refactor
mcecode Sep 5, 2023
558a01b
Improve findOriginalDeclaration heuristics
mcecode Sep 7, 2023
d94155f
Improve findOriginalDeclaration heuristics
mcecode Sep 12, 2023
187971a
Improve findOriginalDeclaration heuristics
mcecode Sep 14, 2023
ac11e2c
Improve findOriginalDeclaration heuristics
mcecode Sep 19, 2023
49b97ab
Change global rename logic
mcecode Sep 20, 2023
fd9a01c
Improve renaming when includeAllWorkspaceSymbols is true
mcecode Sep 20, 2023
a96d50c
Improve findOccurrencesWithin heuristics
mcecode Sep 25, 2023
5ba6b4c
Fix failing test and add expects for rename handlers registration
mcecode Sep 26, 2023
4f7bf1e
Add onPrepareRename tests and remove unneeded check
mcecode Sep 27, 2023
bbab0c4
Revert removing check and update onPrepareRename tests
mcecode Sep 28, 2023
676b571
Add initial onRenameRequest test cases
mcecode Sep 28, 2023
638c19a
Add more onRenameRequest tests and cases
mcecode Sep 29, 2023
ad379eb
Add more onRenameRequest tests
mcecode Oct 3, 2023
5c13080
Fix bugs, finish rename symbol tests, and update snapshots
mcecode Oct 17, 2023
0977049
Refactor and fix comments
mcecode Oct 19, 2023
9a1b79c
Update docs
mcecode Oct 19, 2023
612f4ab
Add while read test and update test name
mcecode Oct 20, 2023
565d911
Merge branch 'main' into rename-symbol
skovhus Dec 27, 2023
29b1676
Prepare for releasing 5.1.0
skovhus Dec 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Documentation around configuration variables can be found in the [config.ts](htt
- Simple diagnostics reporting
- Documentation for symbols on hover
- Workspace symbols
- Rename symbol

To be implemented:

- Rename symbol
- Better jump to declaration and find references based on scope

## Installation
Expand Down
4 changes: 4 additions & 0 deletions server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Bash Language Server

## 5.1.0

- Support for renaming symbol! https://github.com/bash-lsp/bash-language-server/pull/915

## 5.0.0

- Downgrade tree sitter to a stable version https://github.com/bash-lsp/bash-language-server/pull/911
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A language server for Bash",
"author": "Mads Hartmann",
"license": "MIT",
"version": "5.0.0",
"version": "5.1.0",
"main": "./out/server.js",
"typings": "./out/server.d.ts",
"bin": {
Expand Down
Loading