Skip to content

Commit b5d88ee

Browse files
committed
Fix lsp--buffer-for-file
1 parent fac7ccb commit b5d88ee

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lsp-dart-closing-labels.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ be sent with information to render editor closing labels."
4242

4343
(lsp-defun lsp-dart-closing-labels-handle (_workspace (&ClosingLabelsNotification :uri :labels))
4444
"Closing labels notification handler."
45-
(when-let (buffer (lsp--buffer-for-file (lsp--uri-to-path uri)))
45+
(when-let (buffer (find-buffer-visiting (lsp--uri-to-path uri)))
4646
(with-current-buffer buffer
4747
(remove-overlays (point-min) (point-max) 'lsp-dart-closing-labels t)
4848
(seq-doseq (label labels)

lsp-dart-code-lens.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ NAMES arg is optional and are the group of tests representing a test name."
181181

182182
(lsp-defun lsp-dart-code-lens-check-main (uri (&Outline :children))
183183
"Check URI and outline for main method adding lens to it."
184-
(-let* ((buffer (lsp--buffer-for-file (lsp--uri-to-path uri)))
184+
(-let* ((buffer (find-buffer-visiting (lsp--uri-to-path uri)))
185185
(main-outline (lsp-dart-code-lens--find-main-outline children)))
186186
(when buffer
187187
(with-current-buffer buffer
@@ -193,7 +193,7 @@ NAMES arg is optional and are the group of tests representing a test name."
193193
(lsp-defun lsp-dart-code-lens-check-test (uri (&Outline :children))
194194
"Check URI and outline for test adding lens to it."
195195
(when (lsp-dart-test-file-p uri)
196-
(when-let (buffer (lsp--buffer-for-file (lsp--uri-to-path uri)))
196+
(when-let (buffer (find-buffer-visiting (lsp--uri-to-path uri)))
197197
(with-current-buffer buffer
198198
(remove-overlays (point-min) (point-max) 'lsp-dart-test-code-lens t)
199199
(save-excursion

lsp-dart-flutter-widget-guide.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ ANCHOR is the anchor point of the widget guide at LINE."
139139

140140
(lsp-defun lsp-dart-flutter-widget-guide-check ((&FlutterOutlineNotification :uri :outline))
141141
"Check if there is any widget guide on buffer from uri of OUTLINE-PARAMS."
142-
(-when-let (buffer (lsp--buffer-for-file (lsp--uri-to-path uri)))
142+
(-when-let (buffer (find-buffer-visiting (lsp--uri-to-path uri)))
143143
(with-current-buffer buffer
144144
(remove-overlays (point-min) (point-max) 'category 'lsp-dart-flutter-widget-guide)
145145
(let* ((guides (lsp-dart-flutter-widget-guide--outline->guides outline))

lsp-dart-outline.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ OUTLINES are the outline items."
133133
"Build the action options for the Flutter outline tree view.
134134
URI is the source of the outline.
135135
RANGE is the range for currently build item."
136-
(-when-let (buffer (lsp--buffer-for-file (lsp--uri-to-path uri)))
136+
(-when-let (buffer (find-buffer-visiting (lsp--uri-to-path uri)))
137137
(with-current-buffer buffer
138138
(goto-char (-> range lsp--range-to-region car))
139139
(->> (lsp-code-actions-at-point)
@@ -218,7 +218,7 @@ It updates the outline view if it already exists."
218218
(when lsp-dart-test-code-lens
219219
(lsp-dart-code-lens-check-test uri outline))
220220
(when (get-buffer-window "*Dart Outline*")
221-
(lsp-dart-outline--show-outline (lsp--buffer-for-file (lsp--uri-to-path uri)) t)))
221+
(lsp-dart-outline--show-outline (find-buffer-visiting (lsp--uri-to-path uri)) t)))
222222

223223
(lsp-defun lsp-dart-outline-handle-flutter-outline (workspace (notification &as &FlutterOutlineNotification :uri))
224224
"Flutter outline notification handling from WORKSPACE.
@@ -228,7 +228,7 @@ It updates the Flutter outline view if it already exists."
228228
(when lsp-dart-flutter-widget-guides
229229
(lsp-dart-flutter-widget-guide-check notification))
230230
(when (get-buffer-window "*Flutter Outline*")
231-
(lsp-dart-outline--show-flutter-outline (lsp--buffer-for-file (lsp--uri-to-path uri)) t)))
231+
(lsp-dart-outline--show-flutter-outline (find-buffer-visiting (lsp--uri-to-path uri)) t)))
232232

233233

234234
;;; Public interface

0 commit comments

Comments
 (0)