@@ -43,50 +43,14 @@ export async function activate(context: vscode.ExtensionContext) {
43
43
// Show the status bar item
44
44
// myStatusBarItem.show()
45
45
46
+ vscode . window . registerUriHandler ( {
47
+ handleUri ( uri : vscode . Uri ) {
48
+ console . debug ( 'registerUriHandler' , { uri } )
49
+ } ,
50
+ } )
51
+
46
52
context . subscriptions . push (
47
53
myStatusBarItem ,
48
- vscode . commands . registerCommand ( 'RedisForVSCode.signInWithGitHub' , async ( ) => {
49
- try {
50
- const session = await vscode . authentication . getSession ( 'github' , [ 'user:email' ] , { forceNewSession : true } )
51
-
52
- if ( session ) {
53
- const response = await fetch ( 'https://api.github.com/user' , {
54
- headers : {
55
- Authorization : `token ${ session . accessToken } ` ,
56
- 'User-Agent' : 'VSCode Extension' ,
57
- } ,
58
- } )
59
-
60
- if ( ! response . ok ) {
61
- throw new Error ( `Error: ${ response . status } ${ response . statusText } ` )
62
- }
63
-
64
- const userData = await response . json ( )
65
-
66
- console . debug ( 'github' , { session, userData } )
67
-
68
- vscode . window . showInformationMessage ( `Hello, ${ userData . login } !` )
69
- } else {
70
- vscode . window . showErrorMessage ( 'GitHub sign-in was not successful.' )
71
- }
72
- } catch ( error ) {
73
- vscode . window . showErrorMessage ( `Sign-in failed: ${ error } ` )
74
- }
75
- } ) ,
76
- vscode . commands . registerCommand ( 'RedisForVSCode.signInWithMicrosoft' , async ( ) => {
77
- try {
78
- const session = await vscode . authentication . getSession ( 'microsoft' , [ 'user.read' ] , { forceNewSession : true } )
79
-
80
- if ( session ) {
81
- console . debug ( 'microsoft' , { session } )
82
- vscode . window . showInformationMessage ( `Signed in as ${ session . account . label } ` )
83
- } else {
84
- vscode . window . showErrorMessage ( 'Microsoft sign-in failed.' )
85
- }
86
- } catch ( error : any ) {
87
- vscode . window . showErrorMessage ( `Sign-in failed: ${ error . message } ` )
88
- }
89
- } ) ,
90
54
vscode . window . registerWebviewViewProvider ( 'ri-sidebar' , sidebarProvider ) ,
91
55
vscode . window . registerWebviewViewProvider ( 'ri-panel' , panelProvider , { webviewOptions : { retainContextWhenHidden : true } } ) ,
92
56
0 commit comments