@@ -142,31 +142,31 @@ https://github.com/pyenv/pyenv-which-ext."
142142(defun dap-python--test-p (lsp-symbol )
143143 (let ((name (dap-python--symbol-name lsp-symbol)))
144144 (and (dap-python--equal (dap-python--symbol-type lsp-symbol) " Function" )
145- (s-starts-with? " test_" name))))
145+ (s-starts-with? " test_" name))))
146146
147147(defun dap-python--test-class-p (test-symbol lsp-symbol )
148148 (when (dap-python--equal (dap-python--symbol-type lsp-symbol) " Class" )
149149 (let* ((class-location (dap-python--symbol-location lsp-symbol))
150- (class-start-line (-> class-location dap-python--location-start dap-python--point-line))
151- (class-end-line (-> class-location dap-python--location-end dap-python--point-line))
152- (test-start-line (-> test-symbol dap-python--symbol-location dap-python--location-start dap-python--point-line)))
153- (and (> test-start-line class-start-line)
154- (< test-start-line class-end-line)))))
150+ (class-start-line (-> class-location dap-python--location-start dap-python--point-line))
151+ (class-end-line (-> class-location dap-python--location-end dap-python--point-line))
152+ (test-start-line (-> test-symbol dap-python--symbol-location dap-python--location-start dap-python--point-line)))
153+ (and (> test-start-line class-start-line)
154+ (< test-start-line class-end-line)))))
155155
156156(defun dap-python--nearest-test (lsp-symbols )
157157 (cl-callf reverse lsp-symbols)
158158 (when-let ((test-symbol (-first 'dap-python--test-p lsp-symbols)))
159159 (let ((class-symbol
160160 (-first (-partial 'dap-python--test-class-p test-symbol)
161161 lsp-symbols)))
162- (if ( eq nil class-symbol)
163- (concat " ::" (dap-python--symbol-name test -symbol) )
164- ( concat " ::" (dap-python--symbol-name class -symbol)
165- " ::" (dap-python--symbol-name test-symbol))))))
162+ (if class-symbol
163+ (concat " ::" (dap-python--symbol-name class -symbol)
164+ " ::" (dap-python--symbol-name test -symbol) )
165+ ( concat " ::" (dap-python--symbol-name test-symbol))))))
166166
167167(defun dap-python--cursor-position ()
168168 (make-dap-python--point :line (line-number-at-pos )
169- :character (current-column )))
169+ :character (current-column )))
170170
171171(defun dap-python--test-at-point ()
172172 (->> (lsp--get-document-symbols)
@@ -292,11 +292,11 @@ ARGS may be a string, a vector or a list."
292292
293293(dap-register-debug-provider " python-test-at-point" 'dap-python--populate-test-at-point )
294294(dap-register-debug-template " Python :: Run pytest (at point)"
295- (list :type " python-test-at-point"
296- :args " "
297- :module " pytest"
298- :request " launch"
299- :name " Python :: Run pytest (at point)" ))
295+ (list :type " python-test-at-point"
296+ :args " "
297+ :module " pytest"
298+ :request " launch"
299+ :name " Python :: Run pytest (at point)" ))
300300
301301(cl-defmethod dap-handle-event ((_event-type (eql debugpyWaitingForServer)) _session _params))
302302(cl-defmethod dap-handle-event ((_event-type (eql debugpyAttach)) _session _params))
0 commit comments