Remove old workspace collection#33
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes the old workspace diagnostic collection and modernizes the diagnostic handling approach by leveraging the language client's built-in diagnostic capabilities instead of maintaining a separate collection.
Key changes:
- Removed the custom
_workspaceDiagnosticcollection from theCtxclass - Updated the language client configuration to remove custom diagnostic middleware
- Modified the workspace syntax checking to use the language client's diagnostic collection
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| editor/src/ctx.ts | Removed custom workspace diagnostic collection and simplified language client setup |
| editor/src/commands.ts | Updated workspace syntax checking to use language client's diagnostic collection |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
editor/src/ctx.ts
Outdated
| StreamInfo, | ||
| Diagnostic |
There was a problem hiding this comment.
The Diagnostic import is added but appears unused after removing the custom diagnostic middleware. Consider removing this unused import.
| StreamInfo, | |
| Diagnostic | |
| StreamInfo |
editor/src/ctx.ts
Outdated
| import { Logger } from "./logger"; | ||
| import { existsSync, readdirSync, rmdirSync, rm } from "fs"; | ||
| import * as path from "path"; | ||
| import { DiagnosticFeature } from 'vscode-languageclient/lib/common/diagnostic'; |
There was a problem hiding this comment.
The DiagnosticFeature import appears unused after removing the diagnostic middleware. Consider removing this unused import.
| import { DiagnosticFeature } from 'vscode-languageclient/lib/common/diagnostic'; |
|
|
||
| const response = await client.sendRequest(ext.checkWorkspaceSyntax, params); | ||
| const diagnosticCollection = ctx.workspaceDiagnostic; | ||
| const diagnosticCollection = ctx.client.diagnostics; |
There was a problem hiding this comment.
Accessing ctx.client.diagnostics without null checking could cause runtime errors if the client is not initialized. The ctx.client property can be null as defined in the constructor.
* Remove old workspace collection * fix unused import
* fix project creation * update dependencies * accept greater version number * add ask input password for linux * update dependency * add test script * update dependencies * remove logs * 4qs compatible * fix eslint * ignore lock in extension * add syntaxes 4qs in vscodeignore * Use commonjs for the extension * Remove old workspace collection (#33) * Remove old workspace collection * fix unused import * Fix download tool4d * rework UT tooldownload
No description provided.