forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
954 stars 406 forks source link

Cannot get html lightning language support for aura #5377

Closed sim9805 closed 8 months ago

sim9805 commented 8 months ago

Summary There is no code completion for aura components (cmp)

Steps To Reproduce: sfdx force:lightning:component:create -n mylightningcomp Open mylightningcomp.cmp file Start typing <lightning: then CTRL+SPACE Expected result vs Code should suggest lightning elements

Actual result Nothing is suggested :(

Additional information In the javascript controllers, LWC elements are suggested. And in apex classes, language suggestions are working. But aura.cmp its not working

CristiCanizales commented 8 months ago

hi @sim9805, can you send a screenshot of what you see when you select Aura Language Server in the Output Tab?

image

Also, could you please provide us with all the details requested in the template of the issue. We ask for them precisely to have some context on the issue, without them is almost impossible to help users. Thanks in advance!

sim9805 commented 8 months ago

Hi @CristiCanizales , this is the screenshot of Aura Language Server tab Screenshot 2024-01-30 004611

And this is the issue when I press ctrl+space only in cmp file am not getting any suggestions but am getting autosuggestions in LWC, APEX and in aura- controller.js file as well

image

Getting auto suggestions in auracontroller js file, LWC, apex image

CristiCanizales commented 8 months ago

@sim9805 can you try creating a new aura component running SFDX: Create Aura Component through the command palette (Ctrl + Shift + P) and checking again?

sim9805 commented 8 months ago

@CristiCanizales have created another new aura component, but still facing same image

daphne-sfdc commented 8 months ago

Hi @sim9805, Can you please run Developer: Show Running Extensions and send us a screenshot of that page? I want to make sure you have all the Salesforce extensions installed, activated, and on the latest version.

sim9805 commented 8 months ago

Hi @daphne-sfdc , here is the screenshot of extensions that i have in VS. Thanks

image image image

daphne-sfdc commented 8 months ago

@sim9805 Ok, good to know that you are using the latest version of the extensions and everything is activated properly đź‘Ť

Can you run Developer: Toggle Developer Tools and show me what's in the logs?

sim9805 commented 8 months ago

@daphne-sfdc , please find the screenshot of logs , and pls let me know if I need to share any other tab view in this screenshot am attaching console error logs ![Uploading image.png…]()

daphne-sfdc commented 8 months ago

The image file doesn't work. Can you re-upload it?

sim9805 commented 8 months ago

@daphne-sfdc , please find here image

daphne-sfdc commented 8 months ago

The error message about MaxListenersExceededWarning is a typical one and does not interfere with the Aura extension activating. In this case, it looks like your logs are not showing anything unusual.

The screenshot of the Aura Language Server tab that you provided earlier also has only regular logs.

What is your VSCode version? If you are not on the latest version (1.85.2) can you upgrade your VSCode?

sim9805 commented 8 months ago

@daphne-sfdc , Hi am using the latest version of VS, please advise how can I enable auto suggestions of aura.cmp file? image

daphne-sfdc commented 8 months ago

I do wonder if one of your other non-Salesforce extensions has something that conflicts with the Aura extension... have you ever seen autocompletions for Aura before, or is this your first time using the extension?

I would try disabling all the other non-Salesforce extensions and seeing if the Aura autocompletions appear. Then if they do appear, start adding the extensions back one by one to figure out the conflicting one.

sim9805 commented 8 months ago

@daphne-sfdc I have not try Auto sugggestion for aura earlier..but have been using for Apex, LWC

daphne-sfdc commented 8 months ago

What were your results of disabling all the non-Salesforce extensions? Did you start seeing autocompletions for Aura?

sim9805 commented 8 months ago

@daphne-sfdc, I have disabled all non-Salesforce extensions, still am not getting auto suggestion, please advise image

daphne-sfdc commented 8 months ago

You did remember to reload the VSCode window after disabling those extensions, right?

CristiCanizales commented 8 months ago

Hi @sim9805, can you also check what you have selected for the setting Salesforcedx-vscode-lightning: Activation Mode? Both for User and Workspace, and also in the JSON file. image

sim9805 commented 8 months ago

@daphne-sfdc yes I restarted it but it was not working. @CristiCanizales Hi, I have updated my user and workspace to autodetect then restart it still am not getting. Also could you please advise in whihc json file I need to check further maybe it will help

CristiCanizales commented 8 months ago

@sim9805 image

sim9805 commented 8 months ago

@CristiCanizales this is my workspace json setting: { "search.exclude": { "/node_modules": true, "/bower_components": true, "**/.sfdx": true } }

This is my user json setting : image

sim9805 commented 8 months ago

@CristiCanizales image

mingxuanzhangsfdx commented 8 months ago

Hi @sim9805 , thanks for sharing the config. In my config there is no "*.cmp" config specified. So I think you should remove that. Also, could you try to

  1. Open up a new Terminal window and type cd .vscode/extensions (or cd %USERPROFILE%.vscode\extensions in Windows)
  2. Delete all the previous versions of the Salesforce extensions by running rm -rf salesforce.salesforcedx-vscode (or equivalent command in windows - rmdir /s /q salesforce.salesforcedx-vscode)
  3. Reinstall the Salesforce extensions.
  4. Clean your cache by deleting the .sfdx and .sf folders from your project, then running "Developer: Reload Window" from the command palette.

Please let me know if there is any error output in the Developer Tools and consoles.

sim9805 commented 8 months ago

Hi @mingxuanzhangsfdx , after removing the .cmp config, it starts working, thanks !!

CristiCanizales commented 8 months ago

Glad it's working again!