mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
GitHub - link provider for various hovers (#237961)
* Initial implementation * Refactor code, add link to blame decoration * Add links to timeline hover * Saving my work * Update remote order for "Open on GitHub" action * Bug fixes * Add link provider for graph hover * Rename method
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
import { Command, Disposable, commands } from 'vscode';
|
||||
import { Model } from '../model';
|
||||
import { getRemoteSourceActions, getRemoteSourceControlHistoryItemCommands, pickRemoteSource } from '../remoteSource';
|
||||
import { getRemoteSourceActions, getRemoteSourceControlHistoryItemCommands, pickRemoteSource, provideRemoteSourceLinks } from '../remoteSource';
|
||||
import { GitBaseExtensionImpl } from './extension';
|
||||
import { API, PickRemoteSourceOptions, PickRemoteSourceResult, RemoteSourceAction, RemoteSourceProvider } from './git-base';
|
||||
|
||||
@@ -21,10 +21,14 @@ export class ApiImpl implements API {
|
||||
return getRemoteSourceActions(this._model, url);
|
||||
}
|
||||
|
||||
getRemoteSourceControlHistoryItemCommands(url: string): Promise<Command[]> {
|
||||
getRemoteSourceControlHistoryItemCommands(url: string): Promise<Command[] | undefined> {
|
||||
return getRemoteSourceControlHistoryItemCommands(this._model, url);
|
||||
}
|
||||
|
||||
provideRemoteSourceLinks(url: string, content: string): Promise<string> {
|
||||
return provideRemoteSourceLinks(this._model, url, content);
|
||||
}
|
||||
|
||||
registerRemoteSourceProvider(provider: RemoteSourceProvider): Disposable {
|
||||
return this._model.registerRemoteSourceProvider(provider);
|
||||
}
|
||||
|
||||
4
extensions/git-base/src/api/git-base.d.ts
vendored
4
extensions/git-base/src/api/git-base.d.ts
vendored
@@ -9,7 +9,8 @@ export { ProviderResult } from 'vscode';
|
||||
export interface API {
|
||||
registerRemoteSourceProvider(provider: RemoteSourceProvider): Disposable;
|
||||
getRemoteSourceActions(url: string): Promise<RemoteSourceAction[]>;
|
||||
getRemoteSourceControlHistoryItemCommands(url: string): Promise<Command[]>;
|
||||
getRemoteSourceControlHistoryItemCommands(url: string): Promise<Command[] | undefined>;
|
||||
provideRemoteSourceLinks(url: string, content: string): Promise<string | undefined>;
|
||||
pickRemoteSource(options: PickRemoteSourceOptions): Promise<string | PickRemoteSourceResult | undefined>;
|
||||
}
|
||||
|
||||
@@ -85,4 +86,5 @@ export interface RemoteSourceProvider {
|
||||
getRemoteSourceControlHistoryItemCommands?(url: string): ProviderResult<Command[]>;
|
||||
getRecentRemoteSources?(query?: string): ProviderResult<RecentRemoteSource[]>;
|
||||
getRemoteSources(query?: string): ProviderResult<RemoteSource[]>;
|
||||
provideRemoteSourceLinks?(url: string, content: string): Promise<string | undefined>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user