Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: merge hotfix 2.19.2 back to main #552

Merged
merged 4 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading