;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\310\311DD\312\313\314\315\316&\210\305\317\307\310\320DD\321\313\314\315\316&\207" [require dash lsp-mode dap-mode lsp-dart-utils custom-declare-variable lsp-dart-devtools-theme funcall function #[0 "\300\207" [#1="dark"] 1 #1#] "The theme to Dart DevTools." :group lsp-dart :type string lsp-dart-devtools-hide-options #[0 "\300\207" [#2="debugger"] 1 #2#] "What to hide when openning Dart DevTools."] 8) (defconst lsp-dart-devtools--buffer-name "*LSP Dart - DevTools*") (defconst lsp-dart-devtools--pub-list-packages-buffer-name "*LSP Dart - Pub list packages*") #@54 Custom logger for MSG and ARGS. (fn MSG &rest ARGS) (defalias 'lsp-dart-devtools-log #[385 "\300\301\302$\207" [apply lsp-dart-custom-log "[DEVTOOLS]"] 7 (#$ . 730)]) (cl-generic-define-method 'dap-handle-event nil '((_event (eql dart\.debuggerUris)) _session params) nil #[771 "\300\301\"\302\303\"\207" [gethash "vmServiceUri" lsp-workspace-set-metadata "devtools-vm-service-uri"] 7 "Handle debugger uris EVENT for SESSION with PARAMS.\n\n(fn EVENT SESSION PARAMS)"]) #@36 Clean BUFFER content. (fn BUFFER) (defalias 'lsp-dart-devtools--clean-buffer #[257 "\300!\205 r\211q\210\301 )\207" [get-buffer erase-buffer] 3 (#$ . 1211)]) #@44 Return all content of BUFFER. (fn BUFFER) (defalias 'lsp-dart-devtools--buffer-whole-string #[257 "r\211q\210\214~\210\300ed\"*\207" [buffer-substring-no-properties] 4 (#$ . 1378)]) #@126 Check for uri on devtools buffer and call CALLBACK with it. If URI is not found on buffer, schedule re-check. (fn CALLBACK) (defalias 'lsp-dart-devtools--check-devtools-uri #[257 "\302!\211\303\230\203\304\305\306\307$\207\310\311\312\313 \203\314\202\315\316\306\317\306&\"\310\320\"\310\321\"\322\323!Q\324\325\"\210!\207" [lsp-dart-devtools--buffer-name lsp-use-plists lsp-dart-devtools--buffer-whole-string "" run-with-idle-timer 0.3 nil lsp-dart-devtools--check-devtools-uri gethash "params" json-parse-string :object-type plist hash-table :null-object :false-object "host" "port" ":" number-to-string lsp-workspace-set-metadata "dart-debug-devtools-uri"] 12 (#$ . 1568)]) #@56 Return non-nil if devtools is activated otherwise nil. (defalias 'lsp-dart-devtools--activated-p #[0 "\302!\210\303 \304\305\304\304\306\307&\210\310!\311\304\312\313#)\207" [lsp-dart-devtools--pub-list-packages-buffer-name inhibit-changing-match-data lsp-dart-devtools--clean-buffer lsp-dart-pub-command nil call-process "global" "list" lsp-dart-devtools--buffer-whole-string "devtools \\([0-9]\\.[0-9]\\.[0-9]\\)" t string-match] 10 (#$ . 2270)]) #@67 Activate Dart Devtools via pub then call CALLBACK. (fn CALLBACK) (defalias 'lsp-dart-devtools--activate #[257 "\300\301!\210\302 \303\304\305\"\306\307\310\311&\207" [lsp-dart-devtools-log "Activating..." lsp-dart-pub-command lsp-async-start-process make-closure #[0 "\301\302!\210\300 \207" [V0 lsp-dart-devtools-log "Activated successfully!"] 2] #[257 "\300\301!\207" [lsp-dart-devtools-log "Could not activate DevTools. Try to activate manually running 'pub global activate devtools'"] 3 "\n\n(fn _)"] "global" "activate" "devtools"] 9 (#$ . 2735)]) #@156 Check if devtools is activated otherwise prompt for activate it. If it is already activated or after activated successfully, call CALLBACK. (fn CALLBACK) (defalias 'lsp-dart-devtools--check-activated #[257 "\300 \203\211 \207\301\302!\205\303!\207" [lsp-dart-devtools--activated-p y-or-n-p "Dart DevTools needs to be activated with 'pub global activate devtools' to use this feature.\nActivate DevTools? " lsp-dart-devtools--activate] 3 (#$ . 3299)]) #@63 Kill the devtools PROC process of SESSION. (fn PROC SESSION) (defalias 'lsp-dart-devtools--kill-proc #[514 "\301\302\303\"\210\304!\210\305!\207" [lsp-dart-devtools--buffer-name lsp-workspace-set-metadata "dart-debug-devtools-uri" nil delete-process lsp-dart-devtools--clean-buffer] 5 (#$ . 3762)]) (defvar lsp-dart-devtools--check-uri-timer nil nil) (make-variable-buffer-local 'lsp-dart-devtools--check-uri-timer) #@90 Start Dart DevTools process and call CALLBACK after started successfully. (fn CALLBACK) (defalias 'lsp-dart-devtools--start #[257 "\300\301\302\"!\207" [lsp-dart-devtools--check-activated make-closure #[0 "\303\304!\211\203 \300!\207\305 \306\307 \310\311\312\313\314\315\316&\n\317\320\321\322\"\"\210\n\203*\323\n!\210\324\325\326\327\300$\211\207" [V0 lsp-dart-devtools--buffer-name lsp-dart-devtools--check-uri-timer lsp-workspace-get-metadata "dart-debug-devtools-uri" lsp-dart-pub-command start-process "Start DevTools" "global" "run" "devtools" "--machine" "--enable-notifications" "--try-ports" "10" add-hook dap-terminated-hook -partial lsp-dart-devtools--kill-proc cancel-timer run-with-idle-timer 0.3 nil lsp-dart-devtools--check-devtools-uri] 13]] 5 (#$ . 4187)]) #@82 Open DevTools URI with VM-SERVICE-URI param at browser. (fn URI VM-SERVICE-URI) (defalias 'lsp-dart-devtools--open #[514 "\302\303\304D\305D\306 DF!\307\310R\311!\207" [lsp-dart-devtools-hide-options lsp-dart-devtools-theme url-build-query-string (ide Emacs) uri hide theme "http://" "?" browse-url] 8 (#$ . 4977)]) #@51 Open Dart DevTools for the current debug session. (defalias 'lsp-dart-open-devtools #[0 "\300 \301\302!\205\211\205\303\304\305\"!\207" [dap--cur-session lsp-workspace-get-metadata "devtools-vm-service-uri" lsp-dart-devtools--start make-closure #[257 "\301\302!\210\303\300\"\207" [V0 lsp-dart-devtools-log "Openning at browser..." lsp-dart-devtools--open] 4 "\n\n(fn URI)"]] 6 (#$ . 5305) nil]) (provide 'lsp-dart-devtools)