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

Go to definition #9

Open
kachurun opened this issue Nov 15, 2024 · 4 comments
Open

Go to definition #9

kachurun opened this issue Nov 15, 2024 · 4 comments
Assignees

Comments

@kachurun
Copy link

The imports don't support the "Go to Definition" or "Peek Definition" features:

    <script lang="ts">
        import { Observable } from '@common_src/lib';
        import type { Data, CurrencyItem, Plan } from '../typings';
...

So, you can't simply click on them or use a hotkey like CMD+B (in my setup)

@Kal-Aster
Copy link
Owner

The support for definitions was added in commit 52eba56 , are you sure you are using the latest version?
The imports work fine to me

@kachurun
Copy link
Author

I just rolled out a new version and it's still not working, my code is like:

<script lang="ts">
    import { dispatchEvent } from '@common_src/lib';
...

with compilerOptions:

...
        "baseUrl": ".",
        "paths": {
            "@/*": [ "./" ],
            "@common_src/*": [ "common_src/*" ],
        }

Imports like:

import { something } from 'riot';
import './component.riot';
import '../../abc.js'

not working as well.

It can detect external imports from package.json and provide autocompletion:

Screenshot 2024-11-25 at 13 10 40

It can even identify where the module is located (only for external modules):
Screenshot 2024-11-25 at 13 11 02
However, it still says "No definition found for hotkeys."

I've also tried using a clean VSCode installation without any plugins except this and Typescript. Maybe I need to adjust something in my project. How do you test it? Maybe you have a test project to verify everything?

@Kal-Aster Kal-Aster self-assigned this Nov 26, 2024
@Kal-Aster
Copy link
Owner

I checked and noticed that some definitions worked and others didn't.

The issue should be fixed now.
It still won't work for imports overwritten by "paths" config.

@Kal-Aster
Copy link
Owner

Kal-Aster commented Nov 26, 2024

How do you test it? Maybe you have a test project to verify everything?

I'm thinking about creating a small package both for testing and demonstration purposes.
It could be useful also as boilerplate for setting up riot apps.

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