|
4 | 4 | */ |
5 | 5 |
|
6 | 6 | import * as vscode from 'vscode'; |
7 | | -import { GitHub1sFS } from './github1sfs'; |
8 | | -import { SettingsView } from './settings-view'; |
9 | | -import { setExtensionContext } from './util'; |
| 7 | +import { SettingsView } from '@/views/settings-view'; |
| 8 | +import { setExtensionContext } from '@/helpers/context'; |
10 | 9 | import { |
11 | 10 | commandUpdateToken, |
12 | 11 | commandValidateToken, |
13 | 12 | commandClearToken, |
14 | 13 | commandSwitchBranch, |
15 | 14 | commandSwitchTag, |
16 | 15 | commandGetCurrentAuthority, |
17 | | -} from './commands'; |
| 16 | +} from '@/commands'; |
| 17 | +import { |
| 18 | + GitHub1sFileSystemProvider, |
| 19 | + GitHub1sFileSearchProvider, |
| 20 | + GitHub1sTextSearchProvider, |
| 21 | + GitHub1sSubmoduleDecorationProvider, |
| 22 | +} from '@/providers'; |
18 | 23 |
|
19 | 24 | export function activate(context: vscode.ExtensionContext) { |
20 | 25 | setExtensionContext(context); |
21 | | - context.subscriptions.push(new GitHub1sFS()); |
22 | 26 |
|
| 27 | + // providers |
| 28 | + const fsProvider = new GitHub1sFileSystemProvider(); |
| 29 | + context.subscriptions.push( |
| 30 | + vscode.workspace.registerFileSystemProvider( |
| 31 | + GitHub1sFileSystemProvider.scheme, |
| 32 | + fsProvider, |
| 33 | + { |
| 34 | + isCaseSensitive: true, |
| 35 | + isReadonly: true, |
| 36 | + } |
| 37 | + ), |
| 38 | + vscode.workspace.registerFileSearchProvider( |
| 39 | + GitHub1sFileSearchProvider.scheme, |
| 40 | + new GitHub1sFileSearchProvider(fsProvider) |
| 41 | + ), |
| 42 | + vscode.workspace.registerTextSearchProvider( |
| 43 | + GitHub1sTextSearchProvider.scheme, |
| 44 | + new GitHub1sTextSearchProvider() |
| 45 | + ), |
| 46 | + vscode.window.registerFileDecorationProvider( |
| 47 | + new GitHub1sSubmoduleDecorationProvider(fsProvider) |
| 48 | + ) |
| 49 | + ); |
| 50 | + |
| 51 | + // views |
23 | 52 | context.subscriptions.push( |
24 | 53 | vscode.window.registerWebviewViewProvider( |
25 | 54 | SettingsView.viewType, |
26 | 55 | new SettingsView() |
27 | 56 | ) |
28 | 57 | ); |
29 | 58 |
|
| 59 | + // commands |
30 | 60 | context.subscriptions.push( |
31 | 61 | vscode.commands.registerCommand( |
32 | 62 | 'github1s.validate-token', |
|
0 commit comments