• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Setup Visual Studio Code on Mac For Debugging Arduino, WordPress : Part 2

By Abhishek Ghosh October 12, 2017 10:53 am Updated on October 12, 2017

Setup Visual Studio Code on Mac For Debugging Arduino, WordPress : Part 2

Advertisement

This is the second part of our series guide on setup of Visual Studio Code on Mac. The first part of the guide is here. In this guide we have shown to setup WordPress debug setup. Here is part 2 of how to setup Visual Studio Code on Mac for debugging Arduino, WordPress etc and this current webpage is only for final setup for WordPress. If you want to follow our guides, you must only follow our guides – not of someone else ending up messing up the whole setup. We have tested the things many times and at the time of writing the guide we have no error. Microsoft does say the same thing – they do not have error. P

 

Setup Visual Studio Code on Mac For Debugging WordPress

 

We will show you the way which will not create issue with Atom Editor and on Command Line. From the previous guide, you have a composer.json file located at /Users/your-user-name/.composer/composer.json, which is /Users/abhishekghosh/.composer/composer.json for me. If we run a cat on it :

Vim
1
cat /Users/abhishekghosh/.composer/composer.json

We’ll get this output :

Advertisement

---

Vim
1
2
3
4
5
{
    "require": {
        "squizlabs/php_codesniffer": "*"
    }
}

But I need to have that thing here too :

Vim
1
/Users/abhishekghosh/composer.json

So create a composer.json at /Users/your-user-name and copy-paste the content. Which in my case is just easy :

Vim
1
cp /Users/abhishekghosh/.composer/composer.json /Users/abhishekghosh/composer.json

Now run :

Vim
1
2
3
composer update
composer global show
vendor/bin/phpcs --version

There will be no error. Now install WordPress coding standard (which is actually a physical project, also available on Github) :

Vim
1
composer create-project wp-coding-standards/wpcs:dev-master --no-dev

You’ll get this kind of output :

Vim
1
2
3
4
5
6
7
8
9
Created project in /Users/abhishekghosh/wpcs
Loading composer repositories with package information
Updating dependencies
Package operations: 1 install, 0 updates, 0 removals
  - Installing squizlabs/php_codesniffer (3.1.0): Loading from cache
Writing lock file
Generating autoload files
> "vendor/bin/phpcs" --config-set installed_paths ../../..
Using config file: /Users/abhishekghosh/wpcs/vendor/squizlabs/php_codesniffer/CodeSniffer.conf

If you run :

Vim
1
ls -al ~/wpcs/vendor/bin/phpcs

You’ll notice a symlink. Now you’ll add another symlink :

Vim
1
ln -s ~/wpcs/vendor/bin/phpcs /usr/local/bin/phpcs

Add this thing to your ~/.zshrc :

Vim
1
export PATH="/Users/abhishekghosh/wpcs/vendor/bin:$PATH"

Then save the file and reload :

Vim
1
source ~/.zshrc

Now run this command :

Vim
1
vendor/bin/phpcs --config-set installed_paths wpcs

Then run this command :

Vim
1
vendor/bin/phpcs -i

You should receive output like this :

Vim
1
The installed coding standards are MySource, PEAR, PSR1, PSR2, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs, WordPress-Extra and WordPress-VIP

You wanted WordPress, is not it? Now for testing, clone Hello Dolly plugin :

Vim
1
2
cd ~
git clone https://github.com/wp-plugins/hello-dolly.git

Run checking :

Vim
1
vendor/bin/phpcs --standard=WordPress hello-dolly

You’ll get output like this :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FILE: /Users/abhishekghosh/hello-dolly/hello.php
--------------------------------------------------------------------------------
FOUND 16 ERRORS AFFECTING 15 LINES
--------------------------------------------------------------------------------
  2 | ERROR | [ ] Missing short description in doc comment
  5 | ERROR | [ ] There must be exactly one blank line after the file comment
  6 | ERROR | [ ] Empty line required before block comment
15 | ERROR | [ ] You must use "/**" style comments for a function comment
46 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks, or
    |       |     question marks
49 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks, or
    |       |     question marks
53 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks, or
    |       |     question marks
54 | ERROR | [ ] You must use "/**" style comments for a function comment
56 | ERROR | [ ] Expected next thing to be an escaping function (see Codex for
    |       |     'Data Validation'), not '"<p id='dolly'>$chosen</p>"'
59 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks, or
    |       |     question marks
62 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks, or
    |       |     question marks
63 | ERROR | [ ] You must use "/**" style comments for a function comment
64 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks, or
    |       |     question marks
67 | ERROR | [ ] Expected next thing to be an escaping function (see Codex for
    |       |     'Data Validation'), not '"
    |       |     '
82 | ERROR | [x] A closing tag is not permitted at the end of a PHP file
82 | ERROR | [x] File must end with a newline character
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
 
Time: 758ms; Memory: 8Mb

Now start Visual Studio Code. That PHPCS extension may disturb and need disabling, reload, enabling and reload to function. You need not to modify settings in Visual Studio Code ( to access user settings click Debug icon and hit COMMAND and , ) as by default in PHPCS extension it is set to null, which means default :

Vim
1
https://marketplace.visualstudio.com/items?itemName=ikappas.phpcs

Now if you copy paste that Hello Dolly plugin’s one PHP file on Visual Studio Code and run Debug as PHP, you’ll get huge errors :

Setup Visual Studio Code on Mac For Debugging Arduino WordPress - Part 2

You can install extensions like this :

Vim
1
https://marketplace.visualstudio.com/items?itemName=HvyIndustries.crane

For the above extension you need to access user settings by clicking Debug icon and hitting COMMAND and , search for what they have suggested to change, save and relaunch.

That PHPCS extension may again disturb and need disabling, reload, enabling and reload to function. That error happens as our ZSH itself load very slow and Visual Studio Code expects immediate availability.

Tagged With how to debug in visual studio mac? , setup visual studio code for arduino
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Setup Visual Studio Code on Mac For Debugging Arduino, WordPress : Part 2

  • Setup Visual Studio Code on Mac For Debugging Arduino, WordPress : Part 1

    Here is How to Setup Visual Studio Code on Mac For Debugging Arduino, WordPress etc Common Things For the iTerm2 + ZSH + Homebrew Users.

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Setup Visual Studio Code on Mac For Debugging Arduino, WordPress : Part 4

    Part 4 of How to Setup Visual Studio Code on Mac For Debugging Arduino, WordPress etc Shows How to Setup Atom Editor & CLI to Complete Setup.

  • Setup Visual Studio Code on Mac For Debugging Arduino, WordPress : Part 3

    Part 3 of How to Setup Visual Studio Code on Mac For Debugging Arduino, WordPress etc. Here is How to Setup as Arduino IDE to Upload Code.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy