-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Improve handling of auto-completion to allow partial match - Avoid opening error markers in mapping diagram
- Loading branch information
1 parent
4174776
commit 83e9f60
Showing
3 changed files
with
87 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/glsp-client/src/browser/mapping-diagram/mapping-diagram-manager.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2024 CrossBreeze. | ||
********************************************************************************/ | ||
|
||
import { GLSPDiagramManager } from '@eclipse-glsp/theia-integration'; | ||
import { URI } from '@theia/core'; | ||
import { WidgetOpenerOptions } from '@theia/core/lib/browser'; | ||
import { injectable } from '@theia/core/shared/inversify'; | ||
import { MappingDiagramLanguage } from '../../common/crossmodel-diagram-language'; | ||
import { codiconCSSString } from '@eclipse-glsp/client'; | ||
|
||
export interface ProblemMarkerOpenerOptions extends WidgetOpenerOptions { | ||
selection?: Range; | ||
} | ||
|
||
@injectable() | ||
export class MappingDiagramManager extends GLSPDiagramManager { | ||
get label(): string { | ||
return MappingDiagramLanguage.label; | ||
} | ||
|
||
override get iconClass(): string { | ||
return MappingDiagramLanguage.iconClass ?? codiconCSSString('type-hierarchy-sub'); | ||
} | ||
|
||
override get fileExtensions(): string[] { | ||
return MappingDiagramLanguage.fileExtensions; | ||
} | ||
|
||
override get diagramType(): string { | ||
return MappingDiagramLanguage.diagramType; | ||
} | ||
|
||
override get contributionId(): string { | ||
return MappingDiagramLanguage.contributionId; | ||
} | ||
|
||
override canHandle(uri: URI, options?: ProblemMarkerOpenerOptions | undefined): number { | ||
if (options?.selection) { | ||
return 0; | ||
} | ||
return super.canHandle(uri, options); | ||
} | ||
} |