Repository navigation
feat: Add {{fn:}}/{{ft:}}/{{attr:}} YAML language support #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
533eb0c
feat: add hover/go-to-definition and linting for {{fn:}}/{{ft:}}/{{at…
oeisenberg 47b0328
fix: address Copilot review findings on YAML tag support
oeisenberg 701ec48
fix: address second round of Copilot review findings
oeisenberg 18efe67
fix: address third round of Copilot review findings
oeisenberg 89bb47f
refactor: use a real YAML parser for variant-attribute resolution
oeisenberg 3327398
fix: don't treat block-scalar lines starting with # as YAML comments
oeisenberg d4eccbc
fix: recognize hyphenated attribute names in {{attr:}} references
oeisenberg 0f94b27
Revert "fix: recognize hyphenated attribute names in {{attr:}} refere…
oeisenberg d605843
chore: remove built dist files from PR
oeisenberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Contributing | ||
|
|
||
| ## Running the extension locally | ||
|
|
||
| 1. Open this `adk-extension` folder in VS Code (not a target agent project — the debug config lives here). | ||
| 2. Press **F5** (or Run and Debug panel → ▶ "Run Extension", if F5 is intercepted by macOS Dictation — see below). | ||
| 3. This compiles the extension and opens a separate **Extension Development Host** window with it loaded. `.vscode/launch.json` is configured to: | ||
| - open `agent-deployments/agents` in that window automatically, so you can expand into whichever project you want to test against (e.g. `paratha/...`) — this assumes `agent-deployments` is checked out as a sibling of `adk-extension`; if yours lives elsewhere, update the path in `.vscode/launch.json` | ||
| - disable the marketplace-installed copy of this extension (`--disable-extension=polyai.adk-extension`) in that window, so you're only ever testing your local changes, not a stale installed version shadowing them | ||
| - run with **`noDebug: true`** by default (the "Run Extension" config) — see below for why | ||
| 4. Run `yarn watch` in a terminal to recompile on save, then **Cmd+R** in the Extension Development Host window to reload with your changes. | ||
|
|
||
| ### Why "Run Extension" skips the debugger | ||
|
|
||
| F5 normally attaches VS Code's Node debugger to the extension host, which requires a handshake to complete within ~10s or you get **"Extension host did not start in 10 seconds, it might be stopped on the first line and needs a debugger to continue."** On some machines this handshake is flaky and fails most/every launch, leaving the host permanently paused (it was launched with `--inspect-brk`, which blocks on line 1 until a debugger attaches — if the attach fails, nothing ever resumes it, so the extension never actually runs). | ||
|
|
||
| Since you don't need breakpoints for most manual testing, `.vscode/launch.json`'s default **"Run Extension"** config sets `"noDebug": true`, which skips the Node inspector/attach step entirely — no handshake, no race, no stuck-on-line-1 host. `console.log`/`debugLog` output still shows up in the Extension Host output channel. | ||
|
|
||
| If you *do* need to set breakpoints in the extension's TypeScript, use the **"Run Extension (with debugging)"** config from the Run and Debug dropdown instead (same setup, debugger attached as normal). | ||
|
|
||
| If a host ever does get stuck paused waiting for a debugger (e.g. you used the debug config and the attach failed), you can unstick it without restarting by sending the paused process a resume command directly over its inspector port, instead of retrying the attach: | ||
| ```sh | ||
| # find the stuck process's inspector port from its command line (ps aux | grep inspect-brk), | ||
| # then get its websocket debugger URL and send it the resume command: | ||
| curl -s http://127.0.0.1:<port>/json # read the "webSocketDebuggerUrl" | ||
| node -e " | ||
| const ws = new WebSocket('<webSocketDebuggerUrl>'); | ||
| ws.onopen = () => ws.send(JSON.stringify({id: 1, method: 'Runtime.runIfWaitingForDebugger'})); | ||
| ws.onmessage = () => process.exit(0); | ||
| " | ||
| ``` | ||
|
|
||
| ### macOS: F5 opens Dictation instead of debugging | ||
|
|
||
| On Mac laptops, bare `F5` is often bound system-wide to **Start Dictation** (System Settings → Keyboard → Dictation), which intercepts the key before VS Code sees it. Options: | ||
|
|
||
| - Disable/rebind the Dictation shortcut in System Settings → Keyboard → Dictation. | ||
| - Use `Fn+F5` instead of plain `F5`. | ||
| - Rebind VS Code's own shortcut (Code → Settings → Keyboard Shortcuts → "Debug: Start Debugging"). | ||
| - Or just skip the key entirely: Run and Debug panel (`Cmd+Shift+D`) → click the green ▶ "Run Extension". | ||
|
|
||
| ## Running tests | ||
|
|
||
| ```sh | ||
| yarn test | ||
| ``` | ||
|
|
||
| This runs `vscode-test`: it downloads/launches a real headless VS Code instance and runs the Mocha suite in `src/test/*.test.ts` against it. It's non-interactive by design — for manually poking at the extension's behavior, use the F5 flow above instead. | ||
|
|
||
| If `yarn test` fails with a lockfile error, run `yarn install` first. | ||
|
|
||
| If it fails with `spawn .../Contents/MacOS/Electron ENOENT`, your `@vscode/test-electron` version is too old for the VS Code build it downloaded (VS Code renamed its macOS executable from `Electron` to `Code` in 1.110+). Make sure `@vscode/test-electron` is `^3.1.0` or newer in `package.json`, then `yarn install` again. | ||
|
|
||
| ## Linting | ||
|
|
||
| ```sh | ||
| yarn lint | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.