• 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

This Article Has Been Shared 482 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic 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.

  • Virtual Private Server (VPS) Hosting can be a good option for your blog

    Virtual Private Server (VPS) Hosting is becoming more popular as it offers the flexibility of a dedicated server but much lower priced compared to a dedicated server.

  • Dedicated Server Hosting for WordPress Blog : Why and When to think

    Dedicated Server Hosting for WordPress Blog is definitely the best Hosting option. But, the cost of dedicated Server is the limiting factor. Here are the points when you will think for a dedicated host for your WordPress blog.

  • YouTube Video : YouTube Tips and Tricks for Publishers

    YouTube Tips and Tricks for Publishers will help you to create, optimize YouTube videos, get direct backlinks, Traffic to your blog as well as earn money.

  • Hardening WordPress (Nginx, Ubuntu, OpenStack, HP Cloud)

    Hardening WordPress Written on Official WordPress is Pretty Outdated & Useless on 2015. Here is Some Tips For WordPress Running on Nginx on OpenStack.

Additionally, 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

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

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 (21K Followers)
  • Twitter (5.3k 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

  • What is Standard Software February 28, 2021
  • WordPress Link to text Fragment February 27, 2021
  • How to Protect IP Cameras From Hackers February 25, 2021
  • 6 Sectors That Have Undergone Revamps in Digital Landscape February 24, 2021
  • What You Can Control with a Smartwatch and ESP32 February 23, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "Setup Visual Studio Code on Mac For Debugging Arduino, WordPress : Part 2," in The Customize Windows, October 12, 2017, March 2, 2021, https://thecustomizewindows.com/2017/10/setup-visual-studio-code-mac-debugging-arduino-wordpress-part-2/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

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

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