Giter Site home page Giter Site logo

Comments (10)

sittim avatar sittim commented on July 20, 2024 1

OK, it now works, I added instructions on how to make it work with clj-kondo.

clj-kondo/clj-kondo#931

from coc-diagnostic.

iamcco avatar iamcco commented on July 20, 2024

If you use this extension, you should use below option instead.

  • "diagnostic-languageserver.linters": { "clj-kondo": {...} } for linters
  • "diagnostic-languageserver.filetypes": { "clj":"clj-kondo", ... } for enable linter for filetypes

from coc-diagnostic.

sittim avatar sittim commented on July 20, 2024

@iamcco, I tried as recommended:

{
    "diagnostic-languageserver.linters": {
        "clj-kondo": {
            "command": "clj-condo",
            "debounce": 100,
            "args": [ "--lint", "%filepath"],
            "offsetLine": 0,
            "offsetColumn": 0,
            "sourceName": "clj-kondo",
            "formatLines": 1,
            "formatPattern": [
                "^[^:]+:(\\d+):(\\d+):\\s+([^:]+):\\s+(.*)$",
                {
                    "line": 1,
                    "column": 2,
                    "message": 4,
                    "security": 3
                }
            ],
            "securities": {
                "error": "error",
                "warning": "warning",
                "note": "info"
            }
        }
    },
    "diagnostic-languageserver.filetypes": { "clj":"clj-kondo", "clojure":"clj-kondo"}
}

It still does not seem to show anything. Are there diagnostics that I can run?

from coc-diagnostic.

iamcco avatar iamcco commented on July 20, 2024

Set "diagnostic-languageserver.trace.server": "verbose" and checkout output channel

from coc-diagnostic.

sittim avatar sittim commented on July 20, 2024

I do get an error:

Error  - 12:41:37 PM] [clojure] diagnostic handle fail: [clj-kondo] spawn clj-condo ENOENT
[Trace - 12:41:37 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///home/sporty/clojure/bubbleuptop/src/bubbleuptop/bubbleuptop.clj",
    "diagnostics": []
}

Here is the full output:

dls_output.txt

from coc-diagnostic.

sittim avatar sittim commented on July 20, 2024

OK, does that mean my regex is wrong?

from coc-diagnostic.

iamcco avatar iamcco commented on July 20, 2024

Make sure command clj-condo is in your $Path environment.

from coc-diagnostic.

sittim avatar sittim commented on July 20, 2024

I checked and it is part of path:

[I] /home/sporty/clojure/bubbleuptop~> bash
sporty@vboxsporty:~/clojure/bubbleuptop$ clj-kondo --lint src/bubbleuptop/bubbleuptop.clj
src/bubbleuptop/bubbleuptop.clj:3:14: warning: namespace ring.middleware.reload is required but never used
src/bubbleuptop/bubbleuptop.clj:3:45: warning: #'ring.middleware.reload/wrap-reload is referred but never used
src/bubbleuptop/bubbleuptop.clj:7:16: warning: unused binding request
src/bubbleuptop/bubbleuptop.clj:14:6: warning: unused binding args
linting took 8ms, errors: 0, warnings: 4
sporty@vboxsporty:~/clojure/bubbleuptop$ which clj-kondo
/usr/local/bin/clj-kondo
sporty@vboxsporty:~/clojure/bubbleuptop$ echo $PATH
/home/sporty/.cargo/bin:/home/sporty/.local/bin:/home/sporty/.autojump/bin:/home/sporty/.local/bin:/home/sporty/go/bin:/usr/local/lib/nodejs/bin/:/home/sporty/.cargo/bin:/home/sporty/.local/bin:/home/sporty/.emacs.d/bin:/home/sporty/.vim/plugged/vim-iced/bin:/home/sporty/.yarn/bin:/home/sporty/.nix-profile/bin:/home/sporty/.cargo/bin:/home/sporty/.local/bin:/home/sporty/bin:/home/sporty/.nvm/versions/node/v14.2.0/bin:/home/sporty/.cargo/bin:/home/sporty/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/sporty/.fzf/bin

from coc-diagnostic.

iamcco avatar iamcco commented on July 20, 2024

So why you use clj-kondo in terminal and clj-condo in config?

from coc-diagnostic.

sittim avatar sittim commented on July 20, 2024

Gracious, that was the issue, thank you, it all now works.

from coc-diagnostic.

Related Issues (20)

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.