diff --git a/.vscode/settings.json b/.vscode/settings.json index 4122b1a8b73..3a17c3679f0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -50,8 +50,7 @@ "eslint.packageManager": "yarn", "eslint.lintTask.enable": false, "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], - "editor.codeActionsOnSave": { - }, + "editor.codeActionsOnSave": {}, "eslint.codeActionsOnSave.mode": "problems", "eslint.options": { "cache": true }, "eslint.workingDirectories": ["./dev/release", "./client/*"], diff --git a/CHANGELOG.md b/CHANGELOG.md index c405df1a365..1cb02073020 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,7 @@ All notable changes to Sourcegraph are documented in this file. - Git server access logs are now compliant with the audit logging format. Breaking change: The 'actor' field is now nested under 'audit' field. [#41865](https://github.com/sourcegraph/sourcegraph/pull/41865) - All Perforce rules are now stored together in one column and evaluated on a "last rule takes precedence" basis. [#41785](https://github.com/sourcegraph/sourcegraph/pull/41785) - Security events are now a part of the audit log. [#42653](https://github.com/sourcegraph/sourcegraph/pull/42653) -- "GC AUTO" is now the default garbage collection job. We disable sg maintenance, which had previously replace "GC AUTO", after repeated reports about repo corruption. [#42856](https://github.com/sourcegraph/sourcegraph/pull/42856) +- "GC AUTO" is now the default garbage collection job. We disable sg maintenance, which had previously replace "GC AUTO", after repeated reports about repo corruption. [#42856](https://github.com/sourcegraph/sourcegraph/pull/42856) - To use the optional `customGitFetch` feature, the `ENABLE_CUSTOM_GIT_FETCH` env var must be set on `gitserver`. [#42704](https://github.com/sourcegraph/sourcegraph/pull/42704) ### Fixed diff --git a/client/jetbrains/webview/src/search/index.tsx b/client/jetbrains/webview/src/search/index.tsx index aa7fd9b9b69..b97248541fc 100644 --- a/client/jetbrains/webview/src/search/index.tsx +++ b/client/jetbrains/webview/src/search/index.tsx @@ -95,7 +95,7 @@ export function applyConfig(config: PluginConfig): void { customRequestHeaders = parseCustomRequestHeadersString(config.customRequestHeadersAsString) anonymousUserId = config.anonymousUserId || 'no-user-id' pluginVersion = config.pluginVersion - polyfillEventSource({...(accessToken ? { Authorization: `token ${accessToken}` } : {}), ...customRequestHeaders}) + polyfillEventSource({ ...(accessToken ? { Authorization: `token ${accessToken}` } : {}), ...customRequestHeaders }) } function parseCustomRequestHeadersString(headersString: string | null): Record | null { @@ -163,7 +163,11 @@ export function applyTheme(theme: Theme, rootElement: Element = document.documen export async function updateVersionAndAuthDataFromServer(): Promise { try { - const { site, currentUser } = await getSiteVersionAndAuthenticatedUser(instanceURL, accessToken, customRequestHeaders) + const { site, currentUser } = await getSiteVersionAndAuthenticatedUser( + instanceURL, + accessToken, + customRequestHeaders + ) authenticatedUser = currentUser backendVersion = site?.productVersion || null isServerAccessSuccessful = true diff --git a/client/jetbrains/webview/src/search/results/FileSearchResult.tsx b/client/jetbrains/webview/src/search/results/FileSearchResult.tsx index 01969e2f05b..3c923e32dc2 100644 --- a/client/jetbrains/webview/src/search/results/FileSearchResult.tsx +++ b/client/jetbrains/webview/src/search/results/FileSearchResult.tsx @@ -90,12 +90,16 @@ export const FileSearchResult: React.FunctionComponent = ({ const onClick = (): void => lines.length - ? selectResult(getResultId(match, - match.type === 'content' - ? match.lineMatches - ? match.lineMatches[0] - : undefined - : match.symbols[0])) + ? selectResult( + getResultId( + match, + match.type === 'content' + ? match.lineMatches + ? match.lineMatches[0] + : undefined + : match.symbols[0] + ) + ) : undefined const title = ( diff --git a/client/jetbrains/webview/src/search/results/utils.ts b/client/jetbrains/webview/src/search/results/utils.ts index 2b98dfa7765..7afad249f7a 100644 --- a/client/jetbrains/webview/src/search/results/utils.ts +++ b/client/jetbrains/webview/src/search/results/utils.ts @@ -14,8 +14,8 @@ export function getFirstResultId(results: SearchMatch[]): string | null { ? firstSupportedMatch.lineMatches[0] : undefined : firstSupportedMatch.type === 'symbol' - ? firstSupportedMatch.symbols[0] - : undefined + ? firstSupportedMatch.symbols[0] + : undefined ) } return null diff --git a/client/search-ui/src/components/FileSearchResult.tsx b/client/search-ui/src/components/FileSearchResult.tsx index 403764892d3..45e38815633 100644 --- a/client/search-ui/src/components/FileSearchResult.tsx +++ b/client/search-ui/src/components/FileSearchResult.tsx @@ -148,19 +148,20 @@ export const FileSearchResult: React.FunctionComponent ({ - highlightRanges: match.offsetAndLengths.map(offsetAndLength => ({ - startLine: match.lineNumber, - startCharacter: offsetAndLength[0], - endLine: match.lineNumber, - endCharacter: offsetAndLength[0] + offsetAndLength[1], - })), - content: match.line, - startLine: match.lineNumber, - endLine: match.lineNumber, - aggregableBadges: match.aggregableBadges, - })) || [] + })) || + result.lineMatches?.map(match => ({ + highlightRanges: match.offsetAndLengths.map(offsetAndLength => ({ + startLine: match.lineNumber, + startCharacter: offsetAndLength[0], + endLine: match.lineNumber, + endCharacter: offsetAndLength[0] + offsetAndLength[1], + })), + content: match.line, + startLine: match.lineNumber, + endLine: match.lineNumber, + aggregableBadges: match.aggregableBadges, + })) || + [] : [], [result] ) diff --git a/client/vscode/src/backend/streamSearch.ts b/client/vscode/src/backend/streamSearch.ts index a4197dd0972..7896df7daf4 100644 --- a/client/vscode/src/backend/streamSearch.ts +++ b/client/vscode/src/backend/streamSearch.ts @@ -52,7 +52,11 @@ export function createStreamSearch({ map(version => { let patternType = options.patternType - if (patternType === SearchPatternType.standard && version && isOlderThan(version, { major: 3, minor: 43 })) { + if ( + patternType === SearchPatternType.standard && + version && + isOlderThan(version, { major: 3, minor: 43 }) + ) { /** * SearchPatternType.standard support was added in Sourcegraph v3.43.0. * Use SearchPatternType.literal for earlier versions instead (it was the default before v3.43.0).