Coder Social home page Coder Social logo

local-addon-xdebug-vscode's People

Contributors

afragen avatar bgturner avatar brandondove avatar chuckmac avatar nateconley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

local-addon-xdebug-vscode's Issues

Feature Request: Support Saving to VS Code Workspaces

I have taken to using VS Code workspaces rather than opening my public folder for sites, so that I have just the themes and plugins I’m developing in VS Code, to make navigating files more manageable. Debugging can still go into WP code when needed. Workspace files end in .code-workspace and can include the launch object for debugging. It would be nice if this add-on looked for a VS Code workspace in the root of the Local site, or anywhere below, and offered to save the Xdebug launch data there instead of to the public folder.

How to install this from Local

There is an option in Local to install the add-on from disk. Can you make a release in this repo so we can download the production version and install instead of cloning and installing dependencies?

New for xDebug 3.0

https://xdebug.org/docs/upgrade_guide

So for xDebug 3.0 the php.ini.hbs file should be updated with the following replacements.

xdebug.remote_autostart = 1 equivalent should be xdebug.start_with_request = yes

If the above is made you should also add xdebug.log_level = 0 otherwise if the debugger is not started in VSCode the log file will fill with errors related to not connecting to a debugger that hasn't been started.

xdebug.remote_connect_back Replaced by xdebug.discover_client_host.

If you update for xDebug 3.0 the settings as replaced would look like the following.

xdebug.scream = 1
xdebug.show_local_vars = 1
xdebug.start_with_request = yes
xdebug.log_level = 0
xdebug.discover_client_host = yes

I do have to say that the PHP 8 lightning service that's being tested in Local Beta 5.9.7 adds

xdebug.start_with_request=yes
xdebug.discover_client_host=yes

I have recommended FlyWheel use xdebug.start_with_request=trigger so that the debugger only runs when asked, but running always and turning down the log level is suitable. I let them know as well.

Unable to enable on Windows

Trying to enable the extension on Windows copy of Local (6.1.5+5536) and getting the following error:

Error: Cannot find module 'uuid/v4'

{"thread":"main","class":"AddonLoaderService","stack":"Error: Cannot find module 'uuid/v4'\nRequire stack:\n- %%userDataPath%%\\addons\\local-addon-xdebug-vscode\\lib\\main.js\n- %%appPath%%\\main\\addons\\AddonLoaderService.js\n- %%appPath%%\\main\\serviceContainer.js\n- %%appPath%%\\main\\main.js\n- \n at Module._resolveFilename (internal/modules/cjs/loader.js:887:15)\n at Function.n._resolveFilename (electron/js2c/browser_init.js:261:1128)\n at Function.Module._resolveFilename (%%appPath%%\\node_modules\\module-alias\\index.js:49:29)\n at Module._load (internal/modules/cjs/loader.js:732:27)\n at Function.f._load (electron/js2c/asar_bundle.js:5:12913)\n at Module.require (internal/modules/cjs/loader.js:959:19)\n at require (internal/modules/cjs/helpers.js:88:18)\n at Object.<anonymous> (%%userDataPath%%\\addons\\local-addon-xdebug-vscode\\lib\\main.js:35:30)\n at Module._compile (internal/modules/cjs/loader.js:1078:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)","level":"error","message":"Error Loading Add-on: %%userDataPath%%\\addons\\local-addon-xdebug-vscode\\lib\\main.js","timestamp":"2021-10-22T13:02:21.350Z"}

Update for PHP 8.0 and xDebug 3.0

PHP 8.0 now requires/comes with xDebug 3.0. xDebug 3.0 now listens on port 9003 and not 9000. A configuration for xDebug 3.0 is needed. All that needs is a duplicate of the existing configuration with the port set to 9003 and a title showing it uses xDebug 3.0. Similar to the following.

		{
			"name": "Listen for Xdebug 3.0 (Local)",
			"type": "php",
			"request": "launch",
			"port": 9003,
			"xdebugSettings": {
				"max_children": 128,
				"max_data": 1024,
				"max_depth": 3,
				"show_hidden": 1
			}
		}

Thanks for updating this.

Install never ends on windows 10 version 1908, Local 6.15 5536

when i press install button i stops when almost completed... ir remains intalling forever.
windows 10 version 1908, Local 6.15 5536
{"thread":"main","reason":{"errno":-4048,"syscall":"rename","code":"EPERM","path":"C:\Users\usuario\AppData\Local\Temp\local-I9E38sTc3\package","dest":"%%userDataPath%%\addons\local-addon-xdebug-vscode"},"p":{},"level":"warn","message":"Unhandled Rejection.","timestamp":"2021-11-11T09:22:52.182Z"}

Error when installing Xdebug + VS Code in Local on Linux

Local version 5.6.3+4270 on Linux Mint.

When I go to the Addons tab on Local and go to Xdebug + VS Code and click "INSTALL ADD-ON", I get this error after a while:

Skærmbillede fra 2020-07-10 13-43-41

And the addon is not installed.

And here is what appears in local-lightning.log:

