Skip to content

Commit c661d66

Browse files
fix(Mountain): Remove duplicate DevTools window in debug builds
WindowBuild.rs was calling `MainWindow.open_devtools()` independently from AppLifecycle.rs, causing two DevTools windows to open on every debug launch. Remove the redundant call and document that DevTools auto-open lives in AppLifecycle (line 174), gated on debug_assertions with a matching log line. docs(Mountain): Clarify diagnostic coordinates are 1-based Update DiagnosticProvider.rs docstring to specify that StartLineNumber/StartColumn and EndLineNumber/EndColumn use 1-based indexing, matching workbench IMarkerData. Add note explaining that Cocoon's LanguagesNamespace.ts NormaliseDiagnostic adds the +1 offset from vscode.Position 0-based convention before sending to Mountain.
1 parent c2d0bec commit c661d66

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

Source/Binary/Build/WindowBuild.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,12 @@ pub fn WindowBuild(Application:&mut App, LocalhostUrl:String) -> tauri::WebviewW
9494
// Build the main window
9595
let MainWindow = WindowBuilder.build().expect("FATAL: Main window build failed");
9696

97-
// Open DevTools in debug builds
98-
#[cfg(debug_assertions)]
99-
{
100-
MainWindow.open_devtools();
101-
}
97+
// DevTools auto-open lives in `Binary/Main/AppLifecycle.rs:174`
98+
// (gated on `cfg(debug_assertions)`, with a `[Window] Debug build:
99+
// opening DevTools.` log line). Calling `open_devtools()` here as
100+
// well opened a SECOND DevTools window on every debug launch -
101+
// reported as "two DevTools" after the last rebuild. Single-source
102+
// the call to AppLifecycle so the log line and the window match.
102103

103104
MainWindow
104105
}

Source/Environment/DiagnosticProvider.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@
7474
//! Each diagnostic is a `MarkerDataDTO`:
7575
//! - `Severity`: Error(8), Warning(4), Information(2), Hint(1)
7676
//! - `Message`: Human-readable description
77-
//! - `StartLineNumber`/`StartColumn`: Start position (0-based)
78-
//! - `EndLineNumber`/`EndColumn`: End position
77+
//! - `StartLineNumber`/`StartColumn`: Start position (1-based, matches
78+
//! workbench `IMarkerData` - Cocoon's `LanguagesNamespace.ts`
79+
//! `NormaliseDiagnostic` adds the `+ 1` from vscode.Position 0-based
80+
//! before sending to Mountain)
81+
//! - `EndLineNumber`/`EndColumn`: End position (1-based, same convention)
7982
//! - `Source`: Diagnostic source string (e.g., "tslint")
8083
//! - `Code`: Diagnostic code for quick fix lookup
8184
//! - `ModelVersionIdentifier`: Document version for tracking

0 commit comments

Comments
 (0)