Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: debug toolbar is disappeared or session paused after debug session started #4312

Merged
merged 4 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Parser from 'web-tree-sitter';

import { Autowired, Injectable } from '@opensumi/di';
import { EKnownResources, RendererRuntime } from '@opensumi/ide-core-browser/lib/application/runtime/types';
import { Deferred, path } from '@opensumi/ide-utils';
import { Deferred } from '@opensumi/ide-utils';

/**
* Managing and caching the wasm module
Expand All @@ -29,7 +29,12 @@ export class WasmModuleManager {

async initParser() {
const baseUrl = await this.resolvedResourceUriDeferred.promise;
const wasmPath = path.join(baseUrl, 'tree-sitter.wasm');
let wasmPath;
if (baseUrl.endsWith('/')) {
wasmPath = `${baseUrl}tree-sitter.wasm`;
} else {
wasmPath = `${baseUrl}/tree-sitter.wasm`;
}
if (!this.parserInitialized) {
await Parser.init({
locateFile: () => wasmPath,
Expand All @@ -45,7 +50,12 @@ export class WasmModuleManager {
const deferred = new Deferred<ArrayBuffer>();
this.cachedRuntime.set(language, deferred);
const baseUrl = await this.resolvedResourceUriDeferred.promise;
const wasmUrl = path.join(baseUrl, `tree-sitter-${language}.wasm`);
let wasmUrl;
if (baseUrl.endsWith('/')) {
wasmUrl = `${baseUrl}tree-sitter-${language}.wasm`;
} else {
wasmUrl = `${baseUrl}/tree-sitter-${language}.wasm`;
}
fetch(wasmUrl)
.then((res) => res.arrayBuffer())
.then((buffer) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class DebugBreakpointsService extends WithEventBus {
this.roots = roots.map((file) => new URI(file.uri));
}

toggleBreakpointEnable(data: IDebugBreakpoint | DebugExceptionBreakpoint) {
toggleBreakpointEnable = (data: IDebugBreakpoint | DebugExceptionBreakpoint) => {
if (isDebugBreakpoint(data)) {
const real = this.breakpoints.getBreakpoint(URI.parse(data.uri), {
lineNumber: data.raw.line,
Expand All @@ -157,7 +157,7 @@ export class DebugBreakpointsService extends WithEventBus {
if (isDebugExceptionBreakpoint(data)) {
this.breakpoints.updateExceptionBreakpoints(data.filter, !data.default);
}
}
};

extractNodes(item: DebugExceptionBreakpoint | IDebugBreakpoint): BreakpointItem | undefined {
if (isDebugBreakpoint(item)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
justify-content: center;
z-index: 10;
user-select: none;
top: 0;
left: 0;

.debug_action_bar {
height: 100%;
Expand Down
Loading