File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -2180,12 +2180,17 @@ to a non-existent file (for an example of such a case, try
2180
2180
(file-name-nondirectory (buffer-file-name proof-script-buffer))))))
2181
2181
proof-script-buffer
2182
2182
(let* ((lib-name (concat lib-path mod-name))
2183
- (output (company-coq-ask-prover-swallow-errors (format company-coq-locate-lib-cmd lib-name))))
2184
- (or (and output (save-match-data
2185
- (when (and (string-match company-coq-locate-lib-output-format output)
2186
- (string-match-p company-coq-compiled-regexp (match-string-no-properties 3 output)))
2187
- (concat (match-string-no-properties 2 output) ".v"))))
2188
- (and fallback-spec (expand-file-name (concat mod-name ".v") (cdr fallback-spec)))))))
2183
+ (output (company-coq-ask-prover-swallow-errors (format company-coq-locate-lib-cmd lib-name)))
2184
+ (path (or (and output (save-match-data
2185
+ (when (and (string-match company-coq-locate-lib-output-format output)
2186
+ (string-match-p company-coq-compiled-regexp (match-string-no-properties 3 output)))
2187
+ (concat (match-string-no-properties 2 output) ".v"))))
2188
+ (and fallback-spec (expand-file-name (concat mod-name ".v") (cdr fallback-spec)))))
2189
+ (stripped (replace-regexp-in-string "_build/default" "" path nil 'literal)))
2190
+ (if (file-exists-p stripped)
2191
+ stripped
2192
+ path
2193
+ ))))
2189
2194
2190
2195
(defun company-coq--locate-name (name functions)
2191
2196
"Find location of NAME using FUNCTIONS.
You can’t perform that action at this time.
0 commit comments