File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
src/main/clojure/com/github/clojure_lsp/intellij/extension Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 44
55- Add shortcuts to backward slurp and barf.
66- Add shortcut documentation to all features, check the features doc page.
7+ - Fix Rename feature not being available for some cases.
78
89## 1.14.5
910
Original file line number Diff line number Diff line change 1212 [com.intellij.openapi.project Project]
1313 [com.intellij.openapi.ui Messages NonEmptyInputValidator]
1414 [com.intellij.openapi.util TextRange]
15- [com.intellij.psi PsiFile]
15+ [com.intellij.psi PsiDocumentManager PsiFile]
1616 [com.intellij.refactoring.rename PsiElementRenameHandler]))
1717
1818(set! *warn-on-reflection* true )
1919
2020(defn -isAvailableOnDataContext [_ ^DataContext data-context]
2121 (boolean
22- (and (.getData data-context CommonDataKeys/EDITOR)
23- (.getData data-context CommonDataKeys/PSI_FILE)
24- (let [element (PsiElementRenameHandler/getElement data-context)]
25- (instance? PsiFile element)))))
22+ (when-let [element (or (and (.getData data-context CommonDataKeys/PSI_FILE)
23+ (PsiElementRenameHandler/getElement data-context))
24+ (and (.getData data-context CommonDataKeys/PROJECT)
25+ (.getData data-context CommonDataKeys/EDITOR)
26+ (.getPsiFile (PsiDocumentManager/getInstance (.getData data-context CommonDataKeys/PROJECT))
27+ (.getDocument ^Editor (.getData data-context CommonDataKeys/EDITOR)))))]
28+ (instance? PsiFile element))))
2629
2730(defn -isRenaming [this data-context]
2831 (-isAvailableOnDataContext this data-context))
You can’t perform that action at this time.
0 commit comments