Closed noahmoss closed 2 years ago
@noahmoss Thanks for your reporting! Hmm, it may be the cause that nREPL returned unexpected values.
Cound you execute the following command to enable debug mode, and reproduce the same errors?
:let g:iced#debug = v:true
With debug mode, requests and responses are outputted to :message
, so please tell me the result of :message
result if you can.
@liquidz Just did that, the results are here: https://gist.github.com/noahmoss/7ecbcf8a427ec11150085d23fd4b062a
Maybe this has something to do with ns-list
returning a large number of namespaces? I'm running into this while working in the Metabase codebase which is a very large project.
@noahmoss Thanks! I'll try to find the cause.
@noahmoss The response form from refactor-nrepl seems to be unexpected.
I've fix the problem in dev
branch, so could you try?
@liquidz That fixed it, thank you!
I have another somewhat related issue, though I'm not sure if you would consider it a bug or not. When I run IcedCleanNs
it totally reformats the ns
form.
For example if I start with this:
(ns metabase.setup
(:require [environ.core :as env]
[metabase.models.setting :as setting :refer [defsetting Setting]]
[metabase.models.user :refer [User]]
[toucan.db :as db])
(:import java.util.UUID))
After running IcedCleanNs
it changes it to this:
(ns metabase.setup
(:require
[environ.core :as env]
[metabase.models.setting :as setting :refer [defsetting Setting]]
[metabase.models.user :refer [User]]
[toucan.db :as db])
(:import
(java.util UUID)))
I don't think it did this in the past, so maybe there was a recent change that affected this? My expectation is that "cleaning" the namespace would mean sorting them and removing unused namespaces, but not touching the formatting.
@noahmoss Thanks for your confirmation!
I have another somewhat related issue, though I'm not sure if you would consider it a bug or not. When I run IcedCleanNs it totally reformats the ns form. I don't think it did this in the past, so maybe there was a recent change that affected this?
refactor-nrepl seems to return reformatted ns form since v3.0.0
clean-ns should conform to the style guide: (:require in the ns form should be followed by a newline.
and vim-iced start to use refactor-nrepl v3.1.0 since v3.7.3
So it should be able to configure :insert-newline-after-require
from vim-iced options.
@noahmoss I added g:iced#refactor#insert_newline_after_require option for trial.
Could you try the following setting in the latest dev
branch?
let g:iced#refactor#insert_newline_after_require = v:false
@liquidz Nice, that solved it, thanks! 👍
@noahmoss Just released v3.8.5 #400
Hi @liquidz!
When I run
IcedAddNs
I get the following errors:It then prompts me to enter an alias for the namespace but the default value is
-1
. If I enter an alias and continue hitting enter, it eventually adds the namespace to the file, but with no indentation, so it's not actually in therequire
form.