diff --git a/CHANGELOG.md b/CHANGELOG.md index 70fa3e70a..2c2ede5f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/snyk/common/languageServer/staticLsApi.ts b/src/snyk/common/languageServer/staticLsApi.ts index 40600c0a0..9558b1ec5 100644 --- a/src/snyk/common/languageServer/staticLsApi.ts +++ b/src/snyk/common/languageServer/staticLsApi.ts @@ -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, diff --git a/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewScriptLS.ts b/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewScriptLS.ts index e19fcdd63..97999ba31 100644 --- a/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewScriptLS.ts +++ b/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewScriptLS.ts @@ -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', @@ -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; @@ -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();