Skip to content

Conversation

@Patotking12
Copy link

Added build integration to the VSCode extension with a task provider that runs simc, parses compiler errors into diagnostics, and shows a status bar with the Simfony version.

Also added code snippets for common patterns and custom file icons for .simf and .wit files.

On the LSP side, implemented document symbols for the outline view, signature help for function parameter hints, semantic tokens for AST-based highlighting of functions and namespaces, and witness file validation that checks types and reports missing or extra fields in real-time.

@Patotking12 Patotking12 requested a review from delta1 as a code owner January 22, 2026 23:15
@delta1
Copy link
Collaborator

delta1 commented Jan 23, 2026

Thanks @Patotking12 ! Could you please run rustfmt and eslint, see the CI jobs

@Patotking12
Copy link
Author

Done! Fixed the eslint issue. CI should pass now. @delta1

}

throw new Error(
"simc compiler not found. Install it with: cargo install --path . " +
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to leave a link to SimplicityHL readme, because cargo install --path . don't do anything on it's own

Copy link
Author

Choose a reason for hiding this comment

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

Updated to link to the README instead

Comment on lines 843 to 850
if !value_str.starts_with("0x") {
if let Some(pos) = find_value_position(text, name, "value") {
diagnostics.push(Diagnostic::new_simple(
Range::new(pos, pos),
format!("Witness '{}' value must start with '0x' (hex format)", name),
));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The witness is not required to be a hex number

Copy link
Author

Choose a reason for hiding this comment

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

Good catch, totally slipped my mind to remove that

The witness validation was added as a basic example to show we can validate .wit files in real-time (checking JSON structure, required fields)

)
}

/// Validate a witness (.wit) file and return diagnostics.
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if the functions below could be moved into utils.rs

Copy link
Author

Choose a reason for hiding this comment

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

Good suggestion, moved the helper functions to utils.rs for better organization

Also moved the related tests to utils.rs since the functions they test now live there

Comment on lines +137 to +143
// Parse simc error output into VSCode diagnostics.
// Error format:
// |
// 1 | let a1: List<u32, 5> = None;
// | ^^^^^^ Expected a power of two...
public parseErrors(output: string): vscode.Diagnostic[] {
const diagnostics: vscode.Diagnostic[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we already have diagnostics via LSP?
The language server output matches simc, so it's essentially showing the same problem twice.

Copy link
Author

Choose a reason for hiding this comment

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

The compiler diagnostics are intentional, they show the actual simc output when you run a build command

The LSP provides real-time feedback while editing, but the compiler is the source of truth

There is some overlap when both report the same error, but the compiler output is useful for the build workflow as it shows exactly what simc says. Happy to remove if you think it's too redundant

@gerau
Copy link
Contributor

gerau commented Jan 23, 2026

I don't think we need to add more examples to vscode/examples. While it's good to showcase the extension's capabilities, we already have examples in this repo.

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.

3 participants