GithubHelp home page GithubHelp logo

clojure-lsp / clojure-lsp Goto Github PK

View Code? Open in Web Editor NEW
1.1K 20.0 148.0 32.44 MB

Clojure & ClojureScript Language Server (LSP) implementation

Home Page: https://clojure-lsp.io

License: MIT License

Clojure 99.50% Shell 0.36% Java 0.01% Emacs Lisp 0.02% Nix 0.12%
clojure lsp language-server clj clojure-lsp lsp-support refactorings graalvm native-binaries

clojure-lsp's Introduction

CI Clojars Project cljdoc Slack community Github stars

clojure-lsp

A Language Server for Clojure(script). Taking a Cursive-like approach of statically analyzing code.


homepagefeaturesinstallationsettingsclientstroubleshootingsupport us


Overview

The goal of this project is to bring great editing tools for Clojure/Clojurescript to all editors and programatically via its CLI and API. It aims to work alongside you to help you navigate, identify and fix errors, perform refactors and much more!

You will get:

  • Autocomplete
  • Jump to definition/implementation
  • Find references
  • Renaming
  • Code actions
  • Errors
  • Automatic ns cleaning
  • Lots of Refactorings
  • Code lens
  • Semantic tokens (syntax highlighting)
  • Call hierarchy
  • Java interop

For all available documentation, check the official website.

Also, clojure-lsp doesn't need to run only with an editor, for more information check the Outside editor (API) section.


Contribution

Contributions to clojure-lsp are very welcome! You can open an issue or a PR and we will love to help.


Support the project

clojure-lsp has more than 30.000 lines of code, to keep all of this working, we need to help the community with a lot of issues and implement new features. As a LSP server, this project is the base for Clojure clients like Emacs(lsp-mode), VSCode(Calva), vim and other editors.

You can help us keep going and improving it by supporting the project, the support helps to keep the project going and being updated and maintained.

🚀 Thank you to Clojurists Together which sponsored this project during Q3 2021 and Q1 2022 🚀

Gold sponsors

Sponsors

Special thanks to Eccentric-J for the clojure-lsp logo

clojure-lsp's People

Contributors

andre0991 avatar blnote avatar borkdude avatar bpringe avatar chenrui333 avatar clojure-lsp-bot avatar cnly avatar cyrik avatar daveyarwood avatar dcfrankel avatar dharrigan avatar dpsutton avatar ericdallo avatar fabiodomingues avatar fierycod avatar github-actions[bot] avatar ikappaki avatar janosmeszaros avatar jlesquembre avatar luisthiamnye avatar luminiscental avatar mainej avatar patrickpichler avatar pez avatar projectfrank avatar rafaeldelboni avatar roman01la avatar rvlo avatar snoe avatar victorpigmeo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clojure-lsp's Issues

Help with VS Code client

Hi @snoe,

I do some work on a Clojure & ClojureScript extension for VS Code (it's called Calva) and I'm very keen to try the language server, but I didn't manage to get it working.

The server can be found on my path and I can launch the extension, but then I get an 'Internal error' and I don't find any log.

Could you give me a hand? I really want to see how the server works :)

goto definition and find references do not work for protocol methods

It would be really great if, for a given protocol method, find references showed:

  • invocations of the protocol method
  • implementations of the protocol method
  • the protocol declaration itself

Ideally goto definition would take you to the implementation of the protocol method, but that's probably really hard or impossible. IMO, it would be acceptable to be taken to the protocol declaration.

warn on shadowing function from ns

Local binding had a logical name "import-data". This was such a good name there was already a function in the ns named the same thing. So ended up calling the vector import-data on some args rather than the function which was shadowed.

be nice to have a warning when shadowing

Jump from definition to usage

Cursive has this very nice feature to be able to jump from definition to usage place. Is it possible to implement this? Happy to help, but need initial guidance.

Add the ability to show documentation

hi folks,

I've been using clojure-lsp with Vim through coc.vim for quite some time now, and a feature that really miss is the ability to display documentation. In my coc.vim configuration K is mapped to show me the doc, and in rust I get:
image

That would be a really neat feature for clojure-lsp too

Reuse existing parsing/linting libraries

