Skip to content

Vs code extensions improvements#40

Merged
brandochn merged 4 commits intomainfrom
vs-code-extensions-improvements
Mar 13, 2026
Merged

Vs code extensions improvements#40
brandochn merged 4 commits intomainfrom
vs-code-extensions-improvements

Conversation

@brandochn
Copy link
Owner

This pull request introduces several improvements to the VS Code extension and the JSON-RPC server, focusing on reliability, initialization order, and cross-language compatibility. The most significant changes are grouped below by theme.

Extension activation reliability and command registration

  • Changed the extension activation event in vscode-extension/package.json from onCommand:lightQueryProfiler.showProfiler to onStartupFinished to ensure the extension is loaded early and the command handler is reliably registered.
  • Refactored activate in vscode-extension/src/extension.ts to register the lightQueryProfiler.showProfiler command immediately at startup, preventing missed command invocations during async initialization. Added deferred panel opening logic to handle cases where the provider is not yet ready. [1] [2]

Logging and diagnostic output

  • Updated logging to write exclusively to stderr, preventing conflicts with the JSON-RPC protocol (which owns stdout). This includes capturing raw stdin/stdout streams at program start and silencing accidental Console writes in src/LightQueryProfiler.JsonRpc/Program.cs. [1] [2]

JSON-RPC server compatibility and serialization

  • Configured the JSON-RPC server to use camelCase property names for serialization, ensuring compatibility with the TypeScript client. This is achieved by setting CamelCasePropertyNamesContractResolver on the JsonMessageFormatter and documenting the serialization in ProfilerEventDto. [1] [2]
  • Annotated all JSON-RPC methods in JsonRpcServer with UseSingleObjectParameterDeserialization = true, preventing parameter-matching errors when called from TypeScript clients. [1] [2] [3] [4]

Miscellaneous improvements

  • Added third-party license notice for highlight.js to LICENSE.md.
  • Added the highlight-vs2015.min.css stylesheet for syntax highlighting in the extension.

These changes collectively improve extension startup reliability, cross-language communication, and maintain compliance with third-party licensing.

- Introduced EventFilter interface to define filter criteria for profiler events.
- Added commands for applying and clearing filters from the webview.
- Implemented handleApplyFilters and handleClearFilters methods to manage filter state.
- Enhanced event polling to apply filters dynamically, allowing for case-insensitive substring matches.
- Added a search bar to the profiler panel for quick event searching, with navigation for previous and next matches.
- Updated UI to include filter modal and search bar, improving user experience for managing event data.
- Refactored event rendering to support new filtering and searching capabilities.
@brandochn brandochn merged commit 90eedaf into main Mar 13, 2026
1 check passed
@brandochn brandochn deleted the vs-code-extensions-improvements branch March 13, 2026 23:32
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.

1 participant