feat(vscode): add a trace channel for better debugging
MODIFY
crates/rome_diagnostics/src/lib.rs
crates/rome_diagnostics/src/lib.rs
@@ -23,7 +23,7 @@ pub enum DiagnosticTag {
}
impl DiagnosticTag {
- pub fn is_unecessary(&self) -> bool {
+ pub fn is_unnecessary(&self) -> bool {
matches!(self, DiagnosticTag::Unnecessary | DiagnosticTag::Both)
}

MODIFY
crates/rome_lsp/src/utils.rs
crates/rome_lsp/src/utils.rs
@@ -160,7 +160,7 @@ pub(crate) fn diagnostic_to_lsp(
diagnostic.tag.map(|tag| {
let mut result = Vec::new();
- if tag.is_unecessary() {
+ if tag.is_unnecessary() {
result.push(lsp::DiagnosticTag::UNNECESSARY);
}

MODIFY
editors/vscode/package.json
editors/vscode/package.json
"title": "Rome",
"type": "object",
"properties": {
+ "rome_lsp.trace.server": {
+ "type": "string",
+ "scope": "window",
+ "enum": [
+ "off",
+ "messages",
+ "verbose"
+ ],
+ "enumDescriptions": [
+ "No traces",
+ "Error only",
+ "Full log"
+ ],
+ "default": "off",
+ "description": "Traces the communication between VS Code and the language server."
+ },
"rome.lspBin": {
"type": [
"string",

MODIFY
editors/vscode/src/main.ts
editors/vscode/src/main.ts
@@ -31,6 +31,8 @@ export async function activate(context: ExtensionContext) {
transport: TransportKind.stdio,
};
+ const traceOutputChannel = window.createOutputChannel("Rome Trace");
+
// only override serverOptions.options when developing extension,
// this is convenient for debugging
// Before, every time we modify the client package, we need to rebuild vscode extension and install, for now, we could use Launching Client or press F5 to open a separate debug window and doing some check, finally we could bundle the vscode and do some final check.
@@ -46,6 +48,7 @@ export async function activate(context: ExtensionContext) {
{ scheme: "file", language: "javascriptreact" },
{ scheme: "file", language: "typescriptreact" },
],
+ traceOutputChannel,
};
client = new LanguageClient("rome_lsp", "Rome", serverOptions, clientOptions);

feat(vscode): add a trace channel for better debugging (#2885)