So I was spending an evening implementing invalid arity diagnostic and wondering if it would make sense to use existing libraries for linting. My original concern was about double parsing, once by lsp and once by linting library, but clj-kondo https://github.com/borkdude/clj-kondo seem to provide analysis data which could be reused in lsp. The library seems to have lots of linting rules. @snoe what do you think?

Indentation mangled by `inline-symbol`

Thanks for adding this! Works nicely but the indentation wasn't right.

        allocation-unsuccessful (eutils/from-command
                                 command
                                 (assoc allocatable
                                        ::event/action ::allocation/unsuccessful))
        errfn (fn [errors] (sutils/->failure-result command errors
                                                    allocation-unsuccessful))]

->

        errfn (fn [errors] (sutils/->failure-result command errors
                                                    (eutils/from-command)
                                 command
                                 (assoc allocatable
                                        ::event/action ::allocation/unsuccessful)))]

Should be:

        errfn (fn [errors] (sutils/->failure-result command errors
                                                    (eutils/from-command
                                                     command
                                                     (assoc allocatable
                                                            ::event/action ::allocation/unsuccessful))))]

Is it possible to complete Java classes?

Say I access Java classes like this:

(println (doto (java.util.Stack.)
  (.push 42)
  (.push 13)
  (.push 7)))

I can't seem to complete java.util.. Is this supported by this clojure-lsp?

Thanks!

expand-let inserts error

If I run crel on (eutils/from-command...):

(defmethod auto-alloc :start
  (let [errfn #(sutils/->failure-result
                command %
                (eutils/from-command
                 command
                 (assoc allocatable
                        ::event/action ::allocation/unsuccessful)))]))

It goes bananas:

