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

can it go to definition by clicking the import link #21

Closed
applemate opened this issue Aug 9, 2019 · 17 comments
Closed

can it go to definition by clicking the import link #21

applemate opened this issue Aug 9, 2019 · 17 comments

Comments

@applemate
Copy link

import './homeProduct.scss'

I want to go that scss file when I click go to definition. Is it possible ?

@pucelle
Copy link
Owner

pucelle commented Aug 14, 2019

Sorry to reply late, I'm on vocation these days.
Yes, it's possible, and seems there is no other plugin which handles css files imports.
I will implements this in next month, Thanks.

@applemate
Copy link
Author

Awesome, look forward to it

@pucelle
Copy link
Owner

pucelle commented Oct 13, 2019

Postpone to October.

@pucelle
Copy link
Owner

pucelle commented Nov 9, 2019

Sorry, I started my new career as a graphic algorithm engineer these days, I will keep working on this plugin after my hard time over.

@pucelle
Copy link
Owner

pucelle commented Dec 7, 2020

Just released v1.10.1, please check it, thanks.

@pucelle pucelle closed this as completed Dec 7, 2020
@applemate
Copy link
Author

how do you activate this feature?

@pucelle
Copy link
Owner

pucelle commented Feb 21, 2021

Automatically active, if not, please paste your code example.

@dwelle
Copy link

dwelle commented Feb 21, 2021

Yea, it doesn't work for me either:

import "./someFile.scss";

@pucelle
Copy link
Owner

pucelle commented Feb 21, 2021

Are you working in typescript codes? The import functionality only works in <link href="..."> or @import "...".

@applemate
Copy link
Author

I'm working basic react app, initiate with create-react-app.

components
    Home.js
    home.scss

Home.js

import React from 'react'
import './home.scss'
const Home = ({
}) => {
	<div>hello</div>
}

@applemate
Copy link
Author

applemate commented Feb 22, 2021

Automatically active, if not, please paste your code example.

https://github.com/craigcosmo/my-app

try open the app.scss with 'go to definition'

@dwelle
Copy link

dwelle commented Feb 22, 2021

Are you working in typescript codes? The import functionality only works in <link href="..."> or @import "...".

I see, I thought it works in js/ts as well according to OP :).

@pucelle
Copy link
Owner

pucelle commented Feb 22, 2021

You are right, can't open, I thought that vscode should automatically opening css files from a ts or js file when goto definition, but it doesn't!

I will support this in this weekend.

@pucelle pucelle reopened this Feb 22, 2021
@dwelle
Copy link

dwelle commented Feb 22, 2021

Thanks! In case you'll need to hardcode the extensions, let's enable it for js, jsx, ts, and tsx (maybe svelte and vue too?).

@edouard-lopez
Copy link

edouard-lopez commented Mar 12, 2021

You are right, can't open, I thought that vscode should automatically opening css files from a ts or js file when goto definition, but it doesn't!

I will support this in this weekend.

That's great news! ❤️

The following stackoverflow question is exactly on this topic, so many people will be pleased !

I also commented on microsoft/TypeScript#15146.

@pucelle
Copy link
Owner

pucelle commented Mar 14, 2021

I just released v1.10.5, this should works now, sorry I was trapped into an algorithm problem these days and fix this too late.
And also thanks for you patience.

Never mind to give more suggestions and feedback.

@dwelle
Copy link

dwelle commented Mar 14, 2021

Thank you! Works well.

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

4 participants