Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding require command fails for requires without alias #1791

Closed
blnote opened this issue Mar 15, 2024 · 1 comment
Closed

Adding require command fails for requires without alias #1791

blnote opened this issue Mar 15, 2024 · 1 comment
Labels
bug Something isn't working editor Related to clojure-lsp on a text editor
Projects

Comments

@blnote
Copy link
Contributor

blnote commented Mar 15, 2024

Describe the bug
the code action to add a namespace results in error when it is an unqualified namespace (like tmp, user).

To Reproduce
Steps to reproduce the behavior:

  1. create namespace
(ns tmp)
(def f inc)
  1. execute code action to require from another namespace, eg for line (tmp/f 2)

Expected behavior
no error

This seems to occur only after the recent code change supporting js-requires PR

culprit seems to be a change in the add-require-suggestion function of add_missing_libspec.clj that transforms chosen-ns to a symbol (line 608). No error occurs when removing this line, but probably it was needed for the new functionality. I don't have the time to look into this in detail right now.

@blnote blnote added bug Something isn't working editor Related to clojure-lsp on a text editor labels Mar 15, 2024
@ericdallo ericdallo changed the title adding require for unqualified namespaces does result in error Adding require command fails for requires without alias Mar 16, 2024
@ericdallo
Copy link
Member

ericdallo commented Mar 16, 2024

This happens for any code action without alias like:

Add require '[foo.bar]'

@ericdallo ericdallo added this to Low priority in clojure-lsp via automation Mar 16, 2024
@ericdallo ericdallo moved this from Low priority to High priority (Probably next release) in clojure-lsp Mar 16, 2024
clojure-lsp automation moved this from High priority (Probably next release) to Next release Mar 16, 2024
@ericdallo ericdallo moved this from Next release to Done in clojure-lsp Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working editor Related to clojure-lsp on a text editor
Projects
Development

No branches or pull requests

2 participants