Skip to content

Commit

Permalink
Drop variable lsp-dart-dap-only-essential-log, usually it filters i…
Browse files Browse the repository at this point in the history
…mportant logs.
  • Loading branch information
ericdallo committed Mar 13, 2022
1 parent 059dc5f commit 01b5867
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Run flutter proccess if not already running during hot-restart/hot-reload. #143
* Bump dart debugger extension to 3.36.0
* Add flag to use Dart SDK debugger instead of vscode extension. #128
* Drop variable `lsp-dart-dap-only-essential-log`, usually it filters important logs.

## 1.21.0

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ lsp-dart supports running Flutter and Dart commands as following:
| `lsp-dart-dap-vm-additional-args` | Additional args for dart debugging VM when the debugging. | `""` |
| `lsp-dart-dap-flutter-track-widget-creation` | Whether to pass –track-widget-creation to Flutter apps. Required to support 'Inspect Widget'. | `t` |
| `lsp-dart-dap-flutter-structured-errors` | Whether to use Flutter’s structured error support for improve error display. | `t` |
| `lsp-dart-dap-only-essential-log` | Whether to logs only essential log | `nil` |
| `lsp-dart-dap-flutter-hot-reload-on-save` | When enabled, every buffer save triggers a `lsp-dart-dap-flutter-hot-reload` | `nil` |
| `lsp-dart-dap-flutter-hot-restart-on-save` | When enabled, every buffer save triggers a `lsp-dart-dap-flutter-hot-restart` | `nil` |
| `lsp-dart-devtools-theme` | The devtools theme when openning via `lsp-dart-dap-open-devtools` | `"dark"` |
Expand Down
22 changes: 4 additions & 18 deletions lsp-dart-dap.el
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ Required to support 'Inspect Widget'."
:group 'lsp-dart
:type 'string)

(defcustom lsp-dart-dap-only-essential-log nil
"Whether to log only essential log from debugger."
:group 'lsp-dart
:type 'boolean)

(defcustom lsp-dart-dap-flutter-hot-reload-on-save nil
"Send hot reload to flutter during the debug."
:group 'lsp-dart
Expand Down Expand Up @@ -202,7 +197,6 @@ Required to support 'Inspect Widget'."
(dap--put-if-absent :dap-server-path (if (lsp-dart-dap-use-sdk-debugger-p)
`(,(lsp-dart-dart-command) "debug_adapter")
lsp-dart-dap-dart-debugger-program))
(dap--put-if-absent :output-filter-function #'lsp-dart-dap--output-filter-function)
(dap--put-if-absent :program (or (lsp-dart-get-project-entrypoint)
(buffer-file-name)))))

Expand Down Expand Up @@ -247,12 +241,6 @@ Call CALLBACK when the device is chosen and started successfully."
t)))
(lsp-dart-flutter-daemon-launch chosen-device callback))))))

(defun lsp-dart-dap--output-filter-function (msg)
"Output filter for dap-mode when parsing MSG."
(if lsp-dart-dap-only-essential-log
msg
""))

(defun lsp-dart-dap--populate-flutter-start-file-args (conf)
"Populate CONF with the required arguments for Flutter debug."
(let ((pre-conf (-> conf
Expand All @@ -262,7 +250,6 @@ Call CALLBACK when the device is chosen and started successfully."
(dap--put-if-absent :dap-server-path (if (lsp-dart-dap-use-sdk-debugger-p)
`(,(lsp-dart-flutter-command) "debug_adapter")
lsp-dart-dap-flutter-debugger-program))
(dap--put-if-absent :output-filter-function #'lsp-dart-dap--output-filter-function)
(dap--put-if-absent :program (or (lsp-dart-get-project-entrypoint)
(buffer-file-name))))))
(lambda (start-debugging-callback)
Expand Down Expand Up @@ -315,11 +302,10 @@ Call CALLBACK when the device is chosen and started successfully."

(cl-defmethod dap-handle-event ((_event (eql dart.log)) _session params)
"Handle debugger uris EVENT for SESSION with PARAMS."
(unless lsp-dart-dap-only-essential-log
(when-let (dap-session (dap--cur-session))
(-let* (((&hash "message") params))
(when-let (msg (lsp-dart-dap--parse-log-message message))
(dap--print-to-output-buffer dap-session msg))))))
(when-let (dap-session (dap--cur-session))
(-let* (((&hash "message") params))
(when-let (msg (lsp-dart-dap--parse-log-message message))
(dap--print-to-output-buffer dap-session msg)))))

(cl-defmethod dap-handle-event ((_event (eql dart.progressStart)) _session params)
"Handle debugger uris EVENT for SESSION with PARAMS."
Expand Down

0 comments on commit 01b5867

Please sign in to comment.