Questions tagged [vs-code]

Visual Studio Code is a free source code editor developed by Microsoft for Windows, Linux and macOS. When the "Salesforce Extensions for VS Code" are added it: supports syntax highlighting and intelligent code completion for Apex, Visualforce and Lightning Components; works well with SFDX including with scratch orgs; supports debugging. Git UI is built in. Many other extensions are available.

133 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
0answers
279 views

Uncrustify with VS Code is overindenting SOQL Lines

I use VS Code and use Uncrustify to format the apex code As per this article. This was working fine for me until all of a sudden my SOQL lines are now automatically indented after the WHERE clause. ...
4
votes
2answers
944 views

You can’t remove the following public properties because the component is part of a managed package

I am trying to push a JS file in a LWC Component and am unable to do so with this error lwc/boatMap/boatMap.js-meta.xml: You can’t remove the following public properties: boatId, because the component ...
4
votes
0answers
109 views

A folder structure that follow enterprise design patterns

I come from ASP.net background and I used to have a standardized folder structure such as this. I just jumped on a huge project with a lot of custom code. I'm sick of having to scroll through ...
4
votes
0answers
623 views

VS Code deploy: Maximum call stack size exceeded

I'm trying to deploy code in VS Code to an org. I'm getting the following error. The package.xml is valid, as far as I can tell. Starting SFDX: Deploy Source to Org 14:57:24.268 sfdx force:source:...
3
votes
0answers
460 views

SFDX: Get Apex Debug Logs returns “undefined”

This is driving me insane - I am no longer receiving full log files when running SFDX: Get Apex Debug Logs via VS Code's command palette. Instead, I get an empty file with the correct file name, but a ...
3
votes
0answers
55 views

How do I apply formatting to method descriptions in Apex / VSCode?

