Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.vscode

# Output/build
lib

.DS_Store
*.tgz

Expand Down
90 changes: 0 additions & 90 deletions lib/helpers/addWorkspaceJSON.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/helpers/addWorkspaceJSON.js.map

This file was deleted.

52 changes: 0 additions & 52 deletions lib/helpers/enableXDebugPHPini.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/helpers/enableXDebugPHPini.js.map

This file was deleted.

61 changes: 0 additions & 61 deletions lib/main.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/main.js.map

This file was deleted.

22 changes: 0 additions & 22 deletions lib/renderer.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/renderer.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "local-addon-xdebug-vscode",
"productName": "Xdebug + VS Code",
"version": "1.0.8",
"version": "1.0.9",
"description": "One-click configurator for Xdebug + VSCode. Adapted for VSCode from https://github.com/getflywheel/local-addon-xdebug-phpstorm.",
"renderer": "lib/renderer.js",
"main": "lib/main.js",
Expand All @@ -16,7 +16,7 @@
"prepare": "npm run build"
},
"devDependencies": {
"@getflywheel/local": "^6.6.0",
"@getflywheel/local": "^8",
"@types/fs-extra": "^8.0.1",
"@types/jsdom": "^12.2.4",
"typescript": "^3.7.5"
Expand Down
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {v4 as uuidv4} from 'uuid';
import addWorkspaceJSON from './helpers/addWorkspaceJSON';
import enableXDebugPHPini from './helpers/enableXDebugPHPini';

export default function(context) {
const { notifier, electron } : { notifier: any, electron: typeof Electron } = context;
export default function(context: LocalMain.AddonMainContext) {
const { notifier, electron } = context;

electron.ipcMain.on('add-vscode-xdebug-config', async (event, siteId: Local.Site['id']) => {

Expand All @@ -20,11 +20,13 @@ export default function(context) {
notifier.notify({
title: 'Xdebug + VS Code',
message: `Local's Xdebug Run Configuration and Server has been added to VS Code.`,
open: undefined, //TODO: remove this once the add-on API is updated with correct notifier types.
});
} catch (e) {
notifier.notify({
title: 'Xdebug + VS Code Error',
message: `Unable to add Run Configuration and Server.`,
open: undefined, //TODO: remove this once the add-on API is updated with correct notifier types.
});

electron.dialog.showErrorBox('Xdebug + VS Code Error', e.stack);
Expand Down
8 changes: 4 additions & 4 deletions src/renderer.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React from 'react';
import { TextButton, TableListRow } from '@getflywheel/local-components';
import { ipcRenderer } from 'electron';
import { AddonRendererContext } from '@getflywheel/local/renderer';

export default function (context) {
export default function (context: AddonRendererContext) {

const { hooks } = context;
const { hooks, electron } = context;

hooks.addContent('siteInfoUtilities', (site) => {
return (
<TableListRow key="vscode-xdebug-integration" label="Xdebug + VS Code">
<TextButton
style={{paddingLeft: 0}}
onClick={(event) => {
ipcRenderer.send('add-vscode-xdebug-config', site.id);
electron.ipcRenderer.send('add-vscode-xdebug-config', site.id);

event.target.setAttribute('disabled', 'true');
}}
Expand Down
Loading