Skip to content

add vscode extension from tip of internal codebase#51

Merged
gotwarlost merged 3 commits intomainfrom
vscode
Mar 31, 2026
Merged

add vscode extension from tip of internal codebase#51
gotwarlost merged 3 commits intomainfrom
vscode

Conversation

@gotwarlost
Copy link
Copy Markdown
Collaborator

This also includes fixes for suggestions by copilot and claude in a different PR

This also includes fixes for suggestions by copilot and claude
in a different PR

Signed-off-by: gotwarlost <krishnan.anantheswaran@elastic.co>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a VS Code extension (language config + syntax highlighting + LSP client) for the function-hcl DSL, and updates the release workflow to build and publish platform-specific VSIX packages that bundle the language server binary.

Changes:

  • Introduces a new vscode/ extension project with HCL TextMate grammar, language configuration, and an LSP client that launches function-hcl-ls.
  • Adds build tooling (esbuild bundling + binary download/extract script) and contributor docs for local dev/testing/packaging.
  • Extends the GitHub release workflow to produce and publish VS Code Marketplace artifacts per target platform.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vscode/tsconfig.json TypeScript compiler configuration for the extension project.
vscode/test-files/secret.hcl Sample HCL fixture file for local/manual testing.
vscode/syntaxes/hcl.tmGrammar.json TextMate grammar for HCL syntax highlighting.
vscode/src/test/extension.test.ts Mocha-based extension test scaffold.
vscode/src/languageServer.ts Helper to locate the bundled language server binary.
vscode/src/extension.ts Extension activation + LanguageClient startup and server path resolution.
vscode/package.json Extension manifest, scripts, deps, and settings contribution points.
vscode/language-configuration.json Editor behaviors for HCL (comments/brackets/folding).
vscode/eslint.config.mjs ESLint configuration for TypeScript sources.
vscode/esbuild.js Bundles the extension into dist/extension.js.
vscode/build/downloadServer.mjs Downloads/extracts function-hcl-ls into vscode/bin/.
vscode/README.md High-level extension overview and licensing attribution.
vscode/HACKING.md Dev/build/test/publish instructions for contributors.
vscode/.vscodeignore Packaging excludes for the VSIX.
vscode/.vscode/tasks.json VS Code tasks for build/watch using npm scripts.
vscode/.vscode/settings.json Workspace settings for the extension project.
vscode/.vscode/launch.json Launch configuration for Extension Development Host debugging.
vscode/.vscode/extensions.json Recommended VS Code extensions for contributors.
vscode/.vscode-test.mjs @vscode/test-cli test runner config.
vscode/.gitignore Ignores build outputs and downloaded binaries for the extension project.
.github/workflows/release.yaml Builds tarballs + VSIX per target and publishes VSIX to Marketplace during releases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: gotwarlost <krishnan.anantheswaran@elastic.co>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 22 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: gotwarlost <krishnan.anantheswaran@elastic.co>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 88 to 92
- name: Create archive checksums
run: |
cd dist
shasum -a 256 *.tar.gz > checksums.txt

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cd dist here assumes the dist/ directory exists, but the workflow never creates it (and the earlier go build -o ../dist/... outputs won’t create parent directories). Add a mkdir -p dist step early in the build job (before any build output is written) to avoid failures on a fresh runner.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +93 to +98
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 1
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job uploads dist/ as an artifact, but the workflow never creates the dist/ directory explicitly. If the earlier build steps don't create it (e.g., due to a failure before any output is written), actions/upload-artifact will error on a missing path. Consider adding an explicit mkdir -p dist (and/or if-no-files-found: error) before uploading to make failures clearer and avoid missing-path errors.

Copilot uses AI. Check for mistakes.
Comment on lines +123 to +130
async function downloadFile(url, targetPath) {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
const fileStream = createWriteStream(targetPath);
await pipeline(response.body, fileStream);
}
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Node's built-in fetch, response.body is a Web ReadableStream, but stream/promises.pipeline expects Node streams; this can throw at runtime. Convert the body to a Node stream (e.g., via Readable.fromWeb(response.body)) before piping, or use await response.arrayBuffer()/fs.writeFile to write the file.

Copilot uses AI. Check for mistakes.
@gotwarlost gotwarlost merged commit dfa79f5 into main Mar 31, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants