Fork me on GitHub
#lsp
<
2023-06-01
>
juhoteperi12:06:17

Is it the editor or clojure-lsp adding new require to the ns form when selecting option from autocomplete which is from non-required namespace, or in this case JS library? When I select e.g. Typography I get require to [material/Typography$default :as Typography] though the correct one is ["@mui/material/Typography$default" :as Typography]. And in this case the correct require already exists.

ericdallo12:06:45

clojure-lsp has this feature? just not sure if it does for cljs like that

ericdallo12:06:18

If that alias was already required elsewhere, yes, it could be clojure-lsp (clj-refactor has a similar feature)

juhoteperi12:06:57

Might be my nvim autocomplete setup that does this based on the information in the autocomplete results, but I don't know how it would know if the require is already present

juhoteperi12:06:47

And in this case I'm using the same alias in other files, so it could be that

ericdallo13:06:09

Yeah, could be clojure-lsp indeed

juhoteperi13:06:14

Yeah, if I try rrefering to MUI component that isn't used elsewhere in the codebase I don't get a completion result

juhoteperi16:06:35

I might continue later but until then the draft PR hopefully gives some idea where those JS lib requires are broken

ericdallo19:06:08

Thanks for the investigation, I commented in the issue, LMK if need more help