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

Go to definition fails on windows #515

Open
AbhinavOmprakash opened this issue Jul 12, 2023 · 4 comments
Open

Go to definition fails on windows #515

AbhinavOmprakash opened this issue Jul 12, 2023 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed windows

Comments

@AbhinavOmprakash
Copy link

whenever I try to go to the definition of a word using gd I run into an error

; localhost:51602 (...gged\conjure/lua/conjure/client/clojure/nrepl/action.lua:337: Cursor position outside buffer): .nrepl-port

I have been facing this issue on windows I'm on conjure v4.45.0

when I enable conjure debugging this is the output I get

; def (word): first
; debug: send
{:id "167e1659-9cd2-4782-8b2e-518f31c9101a"
 :ns "snitch.core-test"
 :op "info"
 :session "16937673-286d-4ffa-a360-d9a77ec5bece"
 :symbol "first"}
; debug: receive
{:added "1.0"
 :arglists-str "[coll]"
 :column 1
 :doc "Returns the first item in the collection. Calls seq on its
    argument. If coll is nil, returns nil."
 :file "jar:file:/C:/Users/abhin/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar!/clojure/core.clj"
 :id "167e1659-9cd2-4782-8b2e-518f31c9101a"
 :line 49
 :name "first"
 :ns "clojure.core"
 :resource "clojure/core.clj"
 :see-also ["clojure.core/rest"
            "clojure.core/next"
            "clojure.core/nth"
            "clojure.core/second"
            "clojure.core/take"
            "clojure.core/ffirst"
            "clojure.core/butlast"]
 :session "16937673-286d-4ffa-a360-d9a77ec5bece"
 :static "true"
 :status ["done"]}
; --------------------------------------------------------------------------------
; localhost:50264 (...gged\conjure/lua/conjure/client/clojure/nrepl/action.lua:337: Cursor position outside buffer): .nrepl-port
@Olical Olical added the bug Something isn't working label Jul 12, 2023
@Olical
Copy link
Owner

Olical commented Jul 12, 2023

This looks like the issue as I suspected: :file "jar:file:/C:/Users/abhin/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar!/clojure/core.clj"

The path may need a different prefix and I'm not sure if we need different slashes for Windows in this case too. This works for me (different Clojure version but still):

nvim zipfile:///home/olical/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar::/clojure/core.clj

Which of these work for you, if any? (also notice how it should be clojure/core.clj, not /clojure/core.clj)

# Correct path with no prefix slash.
nvim zipfile://C:/Users/abhin/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar::clojure/core.clj

# Not sure if windows requires double backslashes like this or just one?
nvim zipfile://C:\\Users\\abhin\\.m2\\repository\\org\\clojure\\clojure\\1.10.3\\clojure-1.10.3.jar::clojure\\core.clj
nvim zipfile://C:\Users\abhin\.m2\repository\org\clojure\clojure\1.10.3\clojure-1.10.3.jar::clojure\core.clj

Also if you're using AstroNvim I just realised that it disables the zip plugin required to read .jar files by default, I overrode this and shorted the disabled plugins list with this:

 :lazy {:defaults {:lazy false}
        :dev {:path "~/repos/Olical"}
        :performance {:rtp {:disabled_plugins ["tohtml" "netrwPlugin"]}}}

@Olical
Copy link
Owner

Olical commented Jul 12, 2023

Also you should get some output when running :let zipPlugin_ext if you have the required zip plugin loaded. If not, maybe something is disabling it because it's a builtin feature.

@AbhinavOmprakash
Copy link
Author

AbhinavOmprakash commented Jul 17, 2023

hey, sorry for the late reply. I tried the following

nvim zipfile://C:\\Users\\abhin\\.m2\\repository\\org\\clojure\\clojure\\1.10.3\\clojure-1.10.3.jar::clojure\\core.clj
nvim zipfile://C:\Users\abhin\.m2\repository\org\clojure\clojure\1.10.3\clojure-1.10.3.jar::clojure\core.clj
nvim zipfile:\\C:\Users\abhin\.m2\repository\org\clojure\clojure\1.11.0\clojure-1.11.0.jar::\clojure\core.clj
nvim zipfile://C:\Users\abhin\.m2\repository\org\clojure\clojure\1.11.0\clojure-1.11.0.jar::\clojure\core.clj   

and they didn't work for me.

go to definition doesn't work within the same repository as well. AFAIK windows paths either require \ backslashes or double forward slashes //

I don't use astroNvim so I don't think the zip plugin is disabled

@Olical
Copy link
Owner

Olical commented Jul 28, 2023

If someone can give me a zipfile path that works on their windows machine I can make sure Conjure uses that, I don't have access to Windows right now though and don't know how to run nvim on it anyway. Like aren't there two very different ways Windows users could be using Neovim on windows?

As I understand it there's:

  • WSL (which is just a Linux VM being passed through)
  • The cmd prompt thing (which is full on windows with backslashes everywhere)
  • Gitbash prompts etc where they sort of mimic unix-y stuff on windows.

I'm not sure how the paths should look on each or if the protocol slashes should be :// on EVERY platform no matter what 🤔

If someone can give me a good path I can integrate that, I just don't know what it should be right now.

@Olical Olical added help wanted Extra attention is needed windows labels Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed windows
Projects
None yet
Development

No branches or pull requests

2 participants