sr-sql README
extension which applies to sql files
Features
Requirements
build
npm run compile
or f5 to launch extension in debug mode
Installation
browse to this link:
https://marketplace.visualstudio.com/items?itemName=SteveRichter.sr-sql
click install
or CTRL+SHIFT+P
type "Extensions: Install from VSIX..."
select the .vsix file you created
publish
- Update the version number in package.json
- Run
vsce package to create the .vsix file
- Run
vsce publish to publish the new version to the marketplace
todo
when hover over php function call show the function definition in a popup.
code a php reference provider. Show all references to a php function.
offshoot extensions
sr-shippet-prompt was created as standalone extension. It provides a snippet prompt facility where snippets are prompted as ghost text and then selected from the keyboard and possibly with a hover provider. This extension also organizes snippets into a tree where the user navigates the tree to find and select the desired snippet.
features
SQL goto definition. When the cursor is on a procedure name in a "call" statement, vscode will open the .sql file of the sql procedure.
SQL hover provider. When hovering over the object name in an SQL create statement, a popup will appear with a "show" button. Click the button to show SQL definition info for the object. Use this to show that the object exists on the server.
SQL - when editing an SQL file, the extension places a "run" button which when clicked, calls the runSqlFile command. This command will run the SQL file on the server and show the results in a new output window.
PHP function definition provider. Press F12 with the cursor located in the name of a function call. The extension search for the PHP function declare code and instruct vscode to position the cursor at the function definition.
Javascript action definition provider. When the positioned at source line containst the pattern: action:'action_name', search the PHP files for $action == 'action_name'. If found, instruct vscode to position the cursor at the found PHP code.
- see the
sr-sql.config.json configuration section below for how to specify additional folders to search for .php files.
Javascript definition provider for Vue.js style member function definitions. When the cursor is on a function call, search the current document for Vue.js style member function definitions and if a match is found, instruct vscode to position the cursor at the function definition.
Javascript definition provider for document.getElementById('xxxxx') pattern. When the cursor is on the xxxxx part of that pattern, search the HTML files in the same folder as the js file for an element with id="xxxxx". If found, goto the definition of that ID= element in the HTML file.
DSPF semantic token provider. Provides syntax highlighting for IBM i DSPF source files based on semantic tokens.
Localhost URL to clipboard. Right-clicking on an HTML or PHP file in the explorer, the localhost URL of that web file will be copied to the clipboard.
HTML features
HTML inline completion provider. For now, type and the extension will suggest an alert div block.
HTML VUE defintion provider. Press F12 within index.html to find the definition of variable or event handler in the app.mjs file.
HTML definition provider. Press F12 on an id="xxxxx" attribute to goto the document.getElementById code in the app.mjs file in the folder of the HTML file.
HTML - goto definition of the component file of a vue component.
snippet prompt facility where snippets are prompted as ghost text and then selected by typing the index of the desired snippet.
sr-sql.config.json configuration file
{
"php-search-folders": [".."]
}
javascript goto definition provider will read the sr-sql-config.json file in the folder of the javascript file from which definitions are being requested in .php files. Use the php-search-folders property to specify additional folders to search for .php files.
Extension Settings
Known Issues
Release Notes
1.0.0
Initial release of ...