-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
338 additions
and
22 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
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
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
77 changes: 74 additions & 3 deletions
77
packages/debug/src/browser/preferences/launch-preferences-contribution.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 |
---|---|---|
@@ -1,9 +1,80 @@ | ||
import { PreferenceContribution, PreferenceSchema, Domain, PreferenceConfiguration } from '@opensumi/ide-core-browser'; | ||
import { Autowired, Injectable } from '@opensumi/di'; | ||
import { | ||
PreferenceContribution, | ||
PreferenceSchema, | ||
Domain, | ||
PreferenceConfiguration, | ||
URI, | ||
MaybePromise, | ||
localize, | ||
getIcon, | ||
} from '@opensumi/ide-core-browser'; | ||
import { | ||
BrowserEditorContribution, | ||
EditorComponentRegistry, | ||
EditorOpenType, | ||
IResource, | ||
IResourceProvider, | ||
ResourceService, | ||
} from '@opensumi/ide-editor/lib/browser'; | ||
|
||
import { launchPreferencesSchema } from './launch-preferences'; | ||
import { LaunchViewContainer } from './launch.view'; | ||
|
||
const LAUNCH_VIEW_SCHEME = 'launch_view_scheme'; | ||
const LAUNCH_VIEW_COMPONENT_ID = 'launch-view'; | ||
|
||
@Injectable() | ||
export class LaunchResourceProvider implements IResourceProvider { | ||
readonly scheme: string = LAUNCH_VIEW_SCHEME; | ||
|
||
provideResource(uri: URI): MaybePromise<IResource<any>> { | ||
// 获取文件类型 getFileType: (path: string) => string | ||
return { | ||
supportsRevive: true, | ||
name: localize('menu-bar.title.debug'), | ||
icon: getIcon('debug'), | ||
uri, | ||
}; | ||
} | ||
|
||
provideResourceSubname(resource: IResource, groupResources: IResource[]): string | null { | ||
return null; | ||
} | ||
|
||
async shouldCloseResource(resource: IResource, openedResources: IResource[][]): Promise<boolean> { | ||
return true; | ||
} | ||
} | ||
|
||
@Domain(PreferenceContribution, PreferenceConfiguration, BrowserEditorContribution) | ||
export class LaunchPreferencesContribution | ||
implements PreferenceContribution, PreferenceConfiguration, BrowserEditorContribution | ||
{ | ||
@Autowired(LaunchResourceProvider) | ||
private readonly prefResourceProvider: LaunchResourceProvider; | ||
|
||
@Domain(PreferenceContribution, PreferenceConfiguration) | ||
export class LaunchPreferencesContribution implements PreferenceContribution, PreferenceConfiguration { | ||
schema: PreferenceSchema = launchPreferencesSchema; | ||
name = 'launch'; | ||
|
||
registerResource(resourceService: ResourceService): void { | ||
resourceService.registerResourceProvider(this.prefResourceProvider); | ||
} | ||
|
||
registerEditorComponent(editorComponentRegistry: EditorComponentRegistry): void { | ||
editorComponentRegistry.registerEditorComponent({ | ||
component: LaunchViewContainer, | ||
uid: LAUNCH_VIEW_COMPONENT_ID, | ||
scheme: LAUNCH_VIEW_SCHEME, | ||
}); | ||
|
||
editorComponentRegistry.registerEditorComponentResolver(LAUNCH_VIEW_SCHEME, (_, __, resolve) => { | ||
resolve([ | ||
{ | ||
type: EditorOpenType.component, | ||
componentId: LAUNCH_VIEW_COMPONENT_ID, | ||
}, | ||
]); | ||
}); | ||
} | ||
} |
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,91 @@ | ||
@base-font-size: 14px; | ||
@small-base-font-size: 12px; | ||
|
||
.launch_container { | ||
height: 100%; | ||
font-size: @base-font-size; | ||
overflow: hidden; | ||
padding: 16px 16px 0 16px; | ||
box-sizing: border-box; | ||
min-width: 500px; | ||
|
||
.launch_panel { | ||
height: 100%; | ||
margin-top: 8px; | ||
|
||
.launch_indexes_container { | ||
height: 100%; | ||
margin-right: 16px; | ||
.not_configuration_content { | ||
text-align: center; | ||
font-size: @small-base-font-size; | ||
} | ||
.configuration_items_box { | ||
height: calc(100% - 40px) !important; | ||
.configuration_item { | ||
height: 22px; | ||
display: flex; | ||
align-items: center; | ||
cursor: pointer; | ||
flex-direction: row; | ||
padding: 4px; | ||
&:hover { | ||
background: var(--list-hoverBackground); | ||
color: var(--list-hoverForeground); | ||
} | ||
&.selected { | ||
background: var(--list-activeSelectionBackground); | ||
color: var(--list-activeSelectionForeground); | ||
} | ||
|
||
.configuration_wrapper { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
flex: 1; | ||
} | ||
|
||
.configuration_description { | ||
display: inline; | ||
font-size: 12px; | ||
} | ||
} | ||
} | ||
.foot_box { | ||
position: relative; | ||
z-index: 1; | ||
.button { | ||
width: 100%; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
.devider { | ||
box-sizing: border-box; | ||
font-size: 14px; | ||
font-variant: tabular-nums; | ||
list-style: none; | ||
font-feature-settings: 'tnum'; | ||
position: relative; | ||
margin: 0 3px; | ||
display: inline-block; | ||
vertical-align: middle; | ||
&:after { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
top: 0px; | ||
left: 0px; | ||
width: 100%; | ||
height: 100%; | ||
border-top: 0; | ||
border-left: 1px solid var(--editorGroup-border); | ||
pointer-events: none; | ||
transform: translateX(1.5px); | ||
} | ||
&:hover:after { | ||
border-color: transparent; | ||
} | ||
} |
Oops, something went wrong.