Skip to content

Commit 7e3d342

Browse files
committed
fix json string being insert to curretn buffer when running lsp-dart-run.
Fixes #224
1 parent 54c6dce commit 7e3d342

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
* fix json string being insert to curretn buffer when running `lsp-dart-run`. #224
4+
35
## 1.24.3
46

57
* Add `lsp-dart-dap-tools-args` to configure custom args for DAP process.

lsp-dart-flutter-daemon.el

+13-12
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,19 @@
4747
&key method params &allow-other-keys)
4848
"Implement send method to format JSON properly.
4949
CONN ARGS METHOD PARAMS"
50-
(when method
51-
(plist-put args :method
52-
(cond ((keywordp method) (substring (symbol-name method) 1))
53-
((and method (symbolp method)) (symbol-name method))
54-
((stringp method) method))))
55-
(unless params
56-
(cl-remf args :params))
57-
(let ((json (concat "[" (jsonrpc--json-encode args) "]\r\n")))
58-
(jsonrpc--log-event conn args 'client)
59-
(process-send-string
60-
(jsonrpc--process conn)
61-
json)))
50+
(with-temp-buffer
51+
(when method
52+
(plist-put args :method
53+
(cond ((keywordp method) (substring (symbol-name method) 1))
54+
((and method (symbolp method)) (symbol-name method))
55+
((stringp method) method))))
56+
(unless params
57+
(cl-remf args :params))
58+
(let ((json (concat "[" (jsonrpc--json-encode args) "]\r\n")))
59+
(jsonrpc--log-event conn args 'client)
60+
(process-send-string
61+
(jsonrpc--process conn)
62+
json))))
6263

6364
(cl-defmethod initialize-instance :after ((conn lsp-dart-flutter-daemon-connection) _slots)
6465
"CONN."

0 commit comments

Comments
 (0)