Skip to content

Commit

Permalink
fix: merge hotfix 2.19.2 back to main (#552)
Browse files Browse the repository at this point in the history
Co-authored-by: [email protected]>
Co-authored-by: ShawkyZ <[email protected]>
  • Loading branch information
bastiandoetsch and ShawkyZ authored Nov 5, 2024
2 parents 7ed3c5a + b141940 commit 3699793
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
## [2.20.0]
- If $/snyk.hasAuthenticated transmits an API URL, this is saved in the settings.

## [2.19.2]
- Update download endpoint to downloads.snyk.io.
- Send correct FixId to AI Fix endpoint.
- Hide AI Fix div if no fixes found.

## [2.19.1]
- Adjust OSS panel font size.

Expand Down
2 changes: 1 addition & 1 deletion src/snyk/common/languageServer/staticLsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface IStaticLsApi {
}

export class StaticLsApi implements IStaticLsApi {
private readonly baseUrl = `https://static.snyk.io/snyk-ls/${PROTOCOL_VERSION}`;
private readonly baseUrl = `https://downloads.snyk.io/snyk-ls/${PROTOCOL_VERSION}`;

constructor(
private readonly workspace: IVSCodeWorkspace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ declare const acquireVsCodeApi: any;
const diffSuggestion = suggestion.diffs[diffSelectedIndex];
const filePath = suggestion.filePath;
const patch = diffSuggestion.unifiedDiffsPerFile[filePath];
const fixId = suggestion.id;
const fixId = diffSuggestion.fixId;

const message: ApplyGitDiffMessage = {
type: 'applyGitDiff',
Expand All @@ -273,7 +273,9 @@ declare const acquireVsCodeApi: any;
const diffTopElem = document.getElementById('diff-top') as HTMLElement;
const diffElem = document.getElementById('diff') as HTMLElement;
const noDiffsElem = document.getElementById('info-no-diffs') as HTMLElement;

if (noDiffsElem) {
noDiffsElem.innerText = "We couldn't determine any fixes for this issue.";
}
const diffNumElem = document.getElementById('diff-number') as HTMLElement;
const diffNum2Elem = document.getElementById('diff-number2') as HTMLElement;

Expand All @@ -292,11 +294,20 @@ declare const acquireVsCodeApi: any;
}

function showCurrentDiff() {
if (!suggestion?.diffs?.length) {
toggleElement(noDiffsElem, 'show');
toggleElement(diffTopElem, 'hide');
toggleElement(diffElem, 'hide');
toggleElement(applyFixButton, 'hide');
return;
}

if (!suggestion?.diffs?.length || diffSelectedIndex < 0 || diffSelectedIndex >= suggestion.diffs.length) return;

toggleElement(noDiffsElem, 'hide');
toggleElement(diffTopElem, 'show');
toggleElement(diffElem, 'show');
toggleElement(applyFixButton, 'show');

diffNumElem.innerText = suggestion.diffs.length.toString();
diffNum2Elem.innerText = suggestion.diffs.length.toString();
Expand Down

0 comments on commit 3699793

Please sign in to comment.