marcomorain / clojure-lint

GNU General Public License v3.0
18 stars 2 forks source link

Crash on certain input #8

Closed PEZ closed 5 years ago

PEZ commented 5 years ago

Hello, sorry for sloppy error report, I'm in a hurry. Anyway, this text causes the extension to throw an error:

;; Clojure Warrior

(())
(((((((((((((((((((())))))))))))))))))))
[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]
{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}
((()))[[[]]]
([{}])
()
[]
{}

("--)--")
("--)--
--)--")
();;---)

(\)\()
("--\"--)--")
;; ((()))
;; ())) "a[{(]})bc"
;; \
"()"
;; \
;; 
(((((())))))
([ { }()[]])

(
    #()
    #{}
    #?()
    #?@()
    #_())

(comment
  (comment (foo bar)))
(defn foo
  (let [x "y"]
    {:foo "bar"
     :bar (comment (fn [x]
                     (let [foo :bar])
                     (str foo)))
     :baz x}))
(comment
  (foo 2)
  (Math/abs -1)
  (range 10)
  (println "I ❤️Clojure")
  ([{} () []]))
[comment]
(foo) comment (bar)
"(comment foo)"
foo(comment)bar
(def contains-comment (go-fish))
( comment)
(
 comment "[foo]")
(comment
  (Math/abs -1)
  (range 10)
  (println "I ❤️Clojure")
  ([{} () []]))
( comment
  foo)
(comment foo (comment bar))
(foo (comment ({["(comment)"]})) ([{"(comment)"}]))

#_foo bar
#_ foo bar
#_,foo,bar
#_
foo bar
#_
foo
bar

#_#_(1) (2 2)

#_
#_
#_

1

2

3
4

#_
#_
2
(1 (1))
3

#_
#_
#_
1
(2 (2))
(3 4)
4

#_#_#_ (1) 2 (3 4) (4) 5

#_#_#_ (1) (2) (3 4) (4) 5

#_ (1)2(3) (4)

#_1(2)

(let [#_#_x (get c :x "x")
      #_#_y (get c :y "y")
      #_#_z (get c :z "z")])

#_(:bar [#{foo}])
([{#_"foo"}])
[:a
 #_
 [:b
  [:c {:d :e}]]
 [:b
  [:c {:d :e}]]]
(comment 
  (foo #_"bar" baz))
#_{:foo "foo"
   :bar (comment [["bar"]])}
#_^{:foo foo} ^{:foo foo}
#_@foo @foo
#_@(foo bar)  @(foo bar)
#_'(foo bar) '(foo bar)
#_`(foo bar) `(foo bar)
#_~(foo bar) ~(foo bar)
#_'foo 'foo
#_#foo #foo
#_@foo @foo
#_~foo ~foo
#_#"foo\sbar" #"foo\sbar"

(Don't ask :smile:)

The error:

An unexpected error occured when running clj-kondo. Please report a bug
to https://github.com/marcomorain/clojure-lint/issues
Error: Illegal argument: line must be non-negative
    at Object.t.illegalArgument (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:13:195)
    at new g (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:350:768)
    at new g (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:350:44)
    at new m (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:352:609)
    at new m (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:350:44)
    at range (/Users/pez/.vscode/extensions/marcomorain.clojure-lint-0.4.0/out/extension.js:59:12)
    at toDiagnostic (/Users/pez/.vscode/extensions/marcomorain.clojure-lint-0.4.0/out/extension.js:65:16)
    at Array.map (<anonymous>)
    at lint (/Users/pez/.vscode/extensions/marcomorain.clojure-lint-0.4.0/out/extension.js:91:55)
    at child_process_1.execFile (/Users/pez/.vscode/extensions/marcomorain.clojure-lint-0.4.0/out/extension.js:38:24)
    at ChildProcess.exithandler (child_process.js:306:5)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
marcomorain commented 5 years ago

@PEZ I have a fix ready for this, but Azure DevOps won't allow me to access my extension. I have a support ticket open with them 🙄

PEZ commented 5 years ago

Been there! Always scared that they will lock me out again.

marcomorain commented 5 years ago

Fixed in 0.5.0