LSP Context based refactoring
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Description
The rename refactoring inside a TS file shows up everywhere and that makes no sense.
You can select the following code, everything and hit the rename/refactoring action. It will just add the last selected char which is }
```typescript
import {
trim
} from 'lodash';
export default class Test {
public fun(sql: string): string {
let formattedSql: string;
formattedSql = sql
.replace(/\n/g, ' ')
.replace(/\t/g, ' ')
.replace(/ +/g, ' ');
formattedSql = trim(formattedSql);
return formattedSql;
};
}
```
### Use case/motivation
The code completion should show up when it is correct context, class name renaming, other stuff, etc. For everything else, it should do nothing or like in Java, it should show a dialog (better a notification, less disturbing) to not having the right context to rename/refactoring anything. I think this is a problem of the generic lsp client renaming, so it can happen for any language that I add a rename functionality to the DataObject.
### Related issues
_No response_
### Are you willing to submit a pull request?
No
### Code of Conduct
Yes
Contributor guide
Research direction
Reproduce the rename/refactoring action with the TypeScript example, then trace the generic LSP client and the DataObject rename functionality. Done means rename or refactoring appears only in the correct context, while unsupported selections do nothing or show a notification instead of inserting the last selected character.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100