More lsp endpoints we were missing (#6612)

* add prepare rename

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add document color

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-04-30 19:47:36 -07:00
committed by GitHub
parent 2d77aa0d36
commit b686c79b49
10 changed files with 529 additions and 76 deletions

View File

@ -547,19 +547,10 @@ export class LanguageServerPlugin implements PluginValue {
try {
// First check if rename is possible at this position
const prepareResult = await this.client
.textDocumentPrepareRename({
textDocument: { uri: this.getDocUri() },
position: { line, character },
})
.catch(() => {
// In case prepareRename is not supported,
// we fallback to the default implementation
return this.prepareRenameFallback(view, {
line,
character,
})
})
let prepareResult = this.prepareRenameFallback(view, {
line,
character,
})
if (!prepareResult || 'defaultBehavior' in prepareResult) {
showErrorMessage(view, 'Cannot rename this symbol')