{ "thread": "main", "class": "", "errno": -18, "syscall": "rename", "code": "EXDEV", "path": "/tmp/local-BsyAMLjt-/package", "dest": "%%userDataPath%%/addons/local-addon-xdebug-vscode", "level": "error", "stack": "Error: EXDEV: cross-device link not permitted, rename '/tmp/local-BsyAMLjt-/package' -> '%%userDataPath%%/addons/local-addon-xdebug-vscode'\n at Object.renameSync (fs.js:609:3)\n at Object.moveSync [as sync] (%%appPath%%/node_modules/fs-jetpack/lib/move.js:27:8)\n at Object.move (%%appPath%%/node_modules/fs-jetpack/lib/jetpack.js:179:12)\n at exports.default.<anonymous> (%%appPath%%/main/addons/AddonInstallerService.js:1:6635)\n at Generator.next (<anonymous>)\n at o (%%appPath%%/main/addons/AddonInstallerService.js:1:124)", "message": "EXDEV: cross-device link not permitted, rename '/tmp/local-BsyAMLjt-/package' -> '%%userDataPath%%/addons/local-addon-xdebug-vscode'", "timestamp": "2020-07-10T16:12:42.051Z" }

Installed launch configuration seems different from what I've been using for years

@brandondove not certain it makes a difference but here's what I have for my launch config.

"launch": {
		"version": "0.2.0",
		"configurations": [
			{
				"name": "Listen for xDebug (Local 5.x)",
				"type": "php",
				"request": "launch",
				"port": 9000,
				"pathMappings": {
					"": "${workspaceFolder}"
				},
				"xdebugSettings": {
					"max_children": 128,
					"max_data": 1024,
					"max_depth": 3,
					"show_hidden": 1
				}
			},
			{
				"name": "Launch currently open script",
				"type": "php",
				"request": "launch",
				"program": "${file}",
				"cwd": "${fileDirname}",
				"port": 9000
			},
			{
				"name": "Listen for xDebug (Local 3.x)",
				"type": "php",
				"request": "launch",
				"port": 9000,
				"pathMappings": {
					"/app/public": "${workspaceFolder}"
				},
				"xdebugSettings": {
					"max_children": 128,
					"max_data": 1024,
					"max_depth": 3,
					"show_hidden": 1
				}
			
		]
	},

The additional xdebugSettings help to display more data in the variables, etc.

I have also included my xDebug launch settings for Local 3.x.

This works for me when VSCode is opening the /app/public directory.

Duplicate config added in php.ini

If I have deleted .vscode folder and again re-added XDebug configuration to VSCode then the config input in the php.ini is added multiple times... For my case I have tried to click the addon setting link overall 5time and if I delete the code and start the site still 5 times this is repeated:

[localbyflywheel]
xdebug.scream = 1
xdebug.show_local_vars = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
[localbyflywheel]
xdebug.scream = 1
xdebug.show_local_vars = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
[localbyflywheel]
xdebug.scream = 1
xdebug.show_local_vars = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
[localbyflywheel]
xdebug.scream = 1
xdebug.show_local_vars = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
[localbyflywheel]
xdebug.scream = 1
xdebug.show_local_vars = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1

Now again if I switch to PHP 8.0 and come back to 7.4.1 all the localbyflywheel config in php.init are lost. I have to again click the button but my .vscode folder already exists. Need to give control to previous configurations. I have found this solution to fix the 5times adding config in php.ini by switching to next PHP version and being back to previous and clicking add config btn :D

install and build fail

The instructions in the readme can't be completed.

yarn install v1.22.19
info No lockfile found.
[1/5] πŸ”  Validating package.json...
warning [email protected]: The engine "local-by-flywheel" appears to be invalid.
[2/5] πŸ”  Resolving packages...
warning @getflywheel/local-components > [email protected]: Support has ended for 9.x series. Upgrade to @latest
warning @getflywheel/local-components > react-popper > [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
warning [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning @getflywheel/local > [email protected]: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as @graphql-tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
warning @getflywheel/local > graphql-tools > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning @types/[email protected]: This is a stub types definition for electron (https://github.com/electron/electron). electron provides its own type definitions, so you don't need @types/electron installed!
[3/5] 🚚  Fetching packages...
[4/5] πŸ”—  Linking dependencies...
warning " > @getflywheel/[email protected]" has unmet peer dependency "react-dom@>= 16.4.0".
warning " > @getflywheel/[email protected]" has unmet peer dependency "react-router-dom@^4.3.1".
warning "@getflywheel/local-components > [email protected]" has unmet peer dependency "react-dom@^0.14.0 || ^15.0.0 || ^16 || ^17 || ^18".
warning "@getflywheel/local-components > [email protected]" has unmet peer dependency "prop-types@>=15".
[5/5] πŸ”¨  Building fresh packages...
success Saved lockfile.
$ npm run build

> [email protected] build
> tsc

node_modules/@getflywheel/local-components/dist/components/alerts/Banner/Banner.d.ts:17:19 - error TS2503: Cannot find namespace 'JSX'.

17     renderIcon(): JSX.Element | null;```

git clone and yarn install is failing

change directories into Local/addons, ran a git clone, then yarn install. Got these error messages. Running on macOS. Local 5.6.1+4184

> [email protected] build /Users/claytoncollie/Library/Application Support/Local/addons/local-addon-xdebug-vscode
> tsc

node_modules/@getflywheel/local/main.d.ts:870:16 - error TS2304: Cannot find name 'ConnectDirection'.

870  			direction: ConnectDirection,
     			           ~~~~~~~~~~~~~~~~

node_modules/@getflywheel/local/main.d.ts:871:21 - error TS2304: Cannot find name 'FlywheelSite'.

871  			flywheelSiteID: FlywheelSite['id'],
     			                ~~~~~~~~~~~~

node_modules/@getflywheel/local/main.d.ts:872:18 - error TS2304: Cannot find name 'flywheelSiteEnvironment'.

872  			environment: flywheelSiteEnvironment,
     			             ~~~~~~~~~~~~~~~~~~~~~~~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.