question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Imports to Components were inserted to random positions.

See original GitHub issue
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: Windows
  • Vetur version: 0.30.3
  • VS Code version: 1.51.1

Problem

When editing the template of a component with help from IntelliSense auto completion and typing the component name as a tag name, even if already declared, a new import is still generated, its contents being inserted to random positions in the script part of the Vue code.

component

Reproducible Case

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:12
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
gburningcommented, Apr 21, 2021

This happens for me as well. The project I’m writing in doesn’t use typescript either.

A few strange things happen:

  1. Auto-completing an already imported component causes it to add a duplicate import (this is the most frustrating part honestly).
  2. The inserted import statement and the component definition don’t respect the correct indentation (in this project everything inside <script> tags is indented 2 spaces minimum).
  3. Component definition is inserted randomly somewhere inside the <script>.
  4. No comma is added after the previous component definition.
2reactions
stefvw93commented, May 24, 2022

Any update on this? This bug is absolutely detrimental to developer experience and is still here in 0.35.0.

Sidenote, to me the “no repro case” label seems kind of dubious as this bug happens to me in literally every Vue 2 project where Vetur is active.

Schermafbeelding 2022-05-23 om 10 18 46 Schermafbeelding 2022-05-23 om 11 06 16 Schermafbeelding 2022-05-24 om 09 30 14
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python import: Advanced Techniques and Tips
In Python, you use the import keyword to make code in one module available in another. Imports in Python are important for structuring...
Read more >
Building a 10x10 array with elements placed in random ...
Hello, I'd like to build a numerosity discrimination task. In each trial, subjects are presented with an imaginary 10x10 array with 31 to...
Read more >
Imports - checkstyle
Rationale: Importing all classes from a package or static members from a class leads to tight coupling between packages or classes and might ......
Read more >
Importing assets - Unity - Manual
Unity automatically detects files as they are added to the Assets folder, or if they are modified. When you put any asset into...
Read more >
Create Random Points (Data Management)—ArcGIS Pro
Points will be randomly placed inside polygon features, along line features, or at point feature locations. Each feature in this feature class will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found