This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-15
Channels
- # announcements (8)
- # asami (10)
- # babashka (16)
- # beginners (86)
- # calva (22)
- # chlorine-clover (9)
- # circleci (20)
- # clj-kondo (13)
- # cljs-dev (20)
- # cljsrn (3)
- # clojure (144)
- # clojure-australia (10)
- # clojure-europe (126)
- # clojure-italy (5)
- # clojure-nl (8)
- # clojure-norway (4)
- # clojure-serbia (9)
- # clojure-uk (7)
- # clojurescript (14)
- # cursive (20)
- # data-science (1)
- # datomic (20)
- # figwheel-main (5)
- # fulcro (23)
- # graalvm (7)
- # graphql (25)
- # honeysql (15)
- # hugsql (3)
- # jobs (2)
- # lambdaisland (2)
- # leiningen (4)
- # lsp (102)
- # malli (3)
- # off-topic (51)
- # overtone (5)
- # pathom (27)
- # portal (11)
- # quil (1)
- # re-frame (19)
- # reagent (31)
- # remote-jobs (1)
- # reveal (3)
- # rewrite-clj (56)
- # shadow-cljs (45)
- # startup-in-a-month (1)
- # tools-deps (9)
Hello, Calva friends! I've been doing Clojure development using Calva on and off for about a year now and have never run across this issue. I'm using clj-time to work with dates/times. When I spin up a REPL by jacking-in, when using the clj-time.local namespace to get local-now, I am getting a date the represents the UTC time zone instead of my local time zone. Is this a REPL problem? A PBCK problem? Thank you for any information!!!! I'm using Remote development to an Unbuntu WSL instance.
@brian.smith I’m one of the maintainers of clj-time
and I’d recommend not using it, but using the built-in Java Time via interop or one of the Java Time wrappers listed in clj-time
’s README.
Although it can be confusing, clj-time
always works in UTC under the hood, with timezones overlaid. You can see how clj-time.local
works in this REPL session:
(! 747)-> clj -Sdeps '{:deps {clj-time/clj-time {:mvn/version "RELEASE"}}}'
Clojure 1.10.3
user=> (require '[clj-time.core :as tc] '[clj-time.local :as tl])
nil
user=> (tc/now)
#clj-time/date-time "2021-03-15T17:56:12.966Z"
user=> (tl/format-local-time *1 :rfc822)
"Mon, 15 Mar 2021 17:56:12 -0700"
user=> (tl/local-now)
#clj-time/date-time "2021-03-15T17:56:24.970Z"
user=> (tl/format-local-time *1 :rfc822)
"Mon, 15 Mar 2021 10:56:24 -0700"
user=>
Although (tc/now)
and (tl/local-now)
display identically in the REPL, the former is pure UTC while the latter has the default timezone encoded. You can see that when they are both formatted as local date/time: the former produces a UTC date/time string but the latter produces a local (to me: Pacific time, West Coast USA) date/time string. Even though the REPL displays them identically.I thought I was going insane for a minute. Thank you for responding. All I've been attempting to do is to find the number of hours difference between two date-times...
Date/time stuff is hard and timezones doubly so.
Hi @brian.smith, happy to hear from you! Pretty sure it is not to do with the tooling. If you do some regular println testing with lein run
(or equivalent), you should be able to confirm wether that is the case or not.
I know I get all dizzy trying to figure timezone things out. Having struggled with that a lot in my work project recently. 😃
Thanks @pez, I appreciate you responding. I am sure it isn't a problem with the tooling, just my understanding of it.
@brandon.ringe, about https://github.com/BetterThanTomorrow/calva/pull/981 clojure-lsp now has a way to disable all lints (clj-kondo and clojure-lsp new lint) https://clojure-lsp.github.io/clojure-lsp/settings/#diagnostics-linter 🙂
Although it can be confusing, clj-time
always works in UTC under the hood, with timezones overlaid. You can see how clj-time.local
works in this REPL session:
(! 747)-> clj -Sdeps '{:deps {clj-time/clj-time {:mvn/version "RELEASE"}}}'
Clojure 1.10.3
user=> (require '[clj-time.core :as tc] '[clj-time.local :as tl])
nil
user=> (tc/now)
#clj-time/date-time "2021-03-15T17:56:12.966Z"
user=> (tl/format-local-time *1 :rfc822)
"Mon, 15 Mar 2021 17:56:12 -0700"
user=> (tl/local-now)
#clj-time/date-time "2021-03-15T17:56:24.970Z"
user=> (tl/format-local-time *1 :rfc822)
"Mon, 15 Mar 2021 10:56:24 -0700"
user=>
Although (tc/now)
and (tl/local-now)
display identically in the REPL, the former is pure UTC while the latter has the default timezone encoded. You can see that when they are both formatted as local date/time: the former produces a UTC date/time string but the latter produces a local (to me: Pacific time, West Coast USA) date/time string. Even though the REPL displays them identically.I’m exploring calva, and trying out some clojure-lsp features. Calls: Show Call Hierarchy
doesn’t work for me. Should it?
But when I execute Go to Definition
when I am already on the function definition, I do get a popup which shows call references.
I'm not sure if that's implemented in clojure-lsp yet. @UKFSJSM38 could tell us more.
Oh, I see it in the clojure-lsp docs now. I see a fix related to the call hierarchy feature was released in a later version than what Calva uses currently. I'm not sure though if it should be working to some extent right now.
Eric, when I run the call hierarchy command in VS Code, I see in the logs that the textDocument/codeLens and codeLens/resolve requests are made, but that's it. Should something else be happening?
@brandon.ringe it should call textDocument/prepareCallHierarchy and callHierarchy/incoming if I recall correctly
Hmm, okay. I'll create a ticket to track this, since it seems to not work correctly atm.