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

In .vue file use "@" alias for "src", Command + Click can not work #728

Closed
LYY opened this issue Nov 24, 2021 · 5 comments
Closed

In .vue file use "@" alias for "src", Command + Click can not work #728

LYY opened this issue Nov 24, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@LYY
Copy link

LYY commented Nov 24, 2021

I have configured "@" alias for "src", in src dir contains 2 files:

src/components/HelloWorld.vue
src/App.vue

# App.vue
<script setup lang="ts">
  import HelloWorld from '@/components/HelloWorld.vue'
</script>

Command + click can not jump to HelloWorld.vue.

tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "useDefineForClassFields": true,
    "module": "esnext",
    "moduleResolution": "node",
    "strict": true,
    "jsx": "preserve",
    "sourceMap": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "lib": ["esnext", "dom"],
    "types": ["vite/client"],
    "isolatedModules": true,
    "skipLibCheck": true,
    "outDir": "dist",
    "declaration": true,
    "declarationMap": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"]
    }
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.d.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "*.ts"
  ],
  "exclude": ["node_modules", ".vscode", "public", "*.js"]
}

vite.config.ts

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src'),
    },
  },
  plugins: [vue(), vueJsx()],
})

vscode about

版本: 1.62.3
提交: ccbaa2d27e38e5afa3e5c21c1c7bef4657064247
日期: 2021-11-17T07:59:13.865Z
Electron: 13.5.2
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.5.0

volar version
v0.29.6

@yukecs
Copy link

yukecs commented Nov 26, 2021

me too

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Nov 28, 2021
vikunja-bot pushed a commit to go-vikunja/frontend that referenced this issue Nov 28, 2021
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [vue-tsc](https://github.com/johnsoncodehk/volar) | devDependencies | patch | [`0.29.6` -> `0.29.7`](https://renovatebot.com/diffs/npm/vue-tsc/0.29.6/0.29.7) |

---

### Release Notes

<details>
<summary>johnsoncodehk/volar</summary>

### [`v0.29.7`](https://github.com/johnsoncodehk/volar/blob/master/CHANGELOG.md#&#8203;0297)

[Compare Source](vuejs/language-tools@v0.29.6...v0.29.7)

-   feat: support html, css custom data ([#&#8203;707](vuejs/language-tools#707))
-   feat: support extends tsconfig `vueCompilerOptions` ([#&#8203;731](vuejs/language-tools#731))
-   fix: cannot config project reference by directory path ([#&#8203;712](vuejs/language-tools#712))
-   fix: pug attrs type-check borken by nested tags ([#&#8203;721](vuejs/language-tools#721))
-   fix: import path rename result incorrect ([#&#8203;723](vuejs/language-tools#723))
-   fix: `editor.codeActionsOnSave: ["source.organizeImports"]` not working ([#&#8203;726](vuejs/language-tools#726))
-   fix: goto definition not working with some component import statement ([#&#8203;728](vuejs/language-tools#728))
-   fix: don't show volar commands in non-vue document ([#&#8203;733](vuejs/language-tools#733))
-   fix: vue-tsc not working with symlink ([#&#8203;738](vuejs/language-tools#738))

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1106
Reviewed-by: dpschen <dpschen@noreply.kolaente.de>
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
@BTBMan
Copy link

BTBMan commented Mar 10, 2022

if import .vue file use alias path in ts file, it's not goto definition when the .vue file has code <script setup lang="ts"></script>

图片

it works!!!
图片

it's not work with script tag
图片

@BTBMan
Copy link

BTBMan commented Mar 10, 2022

@johnsoncodehk

@BTBMan
Copy link

BTBMan commented Mar 10, 2022

it works when use take over mode!!!

@johnsoncodehk
Copy link
Member

@BTBMan this is a bug with TS plugin, see #435.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants