File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -34,24 +34,28 @@ export const detectEditor = (): IDE => {
3434
3535export const signIn = async ( ) => {
3636 const gitExtension = vscode . extensions . getExtension ( 'vscode.git' ) ?. exports
37+ const scheme = vscode . env . uriScheme
38+
3739 const api = gitExtension ?. getAPI ( 1 )
3840
3941 // Get the first open repository
4042 const repository = api ?. repositories [ 0 ]
41- let params = ''
43+ const params = new URLSearchParams ( { scheme } )
4244
4345 if ( repository ) {
4446 const remoteUrl = repository . state . remotes [ 0 ] ?. fetchUrl || repository . state . remotes [ 0 ] ?. pushUrl
4547 if ( remoteUrl ) {
4648 try {
4749 const { provider, organization, repository : repoName } = parseGitRemote ( remoteUrl )
48- params = `?provider=${ provider } &organization=${ organization } &repository=${ repoName } `
50+ params . set ( 'provider' , provider )
51+ params . set ( 'organization' , organization )
52+ params . set ( 'repository' , repoName )
4953 } catch ( e ) {
5054 Logger . error ( `Error parsing git remote: ${ e } ` )
5155 }
5256 }
5357 }
5458 const editor = detectEditor ( )
55- const uri = vscode . Uri . parse ( `${ Config . baseUri } /auth/${ editor } ${ params } ` )
59+ const uri = vscode . Uri . parse ( `${ Config . baseUri } /auth/${ editor } ? ${ params . toString ( ) } ` )
5660 await vscode . env . openExternal ( uri )
5761}
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import Telemetry from './common/telemetry'
1919import { decorateWithCoverage } from './views/coverage'
2020import { APIState , Repository as GitRepository } from './git/git'
2121import { configureMCP , createRules , isMCPConfigured } from './commands/configureMCP'
22- import { installCodacyCLI , isCLIInstalled , updateCodacyCLI } from './commands/installAnalysisCLI'
22+ import { isCLIInstalled , updateCodacyCLI } from './commands/installAnalysisCLI'
2323
2424/**
2525 * Helper function to register all extension commands
You can’t perform that action at this time.
0 commit comments