-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
3,439 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
// A launch configuration that compiles the extension and then opens it inside a new window | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Run Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/**/*.js" | ||
], | ||
"preLaunchTask": "${defaultBuildTask}" | ||
}, | ||
{ | ||
"name": "Extension Tests", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}", | ||
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/test/**/*.js" | ||
], | ||
"preLaunchTask": "${defaultBuildTask}" | ||
} | ||
] | ||
} | ||
// A launch configuration that compiles the extension and then opens it inside a new window | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Run Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/**/*.js" | ||
], | ||
"preLaunchTask": "${defaultBuildTask}" | ||
}, | ||
{ | ||
"name": "Extension Tests", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"${workspaceFolder}/test-fixtures/test-workspace", | ||
"--extensionDevelopmentPath=${workspaceFolder}", | ||
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/test/**/*.js" | ||
], | ||
"preLaunchTask": "${defaultBuildTask}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import * as assert from 'assert'; | ||
import { before } from 'mocha'; | ||
import { setTimeout } from 'timers'; | ||
|
||
// You can import and use all API from the 'vscode' module | ||
// as well as import your extension to test it | ||
import * as vscode from 'vscode'; | ||
// import * as myExtension from '../../extension'; | ||
|
||
suite('Link Orivider Test Suite', function () { | ||
this.timeout(5500); | ||
|
||
// before(function (done) { | ||
// setTimeout(done, 5000); | ||
// }); | ||
|
||
test('Has link in php code', async () => { | ||
const document = await getFileByName('src/Controller/HomePageController.php'); | ||
const documentLinks = await vscode.commands.executeCommand<vscode.DocumentLink[]>( | ||
'vscode.executeLinkProvider', | ||
document.uri, | ||
); | ||
|
||
assert.strictEqual(1, documentLinks.length); | ||
const link = documentLinks[0]; | ||
assert.strictEqual(getWorkspaceFolder() + '/templates/homepage.html.twig', link.target?.path); | ||
assert.deepStrictEqual(new vscode.Range( | ||
new vscode.Position(15, 30), | ||
new vscode.Position(15, 48) | ||
), link.range); | ||
}); | ||
|
||
test('Has link in twig code', async () => { | ||
const document = await getFileByName('templates/homepage.html.twig'); | ||
const documentLinks = await vscode.commands.executeCommand<vscode.DocumentLink[]>( | ||
'vscode.executeLinkProvider', | ||
document.uri, | ||
); | ||
|
||
assert.strictEqual(1, documentLinks.length); | ||
const link = documentLinks[0]; | ||
assert.strictEqual(getWorkspaceFolder() + '/templates/base.html.twig', link.target?.path); | ||
assert.deepStrictEqual(new vscode.Range( | ||
new vscode.Position(0, 12), | ||
new vscode.Position(0, 26) | ||
), link.range); | ||
}); | ||
}); | ||
|
||
async function getFileByName(name: string): Promise<vscode.TextDocument> { | ||
const files = await vscode.workspace.findFiles(name); | ||
|
||
if (files.length === 0) { | ||
throw new Error(`File ${name} not found`); | ||
} | ||
|
||
return vscode.workspace.openTextDocument(files[0]); | ||
} | ||
|
||
function getWorkspaceFolder(): string { | ||
const folders = vscode.workspace.workspaceFolders; | ||
|
||
if (!folders || folders.length === 0) { | ||
throw new Error('Workspace folder is not defined'); | ||
} | ||
|
||
return folders[0].uri.path; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
###> symfony/framework-bundle ### | ||
APP_ENV=dev | ||
APP_SECRET=03df627eabb2e845350840322b0ee29e | ||
###< symfony/framework-bundle ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
###> symfony/framework-bundle ### | ||
/.env.local | ||
/.env.local.php | ||
/.env.*.local | ||
/config/secrets/prod/prod.decrypt.private.php | ||
/public/bundles/ | ||
/var/ | ||
/vendor/ | ||
###< symfony/framework-bundle ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
DOCKER_COMPOSE = docker-compose | ||
EXEC_PHP = $(DOCKER_COMPOSE) exec php | ||
SYMFONY = $(EXEC_PHP) bin/console | ||
COMPOSER = $(EXEC_PHP) composer | ||
## | ||
## Project main | ||
## ----------------------- | ||
.PHONY: up | ||
up: ## docker compose up | ||
$(DOCKER_COMPOSE) up --remove-orphans --no-recreate --detach --build | ||
|
||
.PHONY: down | ||
down: ## Down docker compose | ||
$(DOCKER_COMPOSE) kill | ||
$(DOCKER_COMPOSE) down --remove-orphans | ||
|
||
.PHONY: clear-cache | ||
clear-cache: ## Remove symfony cache and logs | ||
rm -rf var/logs var/cache | ||
|
||
.PHONY: cache-warmup | ||
cache-warmup: clear-cache vendor ## Symfony cache warmup | ||
$(SYMFONY) cache:warmup | ||
|
||
.PHONY: rebuild | ||
rebuild: vendor clear-cache cache-warmup ## Rebuild project | ||
|
||
vendor: composer.lock ## Install vendor | ||
$(COMPOSER) install | ||
touch vendor | ||
|
||
## | ||
## run shell | ||
## ----------------------- | ||
.PHONY: bash-php | ||
bash-php: ## bash in php container | ||
$(EXEC_PHP) bash | ||
|
||
## | ||
## help | ||
## ----------------------- | ||
|
||
.PHONY: help | ||
help: ## Outputs this help screen | ||
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-24s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m## /[33m/' && printf "\n" | ||
|
||
.DEFAULT_GOAL := help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
use App\Kernel; | ||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
|
||
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) { | ||
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".'); | ||
} | ||
|
||
require_once dirname(__DIR__).'/vendor/autoload_runtime.php'; | ||
|
||
return function (array $context) { | ||
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); | ||
|
||
return new Application($kernel); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"type": "project", | ||
"license": "proprietary", | ||
"minimum-stability": "stable", | ||
"prefer-stable": true, | ||
"require": { | ||
"php": ">=8.0.2", | ||
"ext-ctype": "*", | ||
"ext-iconv": "*", | ||
"symfony/console": "6.0.*", | ||
"symfony/dotenv": "6.0.*", | ||
"symfony/flex": "^2", | ||
"symfony/framework-bundle": "6.0.*", | ||
"symfony/runtime": "6.0.*", | ||
"symfony/twig-bundle": "6.0.*", | ||
"symfony/yaml": "6.0.*" | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"composer/package-versions-deprecated": true, | ||
"symfony/flex": true, | ||
"symfony/runtime": true | ||
}, | ||
"optimize-autoloader": true, | ||
"preferred-install": { | ||
"*": "dist" | ||
}, | ||
"sort-packages": true | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"App\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"App\\Tests\\": "tests/" | ||
} | ||
}, | ||
"replace": { | ||
"symfony/polyfill-ctype": "*", | ||
"symfony/polyfill-iconv": "*", | ||
"symfony/polyfill-php72": "*", | ||
"symfony/polyfill-php73": "*", | ||
"symfony/polyfill-php74": "*", | ||
"symfony/polyfill-php80": "*" | ||
}, | ||
"scripts": { | ||
"auto-scripts": { | ||
"cache:clear": "symfony-cmd", | ||
"assets:install %PUBLIC_DIR%": "symfony-cmd" | ||
}, | ||
"post-install-cmd": [ | ||
"@auto-scripts" | ||
], | ||
"post-update-cmd": [ | ||
"@auto-scripts" | ||
] | ||
}, | ||
"conflict": { | ||
"symfony/symfony": "*" | ||
}, | ||
"extra": { | ||
"symfony": { | ||
"allow-contrib": false, | ||
"require": "6.0.*" | ||
} | ||
} | ||
} |
Oops, something went wrong.