Skip to content

Commit

Permalink
SLVSCODE-882 assistBinding overwrite old binding
Browse files Browse the repository at this point in the history
  • Loading branch information
sophio-japharidze-sonarsource committed Oct 14, 2024
1 parent c383ada commit add0943
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/connected/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,11 @@ export class BindingService {
);
const workspaceFolder = workspaceFolders.find(f => f.name === selectedWorkspaceFolderName);

const existingSettings = VSCode.workspace
await VSCode.workspace
.getConfiguration(SONARLINT_CATEGORY, workspaceFolder)
.get<ProjectBinding>(BINDING_SETTINGS);
if (existingSettings.projectKey === undefined) {
await VSCode.workspace
.getConfiguration(SONARLINT_CATEGORY, workspaceFolder)
.update(BINDING_SETTINGS, { connectionId: params.connectionId, projectKey: params.projectKey });
await this.languageClient.didCreateBinding(params.isFromSharedConfiguration ? BindingCreationMode.IMPORTED : BindingCreationMode.AUTOMATIC);
}
.update(BINDING_SETTINGS, { connectionId: params.connectionId, projectKey: params.projectKey });
await this.languageClient.didCreateBinding(params.isFromSharedConfiguration ? BindingCreationMode.IMPORTED : BindingCreationMode.AUTOMATIC);

return { configurationScopeId: workspaceFolder.uri.toString() };
}

Expand Down

0 comments on commit add0943

Please sign in to comment.