VSCode, when showing a tool-tip for an Apex method, will show the description of that method as defined in the fairly standard format: /** * States that the next method definition is expected to be ...
3
votes
1answer
107 views

Automatically close Output window in vsc running salesforce CLI

I have switched from Sublime to VSCode. I have found ways to make most of VSCode work the way I want. The main thing I wish I could do is when I deploy to the org if it is successful I would like ...
3
votes
1answer
400 views

ERROR: Cannot create an AuthInfo instance that will overwrite existing auth data

Background I get this error message: ERROR: Cannot create an AuthInfo instance that will overwrite existing auth data. In the VSCode output panel, when I try and run a unit test: Starting Run ...
3
votes
0answers
2k views

command 'sfdx.force.project.with.manifest.create' not found

I've installed the latest versions of VScode, the Salesforce CLI, and the VS code Salesforce CLI Extension but when I go to run SFDX: Create Project with Manifest or any SFDX command, I receive an ...
2
votes
0answers
93 views

SFDX:Diff File Against Org command not working only for Apex Classes

In my VS Code, when I right-click on an Apex class I can't see 'SFDX:Diff File Against Org' command. But this is perfectly working for Aura components or Visualforce Pages. The problem only exists ...
2
votes
0answers
30 views

sfdx force:org:list hangs

When I run the following command in either the VS Code terminal window, or a Windows Command Prompt, it returns all of the orgs, but hangs: sfdx force:org:list Is there some other way I should be ...
2
votes
0answers
269 views

Specifying individual CustomField in package.xml (vscode) does not deploy to Org, but when retrieving by object it does?

When retrieving CustomFields in package.xml by specifying: <types> <members>ObjectName.FieldName__c</members> <name>CustomField</name> </types> They retrieve ...
2
votes
0answers
160 views

VS Code - Compare metadata in different orgs

The one thing that Eclipse IDE seemed to do well that I've not yet worked out in VS Code is comparing metadata in different orgs. Using VS Code, I know how to compare files which are in the same ...
2
votes
1answer
29 views

How do I display more characters when debugging SFDX code?

I have variable in my code defined as follows: String myString = myConfig.my_field_name__c; When debugging in the SFDX console (in VS Code), the variable's value is only displayed as: myString: '...
2
votes
0answers
452 views

How to setup ESLint in VSCode to work with every project?

Below is the process I am doing in VSCode to setup for every project I create: run command npm init from project folder and this is creating package.json file. Run the command eslint --init and it ...
2
votes
0answers
486 views

'ENOENT': spawn cmd ENOENT error while authorizing sandbox org in VSCode

Hi I have installed VS Code and salesfoce CLI, extensions also. I have created my first project. When i am tryin to authorize org in it i am getting below error: Starting SFDX: Authorize an Org 14:...
2
votes
1answer
127 views

Update sObjects in .sfdx/typings

I have a VSCode SFDX Project that we use to develop LWCs, and we recently changed some object names in the Org and now I can't upload anything to our Org. I found that there is a command to refresh ...
2
votes
0answers
193 views

How to get Twilio for Salesforce Apex API intellisense in VSCode

I have this Twilio package installed (in both environments): Twilio for Salesforce: Production / Sandbox I am using VSCode to build against the Apex Query Library: Example Apex TwilioSF....
1
vote
0answers
26 views

diff on folder in visual studio code

I am using Visual Studio Code with Salesforce Extensions. I am trying to find all diffs between my local project and the sandbox. When I right click on classes folder and click on Diff Folder Against ...
1
vote
0answers
18 views

Vscode authorisation taking long time

In vscode I was unable to authorise a org even I set Java path and salesforce cli path as well but still taking long time and tried plug-in as well can anyone help me to authorise an org
1
vote
0answers
29 views

How can I get VS Code to consider dynamic styles as valid CSS?

I'm building a Lightning Web Component with dynamic styles in VS Code. Each time I do, I get warnings and errors about empty rulesets and expected braces and selectors. <html-element style={...
1
vote
1answer
115 views

No Package.xml Found In Destructive MDAPI Deployment

I've already looked at the existing questions and made sure of the following: Only package.xml & destructiveChanges.xml are in the folder I'm trying to deploy. package.xml is empty outside of the ...
1
vote
0answers
31 views

How to write a meta data for an object (Standard Object and Custom Object )?

I want to create meta data file so that I can enable field history tracking and there is no need for manual enabling in sandbox. I want this metadata file to work with Jenkins pipeline. I have to do ...
1
vote
0answers
45 views

How to deploy code to SF instance from your branch?

Can I deploy my git branch to salesforce org? Currently, I write my code in vscode and deploy it to org using vscode. If it works, I add that code in the git branch and commit, which gets merged later....
1
vote
0answers
74 views

How to correctly enable Type checking in VSCode for LWC?

I wonder how to sucessfully configure type checking in VSCode for LWC. VSCode has JS/TS compiler that support type checking when we set jsconfig.json with compilerOptions like below: "...
1
vote
1answer
29 views

VScode doesn't highlight/autocomplete code (salesforce extension pack)

This is what I see in VScode: I have the Salesforce extension packed installed, but I'm not sure everything's working correctly here. Keywords "with" and "sharing" are not ...
1
vote
0answers
29 views

VS Code auto submit changes doesn't work for 1 file

The .js file for a lightning web component won't deploy to my org when I save the file in VS Code, but deploys fine if I right click in the file explorer and select Deploy Source to Org. The output ...
1
vote
0answers
235 views

Not able to Authorize an Org with VS CODE

Steps to reproduce: Run the following command in terminal: sfdx force:auth:web:login --setalias org1 --instanceurl https://login.salesforce.com --setdefaultusername Then I am redirected to my ...
1
vote
0answers
79 views

auto completion of slds classes is not working on Aura and LWC

Auto-suggestion of SLDS classes is not working in Aura and LWC after adding SLDS validator extension in VS Code. Please help me.
1
vote
0answers
306 views

Unable to deploy LWC from VSCode

Apex is getting deployed but on coming to LWC VSCode is throwing error: force-app\main\default\lwc\#######\#####.js-meta.xml Failed to save Lightning Component Resource [lwc/#######\#####.js] of ...
1
vote
1answer
296 views

Use Prettier in VS Code to format Visualforce

I'm struggling to get the Prettier for Apex (installed as per instructions here enter link description here) to format Visualforce Pages and Components. I have a vague memory of this working for me in ...
1
vote
1answer
733 views

VS Code autocomplete for LWC only shows up when using ctrl+space and not as I type

I am setting up my LWC dev environment with vscode but for some reason the intellisense for LWC only works if I hit ctrl + space, instead of showing up as I type. Here's what it look likes as I type: ...
1
vote
0answers
107 views

VS Code: disable the Refresh SObject Definitions prompt

In VS Code, how do I disable the "You don't have any sObjects cached locally" prompt? I don't want to use this feature in my projects.
1
vote
0answers
153 views

Unable to retrieve source after successful authorization in VSCode

I created a project with manifest. When I right click on package.xml and click 'Retrieve source', VSCode is repeatedly giving the following error even after successful authorization of the org: ERROR ...
1
vote
0answers
39 views

Visual Studio Code Deploy Issue

I am trying to deploy an utility class by adding a small method. The method implementation is below. public static boolean isId(String strValue) { return strValue instanceOf Id; } When I try ...
1
vote
0answers
38 views

Unable to Authorize Salesforce org using SFDX : Trailhead as it shows API is disabled

I am doing the Salesforce Trailhead Lightning Web Components. After I've created a project, I'm trying to "Authorize an org", but keep on receiving an error saying "API is disabled for this user" as ...
1
vote
1answer
75 views

How to edit setup SFDX_APEX_LOG_COLOR_MAP in VS Code

Following a blog post about debug logs on this page, we're able to customise the colour the command sfdx force:apex:log:tail outputs by using the SFDX_APEX_LOG_COLOR_MAP environment variables. Like ...
1
vote
1answer
168 views

Using VSCode to debug or test apex

I retrieved source files from org using SFDX commands in VS code and then I updated some code and saved the file. However, when I try to run the anonymous debugger using SFDX: Execute Anonymous ...
1
vote
0answers
58 views

Checkpoints in 'VS Apex Replay Debugger' doesn't expand the list variables

Currently we are using checkpoints so that we can view the detailed data inside the list variable which is a limitation using breakpoints.If you look at the below screenshot it doesnt show the data ...
1
vote
0answers
3k views

SFDX: Create Project failed to run

Facing problem to complete this trailhead trail ( https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/set-up-visual-studio-code) I have installed Salesforce ...
1
vote
3answers
344 views

Project is not created after running SFDX: Create Project in VS Code

I have issue while creating a project using either SFDX: Create Project or SFDX: Create Project with Manifest command. I don't receive any error but the project is not created. The variable path is ...
1
vote
1answer
39 views

Trouble Installing JDK on Mac for VSCode (SFDX)

I'm trying to do the Apex Replay Debugger trailhead, which requires JDK 8. When I install the JDK on my Mac, the installer tells me it went into /Library/Java/ directory. However, when I look in that ...
1
vote
0answers
145 views

SFDX: Get Apex Debug Logs for Site Guest User in VS Code

How do I get Debug Logs for Site Guest User in VS Code? I ran SFDX: Get Apex Debug Logs and I can see debug logs for my user. But what I want is debug logs for Site Guest User which I don't see in the ...
1
vote
0answers
546 views

SFDX Source Diff: Error: EISDIR: illegal operation on a directory, read

Background I want to use the Source Diff feature in VSCode. When I follow the instructions to install it, by running this command: sfdx plugins:install @salesforce/sfdx-diff I get this error: $ ...
1
vote
0answers
358 views

VSCode for Salesforce

I am trying to connect VSCode with my SF org(a trailhead org) and I get to the SF login page and then when I try to login, I get the following error: I am not sure why this is happening but I believe ...
1
vote
0answers
678 views

VSCode is checking my static resource JS files as if they are LWC

I have some JS files in a static resource. I pulled code from a Production org and converted to DX format for convenience. I am noticing when I open them in VSCode I get errors like "LWC1007: c:\foo\...
1
vote
0answers
2k views

Im not able to see “Authorize an Org” in my command palette

I have installed the Cli and Salesforce Extension pack. Why can I not see "Authorize an org" in my command pallet?
1
vote
0answers
281 views

Use Semantic Completion with Tabnine in VsCode

Have any of you tried to use TabNine Semantic Completion with VsCode? I tried to use the configuration below but it always crashes. Just want to make those three great tools to work smooth (VsCode, ...
1
vote
0answers
2k views

Deploy Source in Manifest to Org - ended with exit code 1 and no response in problem tab

I have a local Salesforce DX project with a package.xml manifest file. The project has been authorised against a fresh developer org. I want to deploy all my local code in one go, so I am using the ...
1
vote
0answers
475 views

How can I deploy a single metadata element with ForceCode

I'm pretty new to the world of Visual Studio Code and the ForceCode plugin. I can't seem to find an easy way to manage multiple environments or deploy from one environment to another without changing ...