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:
@ -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')
|
||||
|
||||
Reference in New Issue
Block a user