(defmethod auto-alloc :start
  (let [errfn (let command
               ^{:row 58, :col 15, :end-row 63, :end-col 68} #rewrite_clj.node.fn.FnNode{:children (<token: sutils/->failure-result> <newline: "\n"> <whitespace: "                "> <token: command> <whitespace: " "> <token: %> <newline: "\n"> <whitespace: "                "> <list:)})])
  (assoc allocatable
                          ::event/action ::allocation/unsuccessful))
>

I remember now that this is not what crel is for and yet, I would prefer it did nothing at all.

`extract-function` refactoring not working

I tried to setup the extract-function refactoring with vim, but get following exception:

ERROR clojure-lsp.main: #error {
 :cause Wrong number of args (5) passed to: transform/extract-function                
 :via
 [{:type clojure.lang.ArityException
   :message Wrong number of args (5) passed to: transform/extract-function            
   :at [clojure.lang.AFn throwArity AFn.java 429]}]                                   
 :trace
 [[clojure.lang.AFn throwArity AFn.java 429]
  [clojure.lang.AFn invoke AFn.java 48]
  [clojure.lang.AFn applyToHelper AFn.java 171]                                       
  [clojure.lang.AFn applyTo AFn.java 144]
  [clojure.lang.Var applyTo Var.java 702]
  [clojure.core$apply invokeStatic core.clj 661]                                      
  [clojure.core$apply invoke core.clj 652]
  [clojure_lsp.handlers$refactor invokeStatic handlers.clj 313]                       
  [clojure_lsp.handlers$refactor invoke handlers.clj 308]                             
  [clojure.lang.Var invoke Var.java 403]
  [clojure_lsp.main.LSPWorkspaceService$fn__13381 invoke main.clj 241]                
  [clojure.core$binding_conveyor_fn$fn__5476 invoke core.clj 2022]                    
  [clojure.lang.AFn call AFn.java 18]
  [java.util.concurrent.FutureTask run FutureTask.java 266]                           
  [java.util.concurrent.ThreadPoolExecutor runWorker ThreadPoolExecutor.java 1142]    
  [java.util.concurrent.ThreadPoolExecutor$Worker run ThreadPoolExecutor.java 617]    
  [java.lang.Thread run Thread.java 748]]}

In my vim config I have the call to the refactoring function defined like this

nnoremap <silent> <leader>lrif :call LanguageClient#workspace_executeCommand('extract-function', [Expand('%:p'), line('.') - 1, col('.') - 1, input('Function name: '), ''])<CR>

`clojure.spec.alpha/fdef` unknown symbol

You can fdef a function before you defn it. In this case, the fdef symbol is marked unknown. I don't think this can be solved with macro-defs? Ideally the fdef would be marked unused if the function is never defined.

boot project support

Should be able to get the classpath from boot using boot show --fake-classpath

Consider indexing runtime specific symbols based on compiler version

I'm thinking now that a set of symbols can be different across compiler versions, while the core vars are staying the same, there are also might be additions over time. Not that it's really important, but might be useful. Although this would be not as trivial task as including symbols directly into sources.

Windows release support

Thanks to @sparkofreason for trying clojure-lsp in windows:

  1. At first glance, it looks like there are at least a few places that ought to use path joins instead of str and "/"
    https://github.com/snoe/clojure-lsp/blob/e1d892a13ef23f130009e0058bbdd0157d885d0e/src/clojure_lsp/handlers.clj#L26
    https://github.com/snoe/clojure-lsp/blob/e1d892a13ef23f130009e0058bbdd0157d885d0e/src/clojure_lsp/handlers.clj#L146

  2. Does the classpath lookup using shell/sh work in windows? I'm splitting the result with path.separator so maybe that's correct (iirc windows puts : vs ; to separate classpath).

  3. My understanding is that the org.xerial/sqlite-jdbc jar provides sqlite but that needs to be confirmed or else installed separately.

  4. @sparkofreason says:

Took a bit of hacking, but I got something to happen with clojure-lsp on windows. I updated to https://github.com/BrunoBonacci/lein-binplus, and had to rename the output with a .bat extension.

We should switch the bin generation and produce these files in CI.

Cursive style "resolve macros as"?

Hi,

I have been tinkering with clojure-lsp for a few days and it seems like a massive improvement over my current workflow (either using vim-fireplace or acid.nvim), but from time to time I find myself editing my local clone of this repo to add handlers for some macros we use on our projects, like prismatic schema's s/defn, pedestal's defhandler, midje's facts and so on.

I noticed you mentioned in the readme that this could be done via languageserver's client configuration and since I'm considering to give it a try on my spare time and implement it, I'd like to hear what are your thoughts/plans on this?

From what I have seen so far, LanguageClient-neovim already implements the client configuration per project (via .vim/settings.json in the project root), so it is only a matter of implementing it the server too.

My idea so far is:

  • Make the server able to read from this config
  • Update the parser to also use the symbol->handler map from config
  • Extra: have a global configuration for things that are shared across projects (i.e. libraries, so the project settings would be its own macros).

Also, I have not tried using macroexpand to resolve macros yet, but I suppose that could also be something cool to have, for example:

user=> (defmacro deff [f x body] `(defn ~f [~@x] ~body))
#'user/deff
user=> (first (macroexpand-1 '(deff twice [x] (* 2 x))))
clojure.core/defn

Have the github released version be the same as version output

Should probably persist the version on each build

VERSION=$(date -u +"%Y%m%dT%H%M%S")
echo $VERSION>version
sed -i "s/^.defproject clojure-lsp \".*\"$/\(defproject clojure-lsp \"$VERSION\"/" project.clj

Then have the release script and ci job look at that artifact instead of the tag date.

Vim guide?

Hey hi!

I've been trying to use clojure-lsp with neovim via LanguageClient-neovim without success.

I've downloaded the standalone binary from the latest release and also i tried to clone and build the binary myself but i cannot get any completions. I had other languages with their own LSP working.

Thank you!!

`:refer :all` doesn't seem to work

I use Specter and CamelSnakeKebab, which I routinely :refer :all. Don't judge me. Clojure-lsp doesn't seem to register the symbols from these so I get a lot of Unknown symbol.

EG (transform [ALL :dir] #(...) foo) says ALL is unknown. MAP-KEYS and MAP-VALS also unknown. It seems OK with transform though? ->SCREAMING_SNAKE_CASE from CSK is also unknown.

Some of the symbols are available to autocomplete but that's probably because they're elsewhere in the file already.

Support JavaSript interop in ClojureScript

From http://cljs.info/cheatsheet/ JavaScript interop section

Operation code
Create Object #js {} js-obj
Create Array #js [] array make-array aclone
Get Property (.-innerHTML el)
Using cljs-oops library:
(oget el "innerHTML")
Set Property (set! (.-innerHTML el) "Hi!")
Using cljs-oops library:
(oset! el "innerHTML" "Hi!")
Delete Property js-delete
Convert Between clj->js js->clj
Type Tests array? fn? number? object? string?
Exceptions try catch finally throw
External Library (js/alert "Hello world!")
(js/console.log my-obj)
(.html (js/jQuery "#myDiv") "Hi!")

Please make this work with popular editors

Hi!

I have a fear that LSP will become the de-facto standard for all languages, and Clojure/nREPL/CIDER will become an eccentric oddball - like lisp machines of yore.

I see this works with vim etc, but if it could work with popular editors like sublime/atom/vs code/etc. out of the box, it will be a great help to get more people onboard for Cojure.

I just tried sublime, and it said LSP doesn't support Clojure 😞, when it supports several niche languages out of the box.

I tried defining a custom client for it, and that didn't work either. 😞

Please let me know how I can be of help.

Help me, Obi Wan Kenobi, you're my only hope...

Fail to update brew formula

I wrote MR - https://github.com/Homebrew/homebrew-core/pull/43293/files
But fail to test on ci.

When I install a formula like that, It is works.

$ brew install Formula/clojure-lsp.rb
==> Downloading https://homebrew.bintray.com/bottles/clojure-lsp-20190614T052638.mojave.bottle.tar.gz

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "clojure-lsp"
Download failed: https://homebrew.bintray.com/bottles/clojure-lsp-20190614T052638.mojave.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading https://github.com/snoe/clojure-lsp/archive/release-20190614T052638.tar.gz
Already downloaded: /Users/pyoung/Library/Caches/Homebrew/downloads/98e88c32d18bc736fb67444007623dde96b17ae0145e4060d2a0c8444fb3eca3--clojure-lsp-release-20190614T052638.tar.gz
==> lein uberjar
🍺  /usr/local/Cellar/clojure-lsp/20190614T052638: 6 files, 30.8MB, built in 23 seconds

but when I try like that, I got a exception like CI.

$ wget https://github.com/snoe/clojure-lsp/archive/release-20190614T052638.tar.gz
$ tar zxvf release-20190614T052638.tar.gz
$ cd clojure-lsp-release-20190614T052638
$ lein uberjar
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
Retrieving com/jakemccrary/lein-test-refresh/0.23.0/lein-test-refresh-0.23.0.pom from clojars
Retrieving jakemcc/clojure-gntp/0.1.1/clojure-gntp-0.1.1.pom from clojars
Retrieving lein-binplus/lein-binplus/0.6.5/lein-binplus-0.6.5.pom from clojars
Retrieving de/ubercode/clostache/clostache/1.4.0/clostache-1.4.0.pom from clojars
Retrieving org/clojure/core.incubator/0.1.2/core.incubator-0.1.2.pom from central
Retrieving clj-zip-meta/clj-zip-meta/0.1.3/clj-zip-meta-0.1.3.pom from clojars
Retrieving funcool/octet/1.1.2/octet-1.1.2.pom from clojars
Retrieving io/netty/netty-buffer/4.1.30.Final/netty-buffer-4.1.30.Final.pom from central
Retrieving io/netty/netty-parent/4.1.30.Final/netty-parent-4.1.30.Final.pom from central
Retrieving io/netty/netty-common/4.1.30.Final/netty-common-4.1.30.Final.pom from central
Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.jar from central
Retrieving org/clojure/core.incubator/0.1.2/core.incubator-0.1.2.jar from central
Retrieving io/netty/netty-common/4.1.30.Final/netty-common-4.1.30.Final.jar from central
Retrieving io/netty/netty-buffer/4.1.30.Final/netty-buffer-4.1.30.Final.jar from central
Retrieving com/jakemccrary/lein-test-refresh/0.23.0/lein-test-refresh-0.23.0.jar from clojars
Retrieving jakemcc/clojure-gntp/0.1.1/clojure-gntp-0.1.1.jar from clojars
Retrieving de/ubercode/clostache/clostache/1.4.0/clostache-1.4.0.jar from clojars
Retrieving clj-zip-meta/clj-zip-meta/0.1.3/clj-zip-meta-0.1.3.jar from clojars
Retrieving lein-binplus/lein-binplus/0.6.5/lein-binplus-0.6.5.jar from clojars
Retrieving funcool/octet/1.1.2/octet-1.1.2.jar from clojars
Retrieving funcool/clojure.jdbc/0.9.0/clojure.jdbc-0.9.0.pom from clojars
Retrieving com/taoensso/tufte/2.0.1/tufte-2.0.1.pom from clojars
Retrieving com/taoensso/encore/2.94.0/encore-2.94.0.pom from clojars
Retrieving org/clojure/tools.reader/1.2.1/tools.reader-1.2.1.pom from central
Retrieving org/eclipse/lsp4j/org.eclipse.lsp4j/0.4.0/org.eclipse.lsp4j-0.4.0.pom from central
Retrieving org/eclipse/lsp4j/org.eclipse.lsp4j.generator/0.4.0/org.eclipse.lsp4j.generator-0.4.0.pom from central
Retrieving org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.4.0/org.eclipse.lsp4j.jsonrpc-0.4.0.pom from central
Retrieving medley/medley/1.0.0/medley-1.0.0.pom from clojars
Retrieving trptcolin/versioneer/0.2.0/versioneer-0.2.0.pom from clojars
Retrieving org/eclipse/xtend/org.eclipse.xtend.lib/2.13.0/org.eclipse.xtend.lib-2.13.0.pom from central
Retrieving org/eclipse/xtext/org.eclipse.xtext.xbase.lib/2.13.0/org.eclipse.xtext.xbase.lib-2.13.0.pom from central
Retrieving org/eclipse/xtend/org.eclipse.xtend.lib.macro/2.13.0/org.eclipse.xtend.lib.macro-2.13.0.pom from central
Retrieving com/google/guava/guava/19.0/guava-19.0.pom from central
Retrieving com/google/guava/guava-parent/19.0/guava-parent-19.0.pom from central
Retrieving org/xerial/sqlite-jdbc/3.21.0.1/sqlite-jdbc-3.21.0.1.pom from central
Retrieving log4j/log4j/1.2.17/log4j-1.2.17.pom from central
Retrieving org/clojure/core.async/0.4.474/core.async-0.4.474.pom from central
Retrieving org/clojure/tools.analyzer.jvm/0.7.0/tools.analyzer.jvm-0.7.0.pom from central
Retrieving org/eclipse/lsp4j/org.eclipse.lsp4j.generator/0.4.0/org.eclipse.lsp4j.generator-0.4.0.jar from central
Retrieving org/eclipse/lsp4j/org.eclipse.lsp4j/0.4.0/org.eclipse.lsp4j-0.4.0.jar from central
Retrieving org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.4.0/org.eclipse.lsp4j.jsonrpc-0.4.0.jar from central
Retrieving org/eclipse/xtend/org.eclipse.xtend.lib/2.13.0/org.eclipse.xtend.lib-2.13.0.jar from central
Retrieving com/google/guava/guava/19.0/guava-19.0.jar from central
Retrieving org/xerial/sqlite-jdbc/3.21.0.1/sqlite-jdbc-3.21.0.1.jar from central
Retrieving log4j/log4j/1.2.17/log4j-1.2.17.jar from central
Retrieving org/eclipse/xtext/org.eclipse.xtext.xbase.lib/2.13.0/org.eclipse.xtext.xbase.lib-2.13.0.jar from central
Retrieving org/eclipse/xtend/org.eclipse.xtend.lib.macro/2.13.0/org.eclipse.xtend.lib.macro-2.13.0.jar from central
Retrieving org/clojure/core.async/0.4.474/core.async-0.4.474.jar from central
Retrieving org/clojure/tools.analyzer.jvm/0.7.0/tools.analyzer.jvm-0.7.0.jar from central
Retrieving com/taoensso/encore/2.94.0/encore-2.94.0.jar from clojars
Retrieving medley/medley/1.0.0/medley-1.0.0.jar from clojars
Retrieving trptcolin/versioneer/0.2.0/versioneer-0.2.0.jar from clojars
Retrieving com/taoensso/tufte/2.0.1/tufte-2.0.1.jar from clojars
Retrieving funcool/clojure.jdbc/0.9.0/clojure.jdbc-0.9.0.jar from clojars
Compiling 1 source files to /Users/pyoung/remove-it/clojure-lsp-release-20190614T052638/target/classes
Compiling clojure-lsp.clojure-core
Compiling clojure-lsp.crawler
Compiling clojure-lsp.db
Compiling clojure-lsp.handlers
java.lang.SecurityException: class "org.eclipse.lsp4j.TextDocumentIdentifier"'s signer information does not match signer information of other classes in the same package, compiling:(interop.clj:1:1)
Exception in thread "main" java.lang.SecurityException: class "org.eclipse.lsp4j.TextDocumentIdentifier"'s signer information does not match signer information of other classes in the same package, compiling:(interop.clj:1:1)
	at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3700)
	at clojure.lang.Compiler.compile1(Compiler.java:7609)
	at clojure.lang.Compiler.compile1(Compiler.java:7599)
	at clojure.lang.Compiler.compile(Compiler.java:7676)
	at clojure.lang.RT.compile(RT.java:413)
	at clojure.lang.RT.load(RT.java:458)
	at clojure.lang.RT.load(RT.java:426)
	at clojure.core$load$fn__6548.invoke(core.clj:6046)
	at clojure.core$load.invokeStatic(core.clj:6045)
	at clojure.core$load.doInvoke(core.clj:6029)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5848)
	at clojure.core$load_one.invoke(core.clj:5843)
	at clojure.core$load_lib$fn__6493.invoke(core.clj:5888)
	at clojure.core$load_lib.invokeStatic(core.clj:5887)
	at clojure.core$load_lib.doInvoke(core.clj:5868)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:659)
	at clojure.core$load_libs.invokeStatic(core.clj:5925)
	at clojure.core$load_libs.doInvoke(core.clj:5909)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:659)
	at clojure.core$require.invokeStatic(core.clj:5947)
	at clojure.core$require.doInvoke(core.clj:5947)
	at clojure.lang.RestFn.invoke(RestFn.java:1789)
	at clojure_lsp.handlers$loading__6434__auto____11105.invoke(handlers.clj:1)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3695)
	at clojure.lang.Compiler.compile1(Compiler.java:7609)
	at clojure.lang.Compiler.compile1(Compiler.java:7599)
	at clojure.lang.Compiler.compile(Compiler.java:7676)
	at clojure.lang.RT.compile(RT.java:413)
	at clojure.lang.RT.load(RT.java:458)
	at clojure.lang.RT.load(RT.java:426)
	at clojure.core$load$fn__6548.invoke(core.clj:6046)
	at clojure.core$load.invokeStatic(core.clj:6045)
	at clojure.core$load.doInvoke(core.clj:6029)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5848)
	at clojure.core$compile$fn__6553.invoke(core.clj:6056)
	at clojure.core$compile.invokeStatic(core.clj:6056)
	at clojure.core$compile.invoke(core.clj:6048)
	at user$eval164$fn__173.invoke(form-init7040245282839369539.clj:1)
	at user$eval164.invokeStatic(form-init7040245282839369539.clj:1)
	at user$eval164.invoke(form-init7040245282839369539.clj:1)
	at clojure.lang.Compiler.eval(Compiler.java:7062)
	at clojure.lang.Compiler.eval(Compiler.java:7052)
	at clojure.lang.Compiler.eval(Compiler.java:7052)
	at clojure.lang.Compiler.load(Compiler.java:7514)
	at clojure.lang.Compiler.loadFile(Compiler.java:7452)
	at clojure.main$load_script.invokeStatic(main.clj:278)
	at clojure.main$init_opt.invokeStatic(main.clj:280)
	at clojure.main$init_opt.invoke(main.clj:280)
	at clojure.main$initialize.invokeStatic(main.clj:311)
	at clojure.main$null_opt.invokeStatic(main.clj:345)
	at clojure.main$null_opt.invoke(main.clj:342)
	at clojure.main$main.invokeStatic(main.clj:424)
	at clojure.main$main.doInvoke(main.clj:387)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:702)
	at clojure.main.main(main.java:37)
Caused by: java.lang.SecurityException: class "org.eclipse.lsp4j.TextDocumentIdentifier"'s signer information does not match signer information of other classes in the same package
	at java.base/java.lang.ClassLoader.checkCerts(ClassLoader.java:1155)
	at java.base/java.lang.ClassLoader.preDefineClass(ClassLoader.java:910)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1019)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:823)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:721)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:644)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1021)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:823)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:721)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:644)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:580)
	at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:580)
	at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:580)
	at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:580)
	at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:580)
	at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:580)
	at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:580)
	at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:580)
	at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:416)
	at clojure.lang.RT.classForName(RT.java:2204)
	at clojure.lang.RT.classForNameNonLoading(RT.java:2217)
	at clojure_lsp.interop$loading__6434__auto____11649.invoke(interop.clj:1)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3695)
	... 61 more
Compilation failed: Subprocess failed

Error renaming with coc.vim

I'm receiving a

[coc.nvim] Error on applyEdits: Error: Create document XXXXXXXXXXXXXXXXXXXX timeout after 1s.

error trying to rename
Is that a clojure-lsp bug or coc.vim?

Trying to run clojure-lsp results in nothing

Hello! When trying to run clojure-lsp, either the released version or by cloning the repo and running lein run nothing seems to happen. In the case of lein it downloads the dependencies, then it's just stuck.

... $ lein run
<blank line here>

I'm on OSX High Sierra.

diagnostics in (comment ...)

Hello,

Great tool! I really like the real-time diagnostics. Though have one issue using (comment ...) for repl driven development, diagnostics errors clutter quickfix list too much while code are in flux there (strict diagnostics seems less useful as they are evaled in repl frequently anyway). I'm wondering whether diagnostics can be disabled, at the same time still have all other features available in (comment ...) section.

Thanks!

VSCode - how to configure project-root and src-paths?

First, thanks so much for all the work on this lsp server. I have the VSCode client running and starting the server just fine, but I can't see where to set the project-root and src-paths. I tried this in the extensions.ts file

let serverOptions = { run: { command: "clojure-lsp.dms", initializationOptions: { "source-paths": ["cljsrc"], "project-root": "/Users/scott/Projects/Clojure" } }

I am trying to have a Workspace that points to that "Clojure" folder. In that folder are some Deps projects that all have a source folder named "cljsrc". I would want all those cljsrc folder to be indexed. Any help would be very much appreciated.

thanks

Running clojure-lsp in command line.

Hi,

I am very new to the Clojure world. When trying to follow the install instructions, I am kinda lost. I have downloaded the clojure-lsp package, and unzipped it. But I can't find any executable for clojure-lsp.

What I am trying to do is to try to start the server from command line, then call it from another process after I've had success.

Could you please provide more detail on how to start the server?

Thanks!

Definitions behind macros

Hi! Thanks for the awesome project; I've just hooked clojure-lsp up with coc.nvim and I'm excited to see some things working. One issue I've noticed is that I can jump to the definition or find the references to a defn, but not a defn which was generated by a macro such as defn-spec (docs for defn-spec).

What's needed to support this?

Support boot file different from build.boot

With boot you can specify the name of the boot file via the BOOT_FILE env variable. Right now clojure-lsp only suports boot projects where the build file is named build.boot.

Bump lsp4j dependency version

I'm trying to use your language server, but I'm running into an issue where all the jsonrpc ID's for the responses sent to my client's requests are strings even if I sent an integer.

For example, if I sent a request with {"id": 1}, I'd get a response back with {"id": "1"}. This is a specification violation that prevents my client from being able to match that response back to its request.

I dug into this, and it seems like this has been fixed in the lsp4j library: eclipse-lsp4j/lsp4j#155

However, the 0.3.0 version that you are using for lsp4j wouldn't include this fix. The 0.3.1 version that they just released should though. Could you try bumping the version that you use in this project?

Better jump to definition in jarfiles.

Currently when trying to get the definition of something defined in a jar file we return a pseudo uri for zipfiles that vim understands but no one else does.

zipfile:///Users/case/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar::clojure/core.clj

Let's figure out what servers do for java and see if we can use that instead. (They might use a jdt protocol uri). Most clients I've seen have special handling for something in the java lsp server which I think is related to this problem.

neoclide/coc.nvim#652

Starting lsp server from REPL throws

Starting server from REPL errors with CompilerException java.lang.SecurityException: class "org.eclipse.lsp4j.TextDocumentIdentifier"'s signer information does not match signer information of other classes in the same package, compiling:(clojure_lsp/interop.clj:1:1), not sure how to solve this, but really want to be able to play with the project from REPL. Looking forward to contribute.

better-cond :let not supported

This is pretty understandable but... better-cond supports sub-lets:

(cond
  :let [a 1]
  a (prn "hi"))

It'd be nice to support this. Unfortunately I think there are a few libraries like this. I guess this is what the macro-defs thing is for? It's hard to see how to configure that though, the link to examples didn't help me much. Granted I didn't spend very long on it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.