Myriad-Dreamin / tinymist

Tinymist [ˈtaɪni mɪst] is an integrated language service for Typst [taɪpst].
https://myriad-dreamin.github.io/tinymist
Apache License 2.0
853 stars 35 forks source link

clicking on the preview jumps to module source code #581

Open lublak opened 3 months ago

lublak commented 3 months ago

Motivation

Jump to use of the module and not the module source code.

Description

I don't know whether it's a bug or a feature request. In general, the element is also placed in the module. But I think it would make more sense to jump to where I have placed the module.

Examples/Questions

Example:

#import "@preview/tiaoma:0.2.0"

#tiaoma.c25-inter(
  "123",
  options:(
    height: 15.0,
  )
)

Package/Software version:

VSCode version(Help -> About):

Version: 1.92.2 (system setup)
Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9
Date: 2024-08-14T17:29:30.058Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.19045

tinymist extension version: v0.11.0. Get it by tinymist --version in terminal.

tinymist 
Build Timestamp:     2024-08-26T16:23:08.361428700Z
Build Git Describe:  v0.11.20
Commit SHA:          1f9a42c2e863f6b1fe8624da796e47adf44a9a83
Commit Date:         None
Commit Branch:       None
Cargo Target Triple: x86_64-pc-windows-msvc
Typst Version:       0.11.1
Myriad-Dreamin commented 3 months ago

This is a feature, and I copy the hints for you which will fit in cases of improving experience of jumping from preview panel to source panel:

Note: Jumping to source location of the outline item doesn't work well if its body doesn't have source location, e.g.
```typ
#let my-heading(h) = heading(h) // will jump to here
#my-heading("Title") // will not jump to here
```.
Hence, you may want to use `my-heading[Title]` instead to gain better experience of outline jumping.
singularitti commented 3 weeks ago

Please correct me if I'm mistaken, but I recall that in older versions (though I don't remember the exact one), clicking on the preview window allowed me to jump directly to my source code. However, in recent versions, this functionality seems to be missing. Has this behavior changed, or am I perhaps using it incorrectly?