File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed
Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change 99(defun rust-auto-use/insert-use-line (use-line )
1010 (save-excursion
1111 (beginning-of-buffer )
12- (forward-line -1 )
13- (forward-paragraph )
14- (while (not (or (looking-at " use " )
15- (looking-at " [[:space:]]*$" )))
16- (forward-line ))
12+ (while (or (looking-at " /" )
13+ (looking-at " extern" ))
14+ (forward-line )
15+ (beginning-of-line ))
1716
18- (newline )
19- (insert use-line)))
20-
21- (defun rust-auto-use/deduce-use-line ()
22- (let ((symbol (symbol-at-point )))
23- (let ((cached-result (gethash symbol rust-auto-use/symbol-cache)))
24- (if cached-result
25- cached-result
26- (rust-auto-use/save-result symbol (rust-auto-use/parse-import-string-from-symbol symbol))))))
17+ (insert use-line)
18+ (newline )
19+ (if (and (not (looking-at " [[:space:]]*$" ))
20+ (not (looking-at " use " )))
21+ (newline ))))
22+
23+
24+ (defun rust-auto-use/deduce-use-line ()
25+ (let ((symbol (symbol-at-point )))
26+ (let ((cached-result (gethash symbol rust-auto-use/symbol-cache)))
27+ (if cached-result
28+ cached-result
29+ (rust-auto-use/save-result symbol (rust-auto-use/parse-import-string-from-symbol symbol))))))
2730
2831
2932(defun rust-auto-use/parse-import-string-from-symbol (symbol )
You can’t perform that action at this time.
0 commit comments