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

Inlay hint display for juxtaposition and infix operators #532

Closed
jariji opened this issue Jan 10, 2024 · 4 comments
Closed

Inlay hint display for juxtaposition and infix operators #532

jariji opened this issue Jan 10, 2024 · 4 comments

Comments

@jariji
Copy link

jariji commented Jan 10, 2024

The inlay hints look a bit odd for juxtaposition and infix operators. I don't know if there's a standard way to display these in other languages that have inlay hints, so I don't have a solution, just pointing out the issue for discussion.

For juxtaposition, it just juxtaposes the hints:

f(x) = 2x

@descend f(3.0)

image

and for infix operations it puts the hint on the operator:

f(x) = 2*x

@descend f(3.0)

image

(jl_ObndQM) pkg> st
Status `/tmp/jl_ObndQM/Project.toml`
  [f68482b8] Cthulhu v2.10.0

julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 24 × AMD Ryzen 9 3900XT 12-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver2)
  Threads: 35 on 24 virtual cores
Environment:
  JULIA_NUM_THREADS = 24
  JULIA_PKG_PRESERVE_TIERED_INSTALLED = true
  LD_LIBRARY_PATH = :/lib
  JULIA_EDITOR = code

VSCode Julia 1.65.2
VSCode 1.84.2
Linux 6.6.8
@Zentrik
Copy link
Collaborator

Zentrik commented Jan 10, 2024

The inlay hints are supposed to just replicate what Cthulhu prints in the REPL. Do they print differently in the REPL? Otherwise this is a more general problem.

@jariji
Copy link
Author

jariji commented Jan 10, 2024

Looks different:

julia> f(x) = 2x
f (generic function with 1 method)

julia> @descend f(3.0)
f(x) @ Main REPL[2]:1
1 f(x::Float64)::Float64 = 2x::Float64


julia> f(x) = 2*x
f (generic function with 1 method)

julia> @descend f(3.0)
f(x) @ Main REPL[4]:1
1 f(x::Float64)::Float64 = 2*x::Float64


(tmp.6EvBOOSOSW) pkg> st
Status `/tmp/tmp.6EvBOOSOSW/Project.toml`
  [f68482b8] Cthulhu v2.10.0

@Zentrik
Copy link
Collaborator

Zentrik commented Jan 11, 2024

I'm struggling to reproduce this, could you make sure you're on the latest version (1.2.4) of TypedSyntax. Also what are your Cthulhu settings, i.e. mine have warnings off, don't hide type-stable statements, etc.

julia> @descend f(3.0)
f(x) @ Main /media/rag/NVME/Code/Cthulhu.jl/tmp.jl:1
1 f(x::Float64)::Float64 = 2x::Float64
Select a call to descend into or  to ascend. [q]uit. [b]ookmark.
Toggles: [w]arn, [h]ide type-stable statements, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native, [j]ump to source always, [v]scode: inlay types, [V]scode: diagnostics.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
 • 2x::Float64
   

I'm on a slightly newer version of VSCode, 1.85.1, but I fail to see why that would make a difference.

@jariji
Copy link
Author

jariji commented Jan 11, 2024

Upgrading TypedSyntax 1.2.3 -> 1.2.4 solved it. Cheers.

image
image

@jariji jariji closed this as completed Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants