Skip to content

Commit 38b8456

Browse files
first commit
0 parents  commit 38b8456

17 files changed

+6550
-0
lines changed

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Node.js dependencies
2+
node_modules/
3+
*.log
4+
5+
# VS Code specific settings
6+
.vscode/
7+
8+
# VS Code Extension output
9+
*.vsix
10+
11+
# MacOS system files
12+
.DS_Store
13+
14+
# Windows system files
15+
Thumbs.db
16+
ehthumbs.db
17+
18+
# Logs
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
pnpm-debug.log*
23+
24+
# Editor files
25+
*.swp
26+
*.swo
27+
*~
28+
29+
# Environment files
30+
.env
31+
.env.local
32+
.env.development.local
33+
.env.test.local
34+
.env.production.local
35+
36+
# Other generated files
37+
coverage/
38+
dist/
39+
out/
40+
temp/
41+
Build/
42+
43+
#Build Extension Shell Script
44+
build-extension.sh

.vscode-test.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@vscode/test-cli';
2+
3+
export default defineConfig({
4+
files: 'out/test/**/*.test.js',
5+
});

.vscodeignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.vscode/**
2+
.vscode-test/**
3+
out/**
4+
node_modules/**
5+
src/**
6+
.gitignore
7+
.yarnrc
8+
esbuild.js
9+
vsc-extension-quickstart.md
10+
**/tsconfig.json
11+
**/eslint.config.mjs
12+
**/*.map
13+
**/*.ts
14+
**/.vscode-test.*
15+
16+
build-extension.sh
17+
Build/

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
All notable changes to the "quickpy" extension will be documented in this file.
4+
5+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6+
7+
## v0.0.1 (2025-01-12)
8+
9+
Initial release.

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 (Codegyan LLC) Prathmesh Yelne
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# QuickPHP - PHP Inline Execution for VS Code
2+
3+
**QuickPHP** is a lightweight VS Code extension that executes PHP code inline, similar to how QuickPy works for PHP. It helps PHP developers see their output directly within the editor, without switching to the terminal.
4+
5+
<p align="center">
6+
<img src="https://raw.githubusercontent.com/Codegyan-LLC/QuickPHP/refs/heads/main/images/use.gif" width="600" alt="QuickPHP Use">
7+
</p>
8+
9+
## Getting Started
10+
11+
Installation
12+
13+
1. **VS Code Marketplace :**
14+
* Open Visual Studio Code.
15+
* Navigate to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X on macOS).
16+
* Search for QuickPHP.
17+
* Click "Install" to add the extension to your VS Code.
18+
19+
2. **Install from VSIX :**
20+
- Download the latest `.vsix` package from the [Releases](#) page.
21+
- Open Visual Studio Code.
22+
- Go to the Extensions view by clicking on the Extensions icon in the Activity Bar or pressing `Ctrl+Shift+X`.
23+
- Click on the ellipsis (`...`) in the top-right corner of the Extensions view and select "Install from VSIX...".
24+
- Navigate to the downloaded `.vsix` file and select it to install.
25+
26+
## Features
27+
28+
* `Inline Code Execution`: Run PHP code directly in the editor and display results as inline comments.
29+
* `Real-Time Updates`: Automatically executes code on text changes or cursor movements.
30+
* `Error Feedbac`k: Catch errors like NameError and display clear, formatted messages inline.
31+
* `Temporary File Execution`: Ensures safe execution using temporary files without modifying your project files.
32+
* `Output Formatting`: Displays clean and non-intrusive inline output for easy readability.
33+
* `Enhanced Debugging`: Provides feedback for incomplete or invalid code to help developers debug faster.
34+
35+
36+
## Usage
37+
38+
<p align="center">
39+
<img src="https://raw.githubusercontent.com/Codegyan-LLC/QuickPHP/refs/heads/main/images/code.png" width="600" alt="QuickPHP Example">
40+
</p>
41+
42+
### Auto Execution
43+
44+
Just write a PHP echo, print_r, or var_dump statement, and the output will appear inline.
45+
46+
``` php
47+
echo "Hello, QuickPHP!";
48+
// Output: Hello, QuickPHP!
49+
```
50+
51+
### Error Highlighting
52+
53+
Errors are shown inline, with the file and line number.
54+
``` php
55+
echo $undefinedVar;
56+
// Error: Undefined variable $undefinedVar (line 3)
57+
```
58+
59+
## Known Issues
60+
* Large scripts or complex logic may cause delays in execution.
61+
* Inline execution is limited to the lines above the current cursor.
62+
63+
Feel free to report bugs or suggest features by opening an issue on GitHub.
64+
65+
## Contributing
66+
67+
Contributions are welcome! If you have suggestions for improvements or new features, feel free to open an issue or submit a pull request on the Github.
68+
69+
## License
70+
71+
This extension is licensed under the **[MIT license](https://opensource.org/licenses/MIT)**..
72+
73+
74+
## Contact
75+
76+
For questions or feedback, please contact support@codegyan.in.
77+
78+
---
79+
80+
Thank you for using **QuickPHP**! We hope it enhances your coding experience.
81+
82+

esbuild.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
const esbuild = require("esbuild");
2+
3+
const production = process.argv.includes('--production');
4+
const watch = process.argv.includes('--watch');
5+
6+
/**
7+
* @type {import('esbuild').Plugin}
8+
*/
9+
const esbuildProblemMatcherPlugin = {
10+
name: 'esbuild-problem-matcher',
11+
12+
setup(build) {
13+
build.onStart(() => {
14+
console.log('[watch] build started');
15+
});
16+
build.onEnd((result) => {
17+
result.errors.forEach(({ text, location }) => {
18+
console.error(`✘ [ERROR] ${text}`);
19+
console.error(` ${location.file}:${location.line}:${location.column}:`);
20+
});
21+
console.log('[watch] build finished');
22+
});
23+
},
24+
};
25+
26+
async function main() {
27+
const ctx = await esbuild.context({
28+
entryPoints: [
29+
'src/extension.ts'
30+
],
31+
bundle: true,
32+
format: 'cjs',
33+
minify: production,
34+
sourcemap: !production,
35+
sourcesContent: false,
36+
platform: 'node',
37+
outfile: 'dist/extension.js',
38+
external: ['vscode'],
39+
logLevel: 'silent',
40+
plugins: [
41+
/* add to the end of plugins array */
42+
esbuildProblemMatcherPlugin,
43+
],
44+
});
45+
if (watch) {
46+
await ctx.watch();
47+
} else {
48+
await ctx.rebuild();
49+
await ctx.dispose();
50+
}
51+
}
52+
53+
main().catch(e => {
54+
console.error(e);
55+
process.exit(1);
56+
});

eslint.config.mjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
2+
import tsParser from "@typescript-eslint/parser";
3+
4+
export default [{
5+
files: ["**/*.ts"],
6+
}, {
7+
plugins: {
8+
"@typescript-eslint": typescriptEslint,
9+
},
10+
11+
languageOptions: {
12+
parser: tsParser,
13+
ecmaVersion: 2022,
14+
sourceType: "module",
15+
},
16+
17+
rules: {
18+
"@typescript-eslint/naming-convention": ["warn", {
19+
selector: "import",
20+
format: ["camelCase", "PascalCase"],
21+
}],
22+
23+
curly: "warn",
24+
eqeqeq: "warn",
25+
"no-throw-literal": "warn",
26+
semi: "warn",
27+
},
28+
}];

images/code.png

114 KB
Loading

images/icon.png

173 KB
Loading

0 commit comments

Comments
 (0)