vscode-scss icon indicating copy to clipboard operation
vscode-scss copied to clipboard

Intellisense autocomplete issue in latest build

Open ekfuhrmann opened this issue 5 years ago • 27 comments

Originally posted here, but it seems like with the latest build of VScode (1.33.0), the autocomplete doesn't output correctly.

Steps to Reproduce:

  1. Place a Sass variable within the CSS
  2. Change the Sass variable name without removing the $ prefix
  3. Upon selecting the intellisense suggestion, it will autocomplete with an additional $.

inellisense-break

ekfuhrmann avatar Apr 05 '19 15:04 ekfuhrmann

I'm having the exact same issue—unfortunately had to disable the extension until this is fixed.

danielpost avatar May 24 '19 08:05 danielpost

Same issue here, seems only works first time and before that, all is double $.

FYI, I'm on MacOS Mojave.

cabans avatar May 27 '19 12:05 cabans

Running into this as well...

leoland avatar May 30 '19 13:05 leoland

As a temporary fix, I disabled this plugin which has resulted in the expected behavior. For those of you who rely on this plugin for other features, I have no helpful advice, but in my experience I haven't lost anything that native VScode doesn't now cover (including variable intellisense selection).

ekfuhrmann avatar May 30 '19 14:05 ekfuhrmann

The problem with this is that while it works for variables defined in the same file, if you do not have them, then you wont get intellisense for the name of the variables.

AlexandruDinulescu avatar Jun 20 '19 11:06 AlexandruDinulescu

I had a similar issue where it would add an extra $ for all of the variables. It didn't matter if it was the initial completion or any thereafter. And, it didn't matter whether the variable was in the same file or not. Since the developer hasn't replied in a while, I was able to resolve it by changing line 126 in "EXTENSION_DIRECTORY/mrmlnc.vscode-scss-0.6.2/out/providers/completion.js" from:

label: variable.name,

to:

label: variable.name.replace('$', ''),

I then reloaded VSCode and it seems to work fine now.

ahenriksen-inferno avatar Jul 06 '19 15:07 ahenriksen-inferno

@inferno-adam Great tip, thanks! To make it a bit more resilient, I would recommend using this line instead:

label: variable.name.replace('$$', '$'),

This way correct variable names won't lose the dollar sign unintentionally. Thanks for the find!

danielpost avatar Jul 06 '19 19:07 danielpost

@danielpost You’re welcome and thank you for making it even better!

ahenriksen-inferno avatar Jul 06 '19 20:07 ahenriksen-inferno

Since this still has not been fixed and the owner seems to have abandoned the repo, this plugin provides the same syntax highlight for styled components while getting rid of the conflicting language services.

ekfuhrmann avatar Aug 29 '19 14:08 ekfuhrmann

Since this still has not been fixed and the owner seems to have abandoned the repo, this plugin provides the same syntax highlight for styled components while getting rid of the conflicting language services.

Thank you @ekfuhrmann !

ahenriksen-inferno avatar Aug 29 '19 15:08 ahenriksen-inferno

@ekfuhrmann there seems to be two of those vscode-styled-component plugins... here's the other one that I found that looks more recent.

ahenriksen-inferno avatar Aug 29 '19 15:08 ahenriksen-inferno

Great, it's a shame that by far-and-away the most popular plugin for this is no longer supported, but at least there are other options!

ekfuhrmann avatar Aug 29 '19 15:08 ekfuhrmann

Hey! It's nice to see this project alive again and getting updates! @octref @mrmlnc

ahenriksen-inferno avatar Nov 19 '19 12:11 ahenriksen-inferno

The problem present in the latest version of the plugin? Right now I cannot reproduce this issue. Any suggestions how to I can reproduce the problem?

mrmlnc avatar Dec 01 '19 18:12 mrmlnc

@mrmlnc yes it is:

SCSS Intellisense Autocomplete Issue

ahenriksen-inferno avatar Dec 02 '19 09:12 ahenriksen-inferno

Unfortunately, I can't reproduce the problem. Maybe you can share a project that always reproduces the problem? Also, can you share your set of installed extensions?

// _a.scss
$color: red;

// _b.scss
$color: blue;

// test.scss

@import "b";

$green: green;
$red: red;
$color: green;

// Write here

My attempt:

ezgif com-video-to-gif

mrmlnc avatar Dec 05 '19 18:12 mrmlnc

Hey @mrmlnc, sorry for the delay in getting back to you.

So I disabled every plugin aside for yours, and sure enough you are right it works. I went through the list and identified the sole plugin causing a conflict with your intellisense.

Auto Comment Blocks, at least for me, causes the issue addressed in the various comments in this thread. I have no clue why or how this causes issues, but perhaps the other people commenting here can confirm whether or not they too have this plugin installed.

ekfuhrmann avatar Feb 17 '20 15:02 ekfuhrmann

Seems I got the same issue here. not in scss file, but in Vue SFC file with <script lang="scss">. When I typo '$' for intellisense and selecting the suggestion, I got double $, like this: border: $$border;, It can work well in scss files.

yzx9 avatar Feb 22 '20 14:02 yzx9

@nsznsznjsz Try disabling all addons aside for vscode-scss and see if you get the doubling $ behavior. In my case, it was Auto Comment Blocks causing issues, which may be the case for you as well. It seems like this issue is due to a conflicting plugin, and addressing it will be easier if @mrmlnc knows which plugin(s) is causing the issue.

ekfuhrmann avatar Feb 22 '20 17:02 ekfuhrmann

I can also reproduce when only two extensions. PS. The another extension is Vetur. Because vue file support needed.

yoyo930021 avatar Mar 22 '20 15:03 yoyo930021

Same as previous writers - errors when using only Vetur and vscode-scss.

gismya avatar Mar 31 '20 15:03 gismya

+1 happens to me when using Vetur with this extension

syntag avatar Apr 22 '20 19:04 syntag

same here, duplicate $ with vetur. working on a vue project so i need to have vetur active.

mgiraldo avatar Aug 26 '20 02:08 mgiraldo

Encountered exactly the same issue on VSCode 1.48.2 + vscode-scss 0.9.0.

kuanyui avatar Sep 03 '20 09:09 kuanyui

Any workaround? This is still the issue.

dkoprowski avatar Jun 09 '21 14:06 dkoprowski

Still an issue.

sunny-github-acc avatar Feb 03 '22 10:02 sunny-github-acc

Seems to be incompatible with vetur. Is there any fix in sight?

Matix-Media avatar Apr 08 '22 10:04 Matix-Media