The extension contains three parts:
- extension core
- results tab
- settings page
This part of the extension contains business logic. Init webview for results and settings, run certoraRun
script, watch *.sol
, *.spec
and *.conf
files, function for creating *.conf
file, navigate to code.
Technologies:
TypeScript, VSCode API, Axios.
Used parts of VSCode API:
- API for create Results tab webview
- API for create Settings page webview
- APIs for navigate to code: openTextDocument, showTextDocument, revealRange
- API for watching files
- API for find files
- QuickPick API (the dropdown for select .conf file before run the script)
- Webview Documentation
Built with Svelte + TypeScript + PostCSS, @vscode/codicons, @vscode/webview-ui-toolkit
- The function for getting progress url
export function getProgressUrl(text: string): string | null {
if (!text.includes('You can follow up on the status:')) return null
const urlRegex = /(https?:\/\/[^\s]+)/g
const urlMatches = text.match(urlRegex)
if (urlMatches) {
const [url] = urlMatches
return url.includes('jobStatus')
? url.replace('jobStatus', 'progress')
: null
}
return null
}
If stdout in the certoraRun
script changes, then the extension will break.
- We don't validate the Settings form, so a user can create an incorrect
conf
file.
- Install dependencies and build
svelte
files
yarn
yarn dev:svelte
- Press F5 to run the extension
- Build
*.vsix
file
npx vsce package
- Press
CTRL/CMD + Shift + P
- Run command
Developer: Open Webview Developer Tools
- You will see log for any action
- Log item structure
{
action: string // action description
source: 'Results webview' | 'Settings webview' | 'Extension' // The part of the extension in which the action was called
info?: any // Any additional information
}
- Issue tracker — GitHub Issues
- Issue title format
[Type] Task
Possible types:
- Results - Results tab in the activity bar
- Settings - Webview with form for creating a configuration file
- Extension - Tasks related to the VSCode extension
- Infrastructure - linters, tasks, githooks, etc.
- All - tasks related to the project
For example:
[Results] Realize VSCode Panel component
- Issue description format
Without format. Write as needed
- Branch name format
feature/{short description}
bug/{short description}
- Commit name format
#{issue number}: What did you do
- Issue labels (task status)
To do
In progress
In review
Done
- Naming
Use kebab-case for directories
mock-files
Use case same exported entity
export function getIconPath(path: string) {
return mediaPath + path
}
getIconPath.ts
Use PascalCase for UI components
TreeItem.svelte