├── .gitignore ├── images ├── icon.png ├── vscode-delphi-keybindings-logo-readme.png └── icon.svg ├── .gitmodules ├── l10n └── bundle.l10n.pt-br.json ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── feature_request.md │ ├── question.md │ └── bug_report.md ├── workflows │ └── main.yml └── copilot-instructions.md ├── .vscodeignore ├── tsconfig.json ├── src ├── constants.ts ├── docWikiUriBuilder.ts ├── container.ts ├── test │ ├── runTest.ts │ └── suite │ │ ├── index.ts │ │ ├── extension.test.ts │ │ ├── setupTests.ts │ │ ├── docWikiUriBuilder.test.ts │ │ └── commands.test.ts ├── extension.ts ├── whats-new │ ├── commands.ts │ └── contentProvider.ts └── commands.ts ├── package.nls.json ├── package.nls.pt-br.json ├── .vscode ├── extensions.json ├── tasks.json └── launch.json ├── testworkspace └── test.md ├── CONTRIBUTING.md ├── webpack.config.js ├── README.md ├── CHANGELOG.md ├── package.json └── LICENSE.md /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | .vscode-test/ 4 | *.vsix 5 | dist -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alefragnani/vscode-delphi-keybindings/HEAD/images/icon.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vscode-whats-new"] 2 | path = vscode-whats-new 3 | url = https://github.com/alefragnani/vscode-whats-new.git 4 | -------------------------------------------------------------------------------- /images/vscode-delphi-keybindings-logo-readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alefragnani/vscode-delphi-keybindings/HEAD/images/vscode-delphi-keybindings-logo-readme.png -------------------------------------------------------------------------------- /l10n/bundle.l10n.pt-br.json: -------------------------------------------------------------------------------- 1 | { 2 | "Open a file first to select word": "Abrir um arquivo antes para selecionar uma palavra", 3 | "Open a file first to locate help in DocWiki": "Abrir um arquivo antes para localizar ajuda no DocWiki" 4 | } -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: alefragnani 2 | patreon: alefragnani 3 | custom: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=EP57F3B6FXKTU&lc=US&item_name=Alessandro%20Fragnani&item_number=vscode%20extensions¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted 4 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | typings/** 4 | **/*.ts 5 | **/*.map 6 | out/** 7 | node_modules/** 8 | .gitignore 9 | tsconfig.json 10 | test/** 11 | *.vsix 12 | package-lock.json 13 | webpack.config.js 14 | **/.github/ 15 | **/.git/** 16 | **/.git 17 | **/.gitmodules 18 | .devcontainer/ -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for the extension 4 | title: "[FEATURE] - " 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "ES2020", 5 | "outDir": "out", 6 | "lib": [ 7 | "ES2020", "DOM" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": ".", 11 | "alwaysStrict": true 12 | }, 13 | "exclude": [ 14 | "node_modules", 15 | ".vscode-test" 16 | ] 17 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask a question about the extension 4 | title: "[QUESTION] - " 5 | labels: question 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/constants.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Alessandro Fragnani. All rights reserved. 3 | * Licensed under the GPLv3 License. See License.md in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | export const DEFAULT_DELPHI_VERSION_FOR_DOCWIKI = "Alexandria"; -------------------------------------------------------------------------------- /package.nls.json: -------------------------------------------------------------------------------- 1 | { 2 | "delphiKeybindings.configuration.title": "Delphi Keymap", 3 | "delphiKeybindings.configuration.delphiVersionInDocWiki.description": "Choose the Delphi version to be used in DocWiki", 4 | "delphiKeybindings.commands.help.title": "Delphi Keymap: DocWiki Help", 5 | "delphiKeybindings.commands.selectWord.title": "Delphi Keymap: Select Word", 6 | "delphiKeybindings.commands.whatsNew.title": "Delphi Keymap: What's New" 7 | } -------------------------------------------------------------------------------- /package.nls.pt-br.json: -------------------------------------------------------------------------------- 1 | { 2 | "delphiKeybindings.configuration.title": "Delphi Keymap", 3 | "delphiKeybindings.configuration.delphiVersionInDocWiki.description": "Escolha a versão do Delphi a ser usada no DocWiki", 4 | "delphiKeybindings.commands.help.title": "Delphi Keymap: Ajuda DocWiki", 5 | "delphiKeybindings.commands.selectWord.title": "Delphi Keymap: Selecionar Palavra", 6 | "delphiKeybindings.commands.whatsNew.title": "Delphi Keymap: Novidades" 7 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help the extension improve 4 | title: "[BUG] - " 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | 12 | 13 | **Environment/version** 14 | 15 | - Extension version: 16 | - VSCode version: 17 | - OS version: 18 | 19 | **Steps to reproduce** 20 | 21 | 1. 22 | 2. 23 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. 3 | // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp 4 | 5 | // List of extensions which should be recommended for users of this workspace. 6 | "recommendations": [ 7 | "dbaeumer.vscode-eslint", 8 | "eamodio.tsl-problem-matcher" 9 | ], 10 | // List of extensions recommended by VS Code that should not be recommended for users of this workspace. 11 | "unwantedRecommendations": [ 12 | 13 | ] 14 | } -------------------------------------------------------------------------------- /src/docWikiUriBuilder.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Alessandro Fragnani. All rights reserved. 3 | * Licensed under the GPLv3 License. See License.md in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { Uri } from "vscode"; 7 | 8 | export function buildDocWikiUri(delphiVersion: string, textToSearchFor: string): Uri { 9 | return Uri.parse(`https://docwiki.embarcadero.com/RADStudio/${delphiVersion}/e/index.php?title=Special%3ASearch&search=${textToSearchFor}&fulltext=Search`); 10 | } -------------------------------------------------------------------------------- /src/container.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Alessandro Fragnani. All rights reserved. 3 | * Licensed under the GPLv3 License. See License.md in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { ExtensionContext } from "vscode"; 7 | 8 | export class Container { 9 | private static _extContext: ExtensionContext; 10 | 11 | public static get context(): ExtensionContext { 12 | return this._extContext; 13 | } 14 | 15 | public static set context(ec: ExtensionContext) { 16 | this._extContext = ec; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "presentation": { 4 | "echo": false, 5 | "reveal": "always", 6 | "focus": false, 7 | "panel": "dedicated", 8 | "showReuseMessage": false 9 | }, 10 | "tasks": [ 11 | { 12 | "type": "npm", 13 | "script": "build", 14 | "group": "build", 15 | "problemMatcher": ["$ts-webpack", "$tslint-webpack"] 16 | }, 17 | { 18 | "type": "npm", 19 | "script": "watch", 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "isBackground": true, 25 | "problemMatcher": ["$ts-webpack-watch", "$tslint-webpack-watch"] 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /src/test/runTest.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | import { runTests } from '@vscode/test-electron'; 4 | 5 | async function main() { 6 | try { 7 | // The folder containing the Extension Manifest package.json 8 | // Passed to `--extensionDevelopmentPath` 9 | const extensionDevelopmentPath = path.resolve(__dirname, '../../../'); 10 | 11 | // The path to test runner 12 | // Passed to --extensionTestsPath 13 | const extensionTestsPath = path.resolve(__dirname, './suite/index'); 14 | 15 | // Download VS Code, unzip it and run the integration test 16 | await runTests({ 17 | extensionDevelopmentPath, 18 | extensionTestsPath, 19 | launchArgs:[ 20 | './testworkspace', 21 | ]}); 22 | } catch (err) { 23 | console.error(err); 24 | console.error('Failed to run tests'); 25 | process.exit(1); 26 | } 27 | } 28 | 29 | main(); 30 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | # Controls when the action will run. Triggers the workflow on push or pull request 4 | # events but only for the master branch 5 | on: 6 | push: 7 | branches: [ master ] 8 | pull_request: 9 | branches: [ master ] 10 | 11 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 12 | jobs: 13 | build: 14 | strategy: 15 | matrix: 16 | os: [macos-latest, ubuntu-latest, windows-latest] 17 | runs-on: ${{ matrix.os }} 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v4 21 | with: 22 | submodules: true 23 | - name: Install Node.js 24 | uses: actions/setup-node@v4 25 | with: 26 | node-version: 20.x 27 | - run: npm install 28 | - run: xvfb-run -a npm test 29 | if: runner.os == 'Linux' 30 | - run: npm test 31 | if: runner.os != 'Linux' 32 | -------------------------------------------------------------------------------- /src/test/suite/index.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | import * as Mocha from 'mocha'; 3 | import * as glob from 'glob'; 4 | 5 | export function run(): Promise { 6 | // Create the mocha test 7 | const mocha = new Mocha({ 8 | ui: 'tdd', 9 | color: true 10 | }); 11 | 12 | const testsRoot = path.resolve(__dirname, '..'); 13 | 14 | return new Promise((c, e) => { 15 | glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { 16 | if (err) { 17 | return e(err); 18 | } 19 | 20 | // Add files to the test suite 21 | files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); 22 | 23 | try { 24 | // Run the mocha test 25 | mocha.run(failures => { 26 | if (failures > 0) { 27 | e(new Error(`${failures} tests failed.`)); 28 | } else { 29 | c(); 30 | } 31 | }); 32 | } catch (err) { 33 | console.error(err); 34 | e(err); 35 | } 36 | }); 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /src/extension.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Alessandro Fragnani. All rights reserved. 3 | * Licensed under the GPLv3 License. See License.md in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | 'use strict'; 7 | // The module 'vscode' contains the VS Code extensibility API 8 | // Import the module and reference it with the alias vscode in your code below 9 | import * as vscode from 'vscode'; 10 | 11 | import { registerWhatsNew } from "./whats-new/commands"; 12 | import { Container } from './container'; 13 | import { registerCommands } from './commands'; 14 | 15 | // this method is called when your extension is activated 16 | // your extension is activated the very first time the command is executed 17 | export function activate(context: vscode.ExtensionContext) { 18 | 19 | Container.context = context; 20 | 21 | registerCommands(); 22 | registerWhatsNew(); 23 | 24 | } -------------------------------------------------------------------------------- /src/test/suite/extension.test.ts: -------------------------------------------------------------------------------- 1 | import * as assert from 'assert'; 2 | 3 | // You can import and use all API from the 'vscode' module 4 | // as well as import your extension to test it 5 | import * as vscode from 'vscode'; 6 | 7 | const timeout = async (ms = 200) => new Promise(resolve => setTimeout(resolve, ms)); 8 | 9 | suite('Extension Test Suite', () => { 10 | let extension: vscode.Extension; 11 | vscode.window.showInformationMessage('Start all tests.'); 12 | 13 | suiteSetup(() => { 14 | extension = vscode.extensions.getExtension('alefragnani.delphi-keybindings') as vscode.Extension; 15 | }); 16 | 17 | test('Sample test', () => { 18 | assert.equal(-1, [1, 2, 3].indexOf(5)); 19 | assert.equal(-1, [1, 2, 3].indexOf(0)); 20 | }); 21 | 22 | test('Activation test', async () => { 23 | await extension.activate(); 24 | assert.equal(extension.isActive, true); 25 | }); 26 | 27 | test('Extension loads in VSCode and is active', async () => { 28 | await timeout(1500); 29 | assert.equal(extension.isActive, true); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /src/test/suite/setupTests.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Alessandro Fragnani. All rights reserved. 3 | * Licensed under the GPLv3 License. See License.md in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import * as vscode from 'vscode'; 7 | import { DEFAULT_DELPHI_VERSION_FOR_DOCWIKI } from '../../constants'; 8 | 9 | export async function setupTestSuite(originalValues) { 10 | originalValues.delphiVersionInDocWiki = vscode.workspace.getConfiguration("delphiKeybindings").get("delphiVersionInDocWiki", DEFAULT_DELPHI_VERSION_FOR_DOCWIKI); 11 | 12 | await vscode.workspace.getConfiguration('delphiKeybindings').update('delphiVersionInDocWiki', 'Seattle'); 13 | } 14 | 15 | export async function teardownTestSuite(originalValues) { 16 | await vscode.workspace.getConfiguration('delphiKeybindings').update('delphiVersionInDocWiki', originalValues.delphiVersionInDocWiki); 17 | } -------------------------------------------------------------------------------- /src/test/suite/docWikiUriBuilder.test.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Alessandro Fragnani. All rights reserved. 3 | * Licensed under the GPLv3 License. See License.md in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import * as assert from 'assert'; 7 | import { buildDocWikiUri } from '../../docWikiUriBuilder'; 8 | 9 | suite('DocWikiUriBuilder Test Suite', () => { 10 | test('can build a DocWiki Uri', async () => { 11 | // opens a file 12 | const delphiVersion = 'Alexandria'; 13 | const textToSearchFor = 'test'; 14 | const uri = buildDocWikiUri(delphiVersion, textToSearchFor); 15 | 16 | // assert - the new select must be `thank` 17 | assert.ok(uri.scheme === 'https'); 18 | assert.ok(uri.authority === 'docwiki.embarcadero.com'); 19 | assert.ok(uri.path === `/RADStudio/${delphiVersion}/e/index.php`); 20 | assert.ok(uri.query === `title=Special:Search&search=${textToSearchFor}&fulltext=Search`); 21 | }); 22 | }); -------------------------------------------------------------------------------- /src/whats-new/commands.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Alessandro Fragnani. All rights reserved. 3 | * Licensed under the GPLv3 License. See License.md in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { commands } from "vscode"; 7 | import { Container } from "../container"; 8 | import { WhatsNewManager } from "../../vscode-whats-new/src/Manager"; 9 | import { DelphiKeybindingsContentProvider, DelphiKeybindingsSocialMediaProvider } from "./contentProvider"; 10 | 11 | export async function registerWhatsNew() { 12 | const provider = new DelphiKeybindingsContentProvider(); 13 | const viewer = new WhatsNewManager(Container.context) 14 | .registerContentProvider("alefragnani", "delphi-keybindings", provider) 15 | .registerSocialMediaProvider(new DelphiKeybindingsSocialMediaProvider()) 16 | await viewer.showPageInActivation(); 17 | Container.context.subscriptions.push(commands.registerCommand('delphiKeybindings.whatsNew', () => viewer.showPage())) 18 | } 19 | -------------------------------------------------------------------------------- /images/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 12 | VSMK_KeymapDelphi_128x nobg 13 | 14 | 16 | 19 | 20 | 23 | 24 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | { 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "Launch Extension", 7 | "type": "extensionHost", 8 | "request": "launch", 9 | "runtimeExecutable": "${execPath}", 10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ], 11 | "stopOnEntry": false, 12 | "outFiles": ["${workspaceFolder}/dist/**/*.js"], 13 | // "skipFiles": ["/**", "**/node_modules/**", "**/app/out/vs/**", "**/extensions/**"], 14 | "smartStep": true, 15 | "sourceMaps": true 16 | }, 17 | { 18 | "name": "Launch Tests", 19 | "type": "extensionHost", 20 | "request": "launch", 21 | "runtimeExecutable": "${execPath}", 22 | "args": [ 23 | "${workspaceFolder}/testworkspace", 24 | "--disable-extensions", 25 | "--extensionDevelopmentPath=${workspaceFolder}", 26 | "--extensionTestsPath=${workspaceFolder}/out/src/test/suite/index" 27 | ], 28 | "outFiles": [ 29 | "${workspaceFolder}/out/src/test/**/*.js" 30 | ], 31 | "preLaunchTask": "npm: test-compile" 32 | }, 33 | { 34 | "name": "Run Web Extension in VS Code", 35 | "type": "pwa-extensionHost", 36 | "debugWebWorkerHost": true, 37 | "request": "launch", 38 | "args": [ 39 | "--extensionDevelopmentPath=${workspaceFolder}", 40 | "--extensionDevelopmentKind=web" 41 | ], 42 | "outFiles": ["${workspaceFolder}/dist/**/*.js"], 43 | "preLaunchTask": "npm: watch" 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /src/commands.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Alessandro Fragnani. All rights reserved. 3 | * Licensed under the GPLv3 License. See License.md in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { commands, env, window, workspace, l10n } from "vscode"; 7 | import { selectWordAtCursorPosition } from "vscode-ext-selection"; 8 | import { DEFAULT_DELPHI_VERSION_FOR_DOCWIKI } from "./constants"; 9 | import { Container } from './container'; 10 | import { buildDocWikiUri } from "./docWikiUriBuilder"; 11 | 12 | export function registerCommands() { 13 | 14 | const disposableSelectWord = commands.registerCommand('delphiKeybindings.selectWord', () => { 15 | const editor = window.activeTextEditor; 16 | if (!editor) { 17 | window.showInformationMessage(l10n.t("Open a file first to select word")); 18 | return; 19 | } 20 | const selection = editor.selection; 21 | if (selection.isEmpty) { 22 | selectWordAtCursorPosition(editor); 23 | } 24 | 25 | }); 26 | Container.context.subscriptions.push(disposableSelectWord); 27 | 28 | const disposableHelp = commands.registerCommand('delphiKeybindings.help', () => { 29 | const editor = window.activeTextEditor; 30 | if (!editor) { 31 | window.showInformationMessage(l10n.t("Open a file first to locate help in DocWiki")); 32 | return; 33 | } 34 | const selection = editor.selection; 35 | if (selection.isEmpty) { 36 | selectWordAtCursorPosition(editor); 37 | } 38 | 39 | const delphiVersion = workspace.getConfiguration("delphiKeybindings").get("delphiVersionInDocWiki", DEFAULT_DELPHI_VERSION_FOR_DOCWIKI); 40 | const textToSearchFor = editor.document.getText(editor.selection); 41 | 42 | env.openExternal(buildDocWikiUri(delphiVersion, textToSearchFor)); 43 | }); 44 | Container.context.subscriptions.push(disposableHelp); 45 | 46 | } -------------------------------------------------------------------------------- /testworkspace/test.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | First off all, thank you for taking the time to contribute! 4 | 5 | When contributing to this project, please first discuss the changes you wish to make via an issue before making changes. 6 | 7 | ## Your First Code Contribution 8 | 9 | Unsure where to begin contributing? You can start by looking through the [`help wanted`](https://github.com/alefragnani/vscode-delphi-keybindings/labels/help%20wanted) issues. 10 | 11 | ### Getting the code 12 | 13 | ``` 14 | git clone https://github.com/alefragnani/vscode-delphi-keybindings.git 15 | ``` 16 | 17 | Prerequisites 18 | 19 | - [Git](https://git-scm.com/), `>= 2.22.0` 20 | - [NodeJS](https://nodejs.org/), `>= 10.14.17` 21 | 22 | ### Dependencies 23 | 24 | From a terminal, where you have cloned the repository, execute the following command to install the required dependencies: 25 | 26 | ``` 27 | npm install 28 | ``` 29 | 30 | ### Build / Watch 31 | 32 | From inside VS Code, run `Tasks: Run Task Build`. It **Builds** the extension in **Watch Mode**. 33 | 34 | This will first do an initial full build and then watch for file changes, compiling those changes incrementally, enabling a fast, iterative coding experience. 35 | 36 | > **Tip!** You can press Cmd+Shift+B (Ctrl+Shift+B on Windows, Linux) to start the watch task. 37 | 38 | > **Tip!** You don't need to stop and restart the development version of Code after each change. You can just execute `Reload Window` from the command palette. 39 | 40 | ### Linting 41 | 42 | This project uses [ESLint](https://eslint.org/) for code linting. You can run ESLint across the code by calling `npm run lint` from a terminal. Warnings from ESLint show up in the `Errors and Warnings` quick box and you can navigate to them from inside VS Code. 43 | 44 | To lint the code as you make changes you can install the [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) extension. 45 | 46 | ### Debugging 47 | 48 | 1. Open the `vscode-delphi-keybindings` folder 49 | 2. Ensure the required [dependencies](#dependencies) are installed 50 | 3. Choose the `Launch Extension` launch configuration from the launch dropdown in the Run and Debug viewlet and press `F5`. 51 | 52 | ## Submitting a Pull Request 53 | 54 | Be sure your branch is up to date (relative to `master`) and submit your PR. Also add reference to the issue the PR refers to. -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | First off all, thank you for taking the time to contribute! 4 | 5 | When contributing to this project, please first discuss the changes you wish to make via an issue before making changes. 6 | 7 | ## Your First Code Contribution 8 | 9 | Unsure where to begin contributing? You can start by looking through the [`help wanted`](https://github.com/alefragnani/vscode-delphi-keybindings/labels/help%20wanted) issues. 10 | 11 | ### Getting the code 12 | 13 | ``` 14 | git clone https://github.com/alefragnani/vscode-delphi-keybindings.git 15 | ``` 16 | 17 | Prerequisites 18 | 19 | - [Git](https://git-scm.com/), `>= 2.22.0` 20 | - [NodeJS](https://nodejs.org/), `>= 10.14.17` 21 | 22 | ### Dependencies 23 | 24 | From a terminal, where you have cloned the repository, execute the following command to install the required dependencies: 25 | 26 | ``` 27 | git submodule init 28 | git submodule update 29 | npm install 30 | ``` 31 | 32 | ### Build / Watch 33 | 34 | From inside VS Code, run `Tasks: Run Task Build`. It **Builds** the extension in **Watch Mode**. 35 | 36 | This will first do an initial full build and then watch for file changes, compiling those changes incrementally, enabling a fast, iterative coding experience. 37 | 38 | > **Tip!** You can press Cmd+Shift+B (Ctrl+Shift+B on Windows, Linux) to start the watch task. 39 | 40 | > **Tip!** You don't need to stop and restart the development version of Code after each change. You can just execute `Reload Window` from the command palette. 41 | 42 | ### Linting 43 | 44 | This project uses [ESLint](https://eslint.org/) for code linting. You can run ESLint across the code by calling `npm run lint` from a terminal. Warnings from ESLint show up in the `Errors and Warnings` quick box and you can navigate to them from inside VS Code. 45 | 46 | To lint the code as you make changes you can install the [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) extension. 47 | 48 | ### Debugging 49 | 50 | 1. Open the `vscode-delphi-keybindings` folder 51 | 2. Ensure the required [dependencies](#dependencies) are installed 52 | 3. Choose the `Launch Extension` launch configuration from the launch dropdown in the Run and Debug viewlet and press `F5`. 53 | 54 | ## Submitting a Pull Request 55 | 56 | Be sure your branch is up to date (relative to `master`) and submit your PR. Also add reference to the issue the PR refers to. 57 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Alessandro Fragnani. All rights reserved. 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 7 | //@ts-check 8 | 9 | 'use strict'; 10 | 11 | const path = require('path'); 12 | const TerserPlugin = require('terser-webpack-plugin'); 13 | const webpack = require('webpack'); 14 | 15 | 16 | /**@type {import('webpack').Configuration}*/ 17 | const config = { 18 | entry: "./src/extension.ts", 19 | optimization: { 20 | minimizer: [new TerserPlugin({ 21 | parallel: true, 22 | extractComments: false, 23 | terserOptions: { 24 | ecma: 2020, 25 | keep_classnames: false, 26 | mangle: true, 27 | module: true, 28 | format: { 29 | comments: false 30 | } 31 | } 32 | })], 33 | }, 34 | 35 | devtool: 'source-map', 36 | externals: { 37 | vscode: "commonjs vscode" // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/ 38 | }, 39 | resolve: { // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader 40 | extensions: ['.ts', '.js'] 41 | }, 42 | module: { 43 | rules: [{ 44 | test: /\.ts$/, 45 | exclude: /node_modules/, 46 | use: [{ 47 | loader: 'ts-loader', 48 | }] 49 | }] 50 | }, 51 | } 52 | 53 | const nodeConfig = { 54 | ...config, 55 | target: "node", 56 | output: { // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ 57 | path: path.resolve(__dirname, 'dist'), 58 | filename: 'extension-node.js', 59 | libraryTarget: "commonjs2", 60 | devtoolModuleFilenameTemplate: "../[resource-path]", 61 | }, 62 | } 63 | 64 | const webConfig = { 65 | ...config, 66 | target: "webworker", 67 | output: { // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ 68 | path: path.resolve(__dirname, 'dist'), 69 | filename: 'extension-web.js', 70 | libraryTarget: "commonjs2", 71 | devtoolModuleFilenameTemplate: "../[resource-path]", 72 | } 73 | } 74 | 75 | module.exports = [webConfig, nodeConfig]; 76 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![](https://vsmarketplacebadges.dev/version-short/alefragnani.delphi-keybindings.svg)](https://marketplace.visualstudio.com/items?itemName=alefragnani.delphi-keybindings) 2 | [![](https://vsmarketplacebadges.dev/downloads-short/alefragnani.delphi-keybindings.svg)](https://marketplace.visualstudio.com/items?itemName=alefragnani.delphi-keybindings) 3 | [![](https://vsmarketplacebadges.dev/rating-short/alefragnani.delphi-keybindings.svg)](https://marketplace.visualstudio.com/items?itemName=alefragnani.delphi-keybindings) 4 | [![](https://img.shields.io/github/actions/workflow/status/alefragnani/vscode-delphi-keybindings/main.yml?branch=master)](https://github.com/alefragnani/vscode-delphi-keybindings/actions?query=workflow%3ACI) 5 | 6 |

7 |
8 | Delphi Keymap Logo 9 |

10 | 11 | # What's new in Delphi Keymap 9.8 12 | 13 | * Published to **Open VSX** 14 | * Adds **Localization** support 15 | * Adds new setting to choose Delphi release for `DocWiki` 16 | * Adds **Web** support 17 | 18 | # Support 19 | 20 | **Delphi Keymap** is an open source extension created for **Visual Studio Code**. While being free and open source, if you find it useful, please consider supporting it. 21 | 22 | 23 | 24 | 27 | 30 | 33 | 34 |
25 | 26 | 28 | 29 | 31 | 32 |
35 | 36 | # Delphi Keymap 37 | 38 | This extension ports popular **Delphi** keyboard shortcuts to **Visual Studio Code**. 39 | 40 | # Features 41 | 42 | ## Shortcuts included 43 | 44 | You can see all the keyboard shortcuts in the extension's contribution list. Check some of them: 45 | 46 | Command | Keyboard Shortcut | | Command | Keyboard Shortcut 47 | ------- | ----------------- | - |------- | ----------------- 48 | Save All | Ctrl + Shift + S | | Find / Replace | Ctrl + H 49 | Format | Ctrl + D | | Go To Line | Alt + G 50 | IDE Insight | Ctrl + . | | Find Local References | Shift + Ctrl + Enter 51 | Refactor / Rename | Ctrl + Shift + E | | Find Original Symbol | Ctrl + G 52 | Comment Line | Ctrl + ; | | Compile | Ctrl + F9 53 | Redo | Alt + Shift + Backspace | | Run | F9 | 54 | Delete Line | Ctrl + Y | | Step Over | F8 55 | Show Snippets | Ctrl + J | | Step Into | F7 56 | Help Insight | Ctrl + Shift + H | | Toggle Breakpoint | F5 57 | Help | F1 | | Evaluate/Modify | Ctrl + F7 58 | 59 | ## Available Settings 60 | 61 | * Choose the Delphi version to be used in DocWiki (`Alexandria` by default) 62 | ```json 63 | "delphiKeybindings.delphiVersionInDocWiki": "Tokyo" 64 | ``` 65 | 66 | ## Bookmarks 67 | 68 | If you are looking for the same **Bookmarks** experience from **Delphi**, try out my [Numbered Bookmarks](https://marketplace.visualstudio.com/items?itemName=alefragnani.numbered-bookmarks) extension :wink: 69 | 70 | ## License 71 | 72 | [GPL-3.0](LICENSE.md) © Alessandro Fragnani -------------------------------------------------------------------------------- /src/test/suite/commands.test.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Alessandro Fragnani. All rights reserved. 3 | * Licensed under the GPLv3 License. See License.md in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import * as vscode from 'vscode'; 7 | import * as assert from 'assert'; 8 | import * as sinon from 'sinon'; 9 | import { setupTestSuite, teardownTestSuite } from './setupTests'; 10 | 11 | suite('selectWord command', () => { 12 | 13 | // suiteSetup(() => 14 | // ); 15 | 16 | test('can select word', async () => { 17 | // opens a file 18 | const filename = vscode.Uri.joinPath(vscode.workspace.workspaceFolders[0].uri, 'test.md'); 19 | const doc = await vscode.workspace.openTextDocument(filename); 20 | await vscode.window.showTextDocument(doc); 21 | 22 | // put the cursor at the `thank` word 23 | const sel = new vscode.Selection(new vscode.Position(2, 16), new vscode.Position(2, 16)); 24 | vscode.window.activeTextEditor.selection = sel; 25 | 26 | // runs the command 27 | await vscode.commands.executeCommand('delphiKeybindings.selectWord'); 28 | 29 | // get the newly selected text 30 | const currentSelection = vscode.window.activeTextEditor.selection; 31 | const newRange = new vscode.Range(currentSelection.start, currentSelection.end); 32 | const text = vscode.window.activeTextEditor.document.getText(newRange); 33 | 34 | // assert - the new select must be `thank` 35 | assert.ok(text === 'thank'); 36 | }); 37 | 38 | test('cannot select word on empty space', async () => { 39 | // opens a file 40 | const filename = vscode.Uri.joinPath(vscode.workspace.workspaceFolders[0].uri, 'test.md'); 41 | const doc = await vscode.workspace.openTextDocument(filename); 42 | await vscode.window.showTextDocument(doc); 43 | 44 | // put the cursor at an empty line 45 | const sel = new vscode.Selection(new vscode.Position(3, 0), new vscode.Position(3, 0)); 46 | vscode.window.activeTextEditor.selection = sel; 47 | 48 | // runs the command 49 | await vscode.commands.executeCommand('delphiKeybindings.selectWord'); 50 | 51 | // get the newly selected text (which must be empty) 52 | const currentSelection = vscode.window.activeTextEditor.selection; 53 | const newRange = new vscode.Range(currentSelection.start, currentSelection.end); 54 | const text = vscode.window.activeTextEditor.document.getText(newRange); 55 | 56 | // assert - the new select must be `thank` 57 | assert.ok(text === ''); 58 | }); 59 | 60 | test('cannot select word if no file is open', async () => { 61 | // closes all files 62 | await vscode.commands.executeCommand('workbench.action.closeAllEditors'); 63 | 64 | const mock = sinon.mock(vscode.window); 65 | const expectation = mock.expects('showInformationMessage'); 66 | 67 | // runs the command 68 | await vscode.commands.executeCommand('delphiKeybindings.selectWord'); 69 | 70 | mock.restore(); 71 | 72 | // assert - must be called 73 | assert(expectation.calledOnce); 74 | }); 75 | }); 76 | 77 | suite('DocWiki command', () => { 78 | 79 | const originalValue = {}; 80 | suiteSetup(async () => await setupTestSuite(originalValue)); 81 | suiteTeardown(async () => await teardownTestSuite(originalValue)); 82 | 83 | test('can call docwiki for some word', async () => { 84 | // opens a file 85 | const filename = vscode.Uri.joinPath(vscode.workspace.workspaceFolders[0].uri, 'test.md'); 86 | const doc = await vscode.workspace.openTextDocument(filename); 87 | await vscode.window.showTextDocument(doc); 88 | 89 | // put the cursor at the `thank` word 90 | const sel = new vscode.Selection(new vscode.Position(2, 16), new vscode.Position(2, 16)); 91 | vscode.window.activeTextEditor.selection = sel; 92 | 93 | const mock = sinon.mock(vscode.env); 94 | const expectation = mock.expects('openExternal'); 95 | 96 | // runs the command 97 | await vscode.commands.executeCommand('delphiKeybindings.help'); 98 | 99 | mock.restore(); 100 | 101 | // assert - must be called 102 | assert(expectation.calledOnce); 103 | assert(expectation.calledOnceWith(vscode.Uri.parse('https://docwiki.embarcadero.com/RADStudio/Seattle/e/index.php?title=Special%3ASearch&search=thank&fulltext=Search'))); 104 | }); 105 | 106 | test('cannot call docwiki if no file is open', async () => { 107 | // closes all files 108 | await vscode.commands.executeCommand('workbench.action.closeAllEditors'); 109 | 110 | const mock = sinon.mock(vscode.window); 111 | const expectation = mock.expects('showInformationMessage'); 112 | 113 | // runs the command 114 | await vscode.commands.executeCommand('delphiKeybindings.help'); 115 | 116 | mock.restore(); 117 | 118 | // assert - must be called 119 | assert(expectation.calledOnce); 120 | }); 121 | }); -------------------------------------------------------------------------------- /src/whats-new/contentProvider.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Alessandro Fragnani. All rights reserved. 3 | * Licensed under the GPLv3 License. See License.md in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { ChangeLogItem, ChangeLogKind, ContentProvider, Header, Image, IssueKind, SocialMediaProvider, SupportChannel } from "../../vscode-whats-new/src/ContentProvider"; 7 | 8 | export class DelphiKeybindingsContentProvider implements ContentProvider { 9 | 10 | provideHeader(logoUrl: string): Header { 11 | return
{logo: {src: logoUrl, height: 50, width: 50}, 12 | message: `Delphi Keybindings ports popular Delphi keyboard shortcuts 13 | to Visual Studio Code, so you can take your muscle memory and feel 14 | like you were using Delphi.`}; 15 | } 16 | 17 | provideChangeLog(): ChangeLogItem[] { 18 | const changeLog: ChangeLogItem[] = []; 19 | 20 | changeLog.push({ kind: ChangeLogKind.VERSION, detail: { releaseNumber: "9.8.1", releaseDate: "January 2025" } }); 21 | changeLog.push({ 22 | kind: ChangeLogKind.INTERNAL, 23 | detail: { 24 | message: "Security Alert: webpack", 25 | id: 84, 26 | kind: IssueKind.PR, 27 | kudos: "dependabot" 28 | } 29 | }); 30 | changeLog.push({ 31 | kind: ChangeLogKind.INTERNAL, 32 | detail: { 33 | message: "Security Alert: braces", 34 | id: 82, 35 | kind: IssueKind.PR, 36 | kudos: "dependabot" 37 | } 38 | }); 39 | 40 | changeLog.push({ kind: ChangeLogKind.VERSION, detail: { releaseNumber: "9.8.0", releaseDate: "February 2024" } }); 41 | changeLog.push({ 42 | kind: ChangeLogKind.NEW, 43 | detail: { 44 | message: "Publish to Open VSX", 45 | id: 47, 46 | kind: IssueKind.Issue, 47 | } 48 | }); 49 | changeLog.push({ 50 | kind: ChangeLogKind.CHANGED, 51 | detail: { 52 | message: "Avoid What's New when using Gitpod", 53 | id: 80, 54 | kind: IssueKind.Issue, 55 | } 56 | }); 57 | changeLog.push({ 58 | kind: ChangeLogKind.CHANGED, 59 | detail: { 60 | message: "Avoid What's New when installing lower versions", 61 | id: 80, 62 | kind: IssueKind.Issue, 63 | } 64 | }); 65 | changeLog.push({ 66 | kind: ChangeLogKind.INTERNAL, 67 | detail: { 68 | message: "Security Alert: word-wrap", 69 | id: 81, 70 | kind: IssueKind.PR, 71 | kudos: "dependabot" 72 | } 73 | }); 74 | changeLog.push({ 75 | kind: ChangeLogKind.INTERNAL, 76 | detail: { 77 | message: "Security Alert: webpack", 78 | id: 78, 79 | kind: IssueKind.PR, 80 | kudos: "dependabot" 81 | } 82 | }); 83 | 84 | changeLog.push({ kind: ChangeLogKind.VERSION, detail: { releaseNumber: "9.7.0", releaseDate: "January 2023" } }); 85 | changeLog.push({ 86 | kind: ChangeLogKind.INTERNAL, 87 | detail: { 88 | message: "Support Translation and Localization APIs", 89 | id: 70, 90 | kind: IssueKind.Issue 91 | } 92 | }); 93 | changeLog.push({ 94 | kind: ChangeLogKind.INTERNAL, 95 | detail: { 96 | message: "Support Implicit Activation Events", 97 | id: 74, 98 | kind: IssueKind.Issue 99 | } 100 | }); 101 | changeLog.push({ 102 | kind: ChangeLogKind.INTERNAL, 103 | detail: { 104 | message: "Update badges in README", 105 | id: 76, 106 | kind: IssueKind.Issue 107 | } 108 | }); 109 | changeLog.push({ 110 | kind: ChangeLogKind.INTERNAL, 111 | detail: { 112 | message: "Security Alert: minimatch", 113 | id: 72, 114 | kind: IssueKind.PR, 115 | kudos: "dependabot" 116 | } 117 | }); 118 | 119 | return changeLog; 120 | } 121 | 122 | provideSupportChannels(): SupportChannel[] { 123 | const supportChannels: SupportChannel[] = []; 124 | supportChannels.push({ 125 | title: "Become a sponsor on GitHub", 126 | link: "https://github.com/sponsors/alefragnani", 127 | message: "Become a Sponsor" 128 | }); 129 | supportChannels.push({ 130 | title: "Donate via PayPal", 131 | link: "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=EP57F3B6FXKTU&lc=US&item_name=Alessandro%20Fragnani&item_number=vscode%20extensions¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted", 132 | message: "Donate via PayPal" 133 | }); 134 | return supportChannels; 135 | } 136 | } 137 | 138 | export class DelphiKeybindingsSocialMediaProvider implements SocialMediaProvider { 139 | public provideSocialMedias() { 140 | return [{ 141 | title: "Follow me on Twitter", 142 | link: "https://www.twitter.com/alefragnani" 143 | }]; 144 | } 145 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [9.8.1] - 2025-02-03 2 | ### Internal 3 | - Security Alert: webpack (dependabot [PR #84](https://github.com/alefragnani/vscode-delphi-keybindings/pull/84)) 4 | - Security Alert: braces (dependabot [PR #82](https://github.com/alefragnani/vscode-delphi-keybindings/pull/82)) 5 | 6 | ## [9.8.0] - 2024-03-28 7 | ### Added 8 | - Published to Open VSX (issue [#47](https://github.com/alefragnani/vscode-delphi-keybindings/issues/47)) 9 | 10 | ### Changed 11 | - Avoid What's New when using Gitpod (issue [#80](https://github.com/alefragnani/vscode-delphi-keybindings/issues/80)) 12 | - Avoid What's New when installing lower versions (issue [#80](https://github.com/alefragnani/vscode-delphi-keybindings/issues/80)) 13 | 14 | ### Internal 15 | - Security Alert: word-wrap (dependabot [PR #81](https://github.com/alefragnani/vscode-delphi-keybindings/pull/81)) 16 | - Security Alert: webpack (dependabot [PR #78](https://github.com/alefragnani/vscode-delphi-keybindings/pull/78)) 17 | 18 | ## [9.7.1] - 2023-02-13 19 | ### Fixed 20 | - Typo in What's New 21 | 22 | ## [9.7.0] - 2023-02-13 23 | ### Internal 24 | - Support **Translation** and **Localization** APIs (issue [#70](https://github.com/alefragnani/vscode-delphi-keybindings/issues/70)) 25 | - Support Implicit Activation Events (issue [#74](https://github.com/alefragnani/vscode-delphi-keybindings/issues/74)) 26 | - Update badges in README (issue [#76](https://github.com/alefragnani/vscode-delphi-keybindings/issues/76)) 27 | - Security Alert: minimatch (dependabot [PR #72](https://github.com/alefragnani/vscode-delphi-keybindings/pull/72)) 28 | 29 | ## [9.6.0] - 2022-10-01 30 | ### Added 31 | - New `Search for Units` keybinding (issue [#59](https://github.com/alefragnani/vscode-delphi-keybindings/issues/59)) 32 | - Update `DocWiki` command to use Alexandria release (issue [#61](https://github.com/alefragnani/vscode-delphi-keybindings/issues/61)) 33 | - Setting to choose Delphi release for `DocWiki` command (issue [#62](https://github.com/alefragnani/vscode-delphi-keybindings/issues/62)) 34 | 35 | ### Internal 36 | - Package cleanup (issue [#55](https://github.com/alefragnani/vscode-delphi-keybindings/issues/55)) 37 | - Add tests (issue [#66](https://github.com/alefragnani/vscode-delphi-keybindings/issues/66)) 38 | - Improve extension startup (issue [#54](https://github.com/alefragnani/vscode-delphi-keybindings/issues/54)) 39 | - Security Alert: terser (dependabot [PR #67](https://github.com/alefragnani/vscode-delphi-keybindings/pull/67)) 40 | 41 | ## [9.5.1] - 2022-07-17 42 | ### Internal 43 | - Add GitHub Sponsors support (PR [#53](https://github.com/alefragnani/vscode-delphi-keybindings/pull/53)) 44 | 45 | ## [9.5.0] - 2022-03-29 46 | ### Internal 47 | - Add Web support (issue [#42](https://github.com/alefragnani/vscode-delphi-keybindings/issues/42)) 48 | - Change license do GPLv3 (issue [#50](https://github.com/alefragnani/vscode-delphi-keybindings/issues/50)) 49 | 50 | ## [9.4.0] - 2021-11-07 51 | ### Internal 52 | - Add CONTRIBUTING documentation (issue [#43](https://github.com/alefragnani/vscode-delphi-keybindings/issues/43)) 53 | - Update dependencies (issue [#45](https://github.com/alefragnani/vscode-delphi-keybindings/issues/45)) 54 | 55 | ## [9.3.0] - 2021-05-31 56 | ### Added 57 | - Support **Workspace Trust** (issue [#39](https://github.com/alefragnani/vscode-delphi-keybindings/issues/39)) 58 | - Support **Virtual Workspaces** (issue [#38](https://github.com/alefragnani/vscode-delphi-keybindings/issues/38)) 59 | 60 | ### Internal 61 | - Do not show welcome message if installed by Settings Sync (issue [#22](https://github.com/alefragnani/vscode-delphi-keybindings/issues/22)) 62 | - Security Alert: lodash (dependabot [PR #37](https://github.com/alefragnani/vscode-delphi-keybindings/pull/37)) 63 | - Security Alert: ssri (dependabot [PR #25](https://github.com/alefragnani/vscode-delphi-keybindings/pull/25)) 64 | - Security Alert: y18n (dependabot [PR #24](https://github.com/alefragnani/vscode-delphi-keybindings/pull/24)) 65 | - Security Alert: elliptic (dependabot [PR #21](https://github.com/alefragnani/vscode-delphi-keybindings/pull/21)) 66 | - Security Alert: ini (dependabot [PR #20](https://github.com/alefragnani/vscode-delphi-keybindings/pull/20)) 67 | 68 | ## [9.2.1] - 2020-11-17 69 | ### Fixed 70 | - Word navigation (issue [#17](https://github.com/alefragnani/vscode-delphi-keybindings/issues/17)) 71 | 72 | ## [9.2.0] - 2020-09-18 73 | ### Added 74 | - **Codespaces** support (issue [#16](https://github.com/alefragnani/vscode-delphi-keybindings/issues/16)) 75 | 76 | ## [9.1.0] - 2020-08-03 77 | ### Internal 78 | - Migrate from TSLint to ESLint (issue [#13](https://github.com/alefragnani/vscode-delphi-keybindings/issues/13)) 79 | - Security Alert: elliptic (dependabot [PR #14](https://github.com/alefragnani/vscode-delphi-keybindings/pull/14)) 80 | - Security Alert: acorn (dependabot [PR #11](https://github.com/alefragnani/vscode-delphi-keybindings/pull/11)) 81 | 82 | ## [9.0.0] - 2020-02-08 83 | ### Changed 84 | - DocWiki command now uses Rio URL (issue [#9](https://github.com/alefragnani/vscode-delphi-keybindings/issues/9)) 85 | 86 | ### Internal 87 | - Use vscode-ext-selection NPM Package 88 | - Support VS Code package split 89 | 90 | ## [8.1.0] - 2019-05-04 91 | ### Added 92 | - **Remote Development** support (Thanks to @mjbvz [PR #6](https://github.com/alefragnani/vscode-delphi-keybindings/pull/6)) 93 | 94 | ## [8.0.2] - 2019-03-13 95 | ### Fixed 96 | - What's New page broken in VS Code 1.32 due to CSS API changes 97 | 98 | ## [8.0.1] - 2019-02-09 99 | ### Internal 100 | * Remove `package-lock.json` from published extension 101 | 102 | ## [8.0.0] - 2019-02-09 103 | ### Fixed 104 | * Replace command should be `Ctrl + R` (issue [#2](https://github.com/alefragnani/vscode-delphi-keybindings/issues/2)) 105 | 106 | ### Internal 107 | * Use new VS Code API - Open Resource in Browser (issue [#3](https://github.com/alefragnani/vscode-delphi-keybindings/issues/3)) 108 | * Use WebPack for publishing (issue [#4](https://github.com/alefragnani/vscode-delphi-keybindings/issues/4)) 109 | 110 | ## [7.1.0] - 2019-01-18 111 | ### Changed 112 | * Replace NPM package based on security alerts (open -> opn) 113 | 114 | ## [7.0.0] - 2018-11-30 115 | ### Added 116 | * What's New 117 | 118 | ## [6.1.0] - 2018-09-14 119 | ### Added 120 | * Patreon button 121 | 122 | ## [6.0.0] - 2018-05-06 123 | ### Changed 124 | * New publishing/versioning model 125 | 126 | ### Fixed 127 | * `Format Document` keybinding was not working (issue [#1](https://github.com/alefragnani/vscode-delphi-keybindings/issues/1)) 128 | 129 | ## [0.5.0] - 2018-01-25 130 | ### Added 131 | * New Tokyo shortcuts 132 | 133 | ## [0.4.0] - 2017-09-03 134 | ### Changed 135 | * Marketplace's icon 136 | 137 | ## [0.3.0] - 2017-05-28 138 | ### Added 139 | * More shortcuts 140 | 141 | ## [0.2.0] - 2017-05-11 142 | ### Added 143 | * More shortcuts 144 | 145 | ## [0.1.0] - 2016-10-29 146 | 147 | * Initial release -------------------------------------------------------------------------------- /.github/copilot-instructions.md: -------------------------------------------------------------------------------- 1 | # VSCode Delphi Keybindings Extension 2 | 3 | Always follow these instructions first and only fall back to additional search and context gathering if the information in the instructions is incomplete or found to be in error. 4 | 5 | This is a VSCode extension that provides popular Delphi keyboard shortcuts and commands for Visual Studio Code. It includes keybindings for debugging, editing, navigation, and two custom commands (Help and Select Word). 6 | 7 | ## Working Effectively 8 | 9 | ### Dependencies and Setup 10 | - Prerequisites: Git (>= 2.22.0), Node.js (>= 10.14.17) - Current tested with Node.js 20.x 11 | - ALWAYS run these setup commands in order: 12 | ``` 13 | git submodule init 14 | git submodule update 15 | npm install 16 | ``` 17 | - Setup takes ~15 seconds total. NEVER CANCEL during npm install. 18 | - **Note**: npm install may show webpack warnings during installation but will complete successfully. 19 | 20 | ### Build and Development 21 | - **Build**: `npm run build` - Takes ~3 seconds. NEVER CANCEL. 22 | - **Production build**: `npm run vscode:prepublish` - Takes ~4 seconds, creates minified output 23 | - **Watch mode**: `npm run watch` or `npm run webpack-dev` - Runs webpack in watch mode for development 24 | - **Compile**: `npm run compile` - TypeScript compilation only (~2 seconds) 25 | - **Clean build**: Delete `out/` and `dist/` directories, then run build commands 26 | 27 | ### Linting and Code Quality 28 | - **Lint**: `npm run lint` - Takes ~1 second. Expect 3 warnings (acceptable) 29 | - Always run `npm run lint` before committing changes 30 | - Uses ESLint with TypeScript rules 31 | - Warnings about `any` types in test files are acceptable 32 | 33 | ### Testing 34 | - **IMPORTANT**: Tests require internet connectivity to download VS Code 35 | - **Full test suite**: `npm test` - May fail in network-restricted environments 36 | - Tests include compilation, linting, and VS Code extension tests 37 | - Test compilation: `npm run test-compile` - Compiles TypeScript and webpack 38 | - If tests fail due to network (ENOTFOUND update.code.visualstudio.com), this is expected in sandboxed environments 39 | 40 | ## File Structure and Key Locations 41 | 42 | ### Important Directories 43 | - `src/` - Main TypeScript source code 44 | - `src/test/` - Test files (Mocha + VS Code test framework) 45 | - `dist/` - Webpack build output (extension-node.js, extension-web.js) 46 | - `out/` - TypeScript compilation output 47 | - `vscode-whats-new/` - Git submodule for "What's New" functionality 48 | - `.vscode/` - VS Code workspace configuration (tasks, launch configs) 49 | 50 | ### Key Files 51 | - `package.json` - Extension manifest, scripts, dependencies, keybindings 52 | - `src/extension.ts` - Main extension entry point 53 | - `src/commands.ts` - Custom command implementations (help, selectWord) 54 | - `src/docWikiUriBuilder.ts` - DocWiki URL generation for help command 55 | - `tsconfig.json` - TypeScript configuration 56 | - `webpack.config.js` - Webpack bundling configuration 57 | 58 | ### Development Configuration 59 | - `.vscode/tasks.json` - Build and watch tasks for VS Code 60 | - `.vscode/launch.json` - Debugging configurations including "Launch Extension" 61 | 62 | ## Extension Functionality 63 | 64 | ### Keybindings Provided 65 | The extension maps ~30 Delphi keyboard shortcuts to VS Code commands including: 66 | - **Debugging**: F9 (Run), F8 (Step Over), F7 (Step Into), F5 (Toggle Breakpoint) 67 | - **Editing**: Ctrl+D (Format), Ctrl+Y (Delete Line), Ctrl+; (Comment) 68 | - **Navigation**: Ctrl+G (Go to Declaration), Alt+G (Go to Line) 69 | - **IDE**: Ctrl+. (Command Palette), Ctrl+F9 (Build) 70 | 71 | ### Custom Commands 72 | - `delphiKeybindings.help` (F1) - Opens Delphi DocWiki for selected word 73 | - `delphiKeybindings.selectWord` (Ctrl+W) - Selects word at cursor 74 | - `delphiKeybindings.whatsNew` - Shows extension changelog 75 | 76 | ## Validation and Testing Scenarios 77 | 78 | ### Manual Validation Steps 79 | 1. **Build validation**: Ensure `npm run build` succeeds and creates files in `dist/` 80 | 2. **Lint validation**: Run `npm run lint` and verify only expected warnings 81 | 3. **Extension loading**: Use VS Code "Launch Extension" debug configuration 82 | 4. **Command testing**: In launched extension host, test F1 and Ctrl+W commands 83 | 5. **Keybinding testing**: Verify common Delphi shortcuts work (F9, Ctrl+D, etc.) 84 | 85 | ### Development Workflow 86 | 1. Make code changes in `src/` 87 | 2. Run `npm run build` to compile and bundle 88 | 3. Run `npm run lint` to check code quality 89 | 4. Test in VS Code using "Launch Extension" configuration 90 | 5. For continuous development, use `npm run watch` or VS Code Build task (Ctrl+Shift+B) 91 | 92 | ### VS Code Development 93 | - Open folder in VS Code 94 | - Press F5 or use "Launch Extension" to open extension development host 95 | - Use Ctrl+Shift+B to start watch task for automatic rebuilds 96 | - Use "Reload Window" in extension development host to reload after changes 97 | 98 | ## Settings and Configuration 99 | 100 | ### Extension Settings 101 | - `delphiKeybindings.delphiVersionInDocWiki` - Choose Delphi version for DocWiki (Alexandria, Sydney, Rio, Tokyo, Berlin, Seattle) 102 | 103 | ### Common Build Issues 104 | - **Missing submodules**: Run `git submodule init && git submodule update` 105 | - **ESLint pattern errors**: Ensure `vscode-whats-new/` submodule is initialized 106 | - **Network test failures**: Expected in sandboxed environments - focus on build and lint validation 107 | - **Webpack warnings during npm install**: These are normal and npm install will complete successfully 108 | - **Clean build needed**: Delete `out/` and `dist/` directories, then run build commands 109 | 110 | ## CI and Production 111 | - GitHub Actions workflow tests on macOS, Ubuntu, Windows with Node.js 16.x 112 | - Production build: `npm run vscode:prepublish` (webpack in production mode) 113 | - Extension supports both desktop and web VS Code environments 114 | - Published to VS Code Marketplace and Open VSX Registry 115 | 116 | ## Time Expectations 117 | - **Setup (submodules + npm install)**: 15 seconds - NEVER CANCEL 118 | - **Build (webpack)**: 3 seconds - NEVER CANCEL 119 | - **Production build**: 4 seconds - NEVER CANCEL 120 | - **Lint**: 1 second 121 | - **TypeScript compile**: 2 seconds 122 | - **Watch mode startup**: 3 seconds initial build 123 | - **Tests**: May timeout due to VS Code download requirements - focus on build/lint validation instead 124 | 125 | ## Quick Reference 126 | 127 | ### Common Directory Contents 128 | ``` 129 | Repository root: 130 | ├── .github/ # GitHub configuration 131 | ├── .vscode/ # VS Code workspace settings 132 | ├── src/ # Main TypeScript source 133 | │ ├── test/ # Test files 134 | │ ├── whats-new/ # What's New functionality 135 | │ ├── extension.ts # Main entry point 136 | │ └── commands.ts # Custom commands 137 | ├── vscode-whats-new/ # Git submodule 138 | ├── dist/ # Webpack output (created by build) 139 | ├── out/ # TypeScript output (created by compile) 140 | ├── package.json # Project manifest and scripts 141 | └── tsconfig.json # TypeScript configuration 142 | ``` 143 | 144 | ### Expected Build Outputs 145 | After successful build, `dist/` should contain: 146 | - **Development build**: `extension-node.js` (~130KB), `extension-web.js` (~130KB) 147 | - **Production build**: `extension-node.js` (~44KB), `extension-web.js` (~44KB) - minified 148 | - Corresponding `.map` files for debugging -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "delphi-keybindings", 3 | "displayName": "Delphi Keymap", 4 | "description": "Popular Delphi keybindings for Visual Studio Code", 5 | "version": "9.8.1", 6 | "publisher": "alefragnani", 7 | "galleryBanner": { 8 | "color": "#476e83", 9 | "theme": "dark" 10 | }, 11 | "engines": { 12 | "vscode": "^1.74.0" 13 | }, 14 | "categories": [ 15 | "Keymaps" 16 | ], 17 | "keywords": [ 18 | "keybindings", 19 | "keymap", 20 | "delphi" 21 | ], 22 | "activationEvents": [ 23 | "onStartupFinished" 24 | ], 25 | "extensionKind": [ 26 | "ui", 27 | "workspace" 28 | ], 29 | "capabilities": { 30 | "virtualWorkspaces": true, 31 | "untrustedWorkspaces": { 32 | "supported": true 33 | } 34 | }, 35 | "main": "./dist/extension-node.js", 36 | "browser": "./dist/extension-web.js", 37 | "l10n": "./l10n", 38 | "icon": "images/icon.png", 39 | "license": "GPL-3.0", 40 | "homepage": "https://github.com/alefragnani/vscode-delphi-keybindings/blob/master/README.md", 41 | "repository": { 42 | "type": "git", 43 | "url": "https://github.com/alefragnani/vscode-delphi-keybindings.git" 44 | }, 45 | "bugs": { 46 | "url": "https://github.com/alefragnani/vscode-delphi-keybindings/issues" 47 | }, 48 | "sponsor": { 49 | "url": "https://github.com/sponsors/alefragnani" 50 | }, 51 | "contributes": { 52 | "configuration": { 53 | "title": "%delphiKeybindings.configuration.title%", 54 | "properties": { 55 | "delphiKeybindings.delphiVersionInDocWiki": { 56 | "type": "string", 57 | "default": "Alexandria", 58 | "description": "%delphiKeybindings.configuration.delphiVersionInDocWiki.description%", 59 | "enum": [ 60 | "Alexandria", 61 | "Sydney", 62 | "Rio", 63 | "Tokyo", 64 | "Berlin", 65 | "Seattle" 66 | ], 67 | "enumDescriptions": [ 68 | "Delphi 11 Alexandria", 69 | "Delphi 10.4 Sydney", 70 | "Delphi 10.3 Rio", 71 | "Delphi 10.2 Tokyo", 72 | "Delphi 10.1 Berlin", 73 | "Delphi 10 Seattle" 74 | ] 75 | } 76 | } 77 | }, 78 | "commands": [ 79 | { 80 | "command": "delphiKeybindings.help", 81 | "title": "%delphiKeybindings.commands.help.title%" 82 | }, 83 | { 84 | "command": "delphiKeybindings.selectWord", 85 | "title": "%delphiKeybindings.commands.selectWord.title%" 86 | }, 87 | { 88 | "command": "delphiKeybindings.whatsNew", 89 | "title": "%delphiKeybindings.commands.whatsNew.title%" 90 | } 91 | ], 92 | "keybindings": [ 93 | { 94 | "mac": "f9", 95 | "win": "f9", 96 | "linux": "f9", 97 | "key": "f9", 98 | "command": "workbench.action.debug.start", 99 | "when": "!inDebugMode" 100 | }, 101 | { 102 | "mac": "f9", 103 | "win": "f9", 104 | "linux": "f9", 105 | "key": "f9", 106 | "command": "workbench.action.debug.continue", 107 | "when": "inDebugMode" 108 | }, 109 | { 110 | "mac": "f8", 111 | "win": "f8", 112 | "linux": "f8", 113 | "key": "f8", 114 | "command": "workbench.action.debug.stepOver", 115 | "when": "inDebugMode" 116 | }, 117 | { 118 | "mac": "f7", 119 | "win": "f7", 120 | "linux": "f7", 121 | "key": "f7", 122 | "command": "workbench.action.debug.stepInto", 123 | "when": "inDebugMode" 124 | }, 125 | { 126 | "mac": "shift+f8", 127 | "win": "shift+f8", 128 | "linux": "shift+f8", 129 | "key": "shift+f8", 130 | "command": "workbench.action.debug.stepOut", 131 | "when": "inDebugMode" 132 | }, 133 | { 134 | "mac": "cmd+f2", 135 | "win": "ctrl+f2", 136 | "linux": "ctrl+f2", 137 | "key": "ctrl+f2", 138 | "command": "workbench.action.debug.stop", 139 | "when": "inDebugMode" 140 | }, 141 | { 142 | "mac": "f4", 143 | "win": "f4", 144 | "linux": "f4", 145 | "key": "f4", 146 | "command": "editor.debug.action.runToCursor", 147 | "when": "inDebugMode" 148 | }, 149 | { 150 | "mac": "f5", 151 | "win": "f5", 152 | "linux": "f5", 153 | "key": "f5", 154 | "command": "editor.debug.action.toggleBreakpoint", 155 | "when": "editorTextFocus" 156 | }, 157 | { 158 | "mac": "cmd+f7", 159 | "win": "ctrl+f7", 160 | "linux": "ctrl+f7", 161 | "key": "ctrl+f7", 162 | "command": "editor.debug.action.selectionToWatch", 163 | "when": "inDebugMode" 164 | }, 165 | { 166 | "mac": "ctrl+f9", 167 | "win": "ctrl+f9", 168 | "linux": "ctrl+f9", 169 | "key": "ctrl+f9", 170 | "command": "workbench.action.tasks.build" 171 | }, 172 | { 173 | "mac": "cmd+d", 174 | "win": "ctrl+d", 175 | "linux": "ctrl+d", 176 | "key": "ctrl+d", 177 | "command": "editor.action.formatDocument", 178 | "when": "editorTextFocus && !editorReadonly" 179 | }, 180 | { 181 | "mac": "cmd+r", 182 | "win": "ctrl+r", 183 | "linux": "ctrl+r", 184 | "key": "ctrl+r", 185 | "command": "editor.action.startFindReplaceAction", 186 | "when": "editorTextFocus && !editorReadonly" 187 | }, 188 | { 189 | "mac": "cmd+.", 190 | "win": "ctrl+.", 191 | "linux": "ctrl+.", 192 | "key": "ctrl+.", 193 | "command": "workbench.action.showCommands" 194 | }, 195 | { 196 | "mac": "alt+g", 197 | "win": "alt+g", 198 | "linux": "alt+g", 199 | "key": "alt+g", 200 | "command": "workbench.action.gotoLine" 201 | }, 202 | { 203 | "mac": "cmd+g", 204 | "win": "ctrl+g", 205 | "linux": "ctrl+g", 206 | "key": "ctrl+g", 207 | "command": "editor.action.goToDeclaration", 208 | "when": "editorHasDefinitionProvider && editorTextFocus" 209 | }, 210 | { 211 | "mac": "cmd+shift+e", 212 | "win": "ctrl+shift+e", 213 | "linux": "ctrl+shift+e", 214 | "key": "ctrl+shift+e", 215 | "command": "editor.action.rename", 216 | "when": "editorHasRenameProvider && editorTextFocus && !editorReadonly" 217 | }, 218 | { 219 | "mac": "cmd+;", 220 | "win": "ctrl+;", 221 | "linux": "ctrl+;", 222 | "key": "ctrl+;", 223 | "command": "editor.action.commentLine", 224 | "when": "editorTextFocus && !editorReadonly" 225 | }, 226 | { 227 | "mac": "cmd+f12", 228 | "win": "ctrl+f12", 229 | "linux": "ctrl+f12", 230 | "key": "ctrl+f12", 231 | "command": "workbench.action.quickOpen" 232 | }, 233 | { 234 | "mac": "alt+f7", 235 | "win": "alt+f7", 236 | "linux": "alt+f7", 237 | "key": "alt+f7", 238 | "command": "editor.action.marker.prev", 239 | "when": "editorFocus && !editorReadonly" 240 | }, 241 | { 242 | "mac": "alt+f8", 243 | "win": "alt+f8", 244 | "linux": "alt+f8", 245 | "key": "alt+f8", 246 | "command": "editor.action.marker.next", 247 | "when": "editorFocus && !editorReadonly" 248 | }, 249 | { 250 | "mac": "alt+shift+backspace", 251 | "win": "alt+shift+backspace", 252 | "linux": "alt+shift+backspace", 253 | "key": "alt+shift+backspace", 254 | "command": "redo", 255 | "when": "editorTextFocus && !editorReadonly" 256 | }, 257 | { 258 | "mac": "cmd+y", 259 | "win": "ctrl+y", 260 | "linux": "ctrl+y", 261 | "key": "ctrl+y", 262 | "command": "editor.action.deleteLines", 263 | "when": "editorTextFocus && !editorReadonly" 264 | }, 265 | { 266 | "mac": "cmd+shift+y", 267 | "win": "ctrl+shift+y", 268 | "linux": "ctrl+shift+y", 269 | "key": "ctrl+shift+y", 270 | "command": "deleteAllRight", 271 | "when": "editorTextFocus && !editorReadonly" 272 | }, 273 | { 274 | "mac": "cmd+t", 275 | "win": "ctrl+t", 276 | "linux": "ctrl+t", 277 | "key": "ctrl+t", 278 | "command": "deleteWordEndRight", 279 | "when": "editorTextFocus && !editorReadonly" 280 | }, 281 | { 282 | "mac": "cmd+shift+i", 283 | "win": "ctrl+shift+i", 284 | "linux": "ctrl+shift+i", 285 | "key": "ctrl+shift+i", 286 | "command": "editor.action.indentLines", 287 | "when": "editorTextFocus && !editorReadonly" 288 | }, 289 | { 290 | "mac": "alt+shift+down", 291 | "win": "alt+shift+down", 292 | "linux": "alt+shift+down", 293 | "key": "alt+shift+down", 294 | "command": "cursorColumnSelectDown", 295 | "when": "editorTextFocus" 296 | }, 297 | { 298 | "mac": "alt+shift+up", 299 | "win": "alt+shift+up", 300 | "linux": "alt+shift+up", 301 | "key": "alt+shift+up", 302 | "command": "cursorColumnSelectUp", 303 | "when": "editorTextFocus" 304 | }, 305 | { 306 | "mac": "alt+shift+end", 307 | "win": "alt+shift+end", 308 | "linux": "alt+shift+end", 309 | "key": "alt+shift+end", 310 | "command": "cursorEndSelect", 311 | "when": "editorTextFocus" 312 | }, 313 | { 314 | "mac": "alt+shift+home", 315 | "win": "alt+shift+home", 316 | "linux": "alt+shift+home", 317 | "key": "alt+shift+home", 318 | "command": "cursorHomeSelect", 319 | "when": "editorTextFocus" 320 | }, 321 | { 322 | "mac": "cmd+alt+shift+end", 323 | "win": "ctrl+alt+shift+end", 324 | "linux": "ctrl+alt+shift+end", 325 | "key": "ctrl+alt+shift+end", 326 | "command": "cursorBottomSelect", 327 | "when": "editorTextFocus" 328 | }, 329 | { 330 | "mac": "cmd+alt+shift+home", 331 | "win": "ctrl+alt+shift+home", 332 | "linux": "ctrl+alt+shift+home", 333 | "key": "ctrl+alt+shift+home", 334 | "command": "cursorTopSelect", 335 | "when": "editorTextFocus" 336 | }, 337 | { 338 | "mac": "cmd+j", 339 | "win": "ctrl+j", 340 | "linux": "ctrl+j", 341 | "key": "ctrl+j", 342 | "command": "editor.action.showSnippets", 343 | "when": "editorTextFocus" 344 | }, 345 | { 346 | "mac": "cmd+right", 347 | "win": "ctrl+right", 348 | "linux": "ctrl+right", 349 | "key": "ctrl+right", 350 | "command": "cursorWordRight", 351 | "when": "editorTextFocus" 352 | }, 353 | { 354 | "mac": "cmd+left", 355 | "win": "ctrl+left", 356 | "linux": "ctrl+left", 357 | "key": "ctrl+left", 358 | "command": "cursorWordLeft", 359 | "when": "editorTextFocus" 360 | }, 361 | { 362 | "mac": "cmd+n", 363 | "win": "ctrl+n", 364 | "linux": "ctrl+n", 365 | "key": "ctrl+n", 366 | "command": "editor.action.insertLineAfter", 367 | "when": "editorTextFocus && !editorReadonly" 368 | }, 369 | { 370 | "mac": "cmd+shift+f4", 371 | "win": "ctrl+shift+f4", 372 | "linux": "ctrl+shift+f4", 373 | "key": "ctrl+shift+f4", 374 | "command": "workbench.action.closeOtherEditors" 375 | }, 376 | { 377 | "mac": "cmd+shift+s", 378 | "win": "ctrl+shift+s", 379 | "linux": "ctrl+shift+s", 380 | "key": "ctrl+shift+s", 381 | "command": "workbench.action.files.saveAll" 382 | }, 383 | { 384 | "mac": "cmd+shift+enter", 385 | "win": "ctrl+shift+enter", 386 | "linux": "ctrl+shift+enter", 387 | "key": "ctrl+shift+enter", 388 | "command": "editor.action.referenceSearch.trigger" 389 | }, 390 | { 391 | "mac": "cmd+g", 392 | "win": "ctrl+g", 393 | "linux": "ctrl+g", 394 | "key": "ctrl+g", 395 | "command": "editor.action.goToDeclaration" 396 | }, 397 | { 398 | "mac": "cmd+shift+h", 399 | "win": "ctrl+shift+h", 400 | "linux": "ctrl+shift+h", 401 | "key": "ctrl+shift+h", 402 | "command": "editor.action.showHover" 403 | }, 404 | { 405 | "mac": "cmd+k n", 406 | "win": "ctrl+k n", 407 | "linux": "ctrl+k n", 408 | "key": "ctrl+k n", 409 | "command": "editor.action.transformToUppercase" 410 | }, 411 | { 412 | "mac": "cmd+k o", 413 | "win": "ctrl+k o", 414 | "linux": "ctrl+k o", 415 | "key": "ctrl+k o", 416 | "command": "editor.action.transformToLowercase" 417 | }, 418 | { 419 | "key": "f1", 420 | "command": "delphiKeybindings.help" 421 | }, 422 | { 423 | "mac": "cmd+w", 424 | "win": "ctrl+w", 425 | "linux": "ctrl+w", 426 | "key": "ctrl+w", 427 | "command": "delphiKeybindings.selectWord" 428 | } 429 | ] 430 | }, 431 | "eslintConfig": { 432 | "extends": [ 433 | "vscode-ext" 434 | ] 435 | }, 436 | "scripts": { 437 | "build": "webpack --mode development", 438 | "watch": "webpack --watch --mode development", 439 | "vscode:prepublish": "webpack --mode production", 440 | "webpack": "webpack --mode development", 441 | "webpack-dev": "webpack --mode development --watch", 442 | "compile": "tsc -p ./", 443 | "lint": "eslint -c package.json --ext .ts src", 444 | "pretest": "npm run compile && npm run lint", 445 | "test-compile": "tsc -p ./ && npm run webpack", 446 | "just-test": "node ./out/src/test/runTest.js", 447 | "test": "npm run test-compile && npm run just-test" 448 | }, 449 | "dependencies": { 450 | "vscode-ext-selection": "1.0.1" 451 | }, 452 | "devDependencies": { 453 | "@types/node": "^18.17.0", 454 | "@types/vscode": "^1.73.0", 455 | "@types/mocha": "^9.0.0", 456 | "@types/glob": "^7.1.4", 457 | "@types/sinon": "10.0.13", 458 | "@vscode/test-electron": "^2.5.2", 459 | "@typescript-eslint/eslint-plugin": "^6.0.0", 460 | "@typescript-eslint/parser": "^6.0.0", 461 | "eslint": "^8.1.0", 462 | "eslint-config-vscode-ext": "^1.1.0", 463 | "terser-webpack-plugin": "^5.2.4", 464 | "glob": "^7.1.7", 465 | "mocha": "^11.1.0", 466 | "sinon": "14.0.0", 467 | "ts-loader": "^9.2.5", 468 | "typescript": "^5.3.3", 469 | "webpack": "^5.94.0", 470 | "webpack-cli": "^4.8.0" 471 | } 472 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . --------------------------------------------------------------------------------