diff --git a/client/web-sveltekit/.storybook/preview.ts b/client/web-sveltekit/.storybook/preview.ts index 5a0d91470b2..56b0f13cc56 100644 --- a/client/web-sveltekit/.storybook/preview.ts +++ b/client/web-sveltekit/.storybook/preview.ts @@ -1,7 +1,10 @@ import type { Preview } from '@storybook/svelte' import { initialize, mswLoader } from 'msw-storybook-addon' +// Global imports kept in sync with routes/+layout.svelte import '../src/routes/styles.scss' +import '@fontsource-variable/roboto-mono' +import '@fontsource-variable/inter' // Initialize MSW initialize() diff --git a/client/web-sveltekit/assets/icons/symbols.svg b/client/web-sveltekit/assets/icons/symbols.svg new file mode 100644 index 00000000000..a70841efc1a --- /dev/null +++ b/client/web-sveltekit/assets/icons/symbols.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/client/web-sveltekit/src/auto-imports.d.ts b/client/web-sveltekit/src/auto-imports.d.ts index ff4746fd1ac..10362e2b5f1 100644 --- a/client/web-sveltekit/src/auto-imports.d.ts +++ b/client/web-sveltekit/src/auto-imports.d.ts @@ -10,13 +10,17 @@ declare global { const ILucideAlertCircle: typeof import('~icons/lucide/alert-circle')['default'] const ILucideArchive: typeof import('~icons/lucide/archive')['default'] const ILucideArrowDownFromLine: typeof import('~icons/lucide/arrow-down-from-line')['default'] + const ILucideArrowLeftFromLine: typeof import('~icons/lucide/arrow-left-from-line')['default'] const ILucideArrowRight: typeof import('~icons/lucide/arrow-right')['default'] + const ILucideArrowRightFromLine: typeof import('~icons/lucide/arrow-right-from-line')['default'] const ILucideBarChartBig: typeof import('~icons/lucide/bar-chart-big')['default'] const ILucideBookOpen: typeof import('~icons/lucide/book-open')['default'] const ILucideBookX: typeof import('~icons/lucide/book-x')['default'] const ILucideBraces: typeof import('~icons/lucide/braces')['default'] const ILucideBrackets: typeof import('~icons/lucide/brackets')['default'] + const ILucideBrainCircuit: typeof import('~icons/lucide/brain-circuit')['default'] const ILucideCaseSensitive: typeof import('~icons/lucide/case-sensitive')['default'] + const ILucideCheck: typeof import('~icons/lucide/check')['default'] const ILucideChevronDown: typeof import('~icons/lucide/chevron-down')['default'] const ILucideChevronFirst: typeof import('~icons/lucide/chevron-first')['default'] const ILucideChevronLast: typeof import('~icons/lucide/chevron-last')['default'] @@ -29,6 +33,7 @@ declare global { const ILucideCodesandbox: typeof import('~icons/lucide/codesandbox')['default'] const ILucideCopy: typeof import('~icons/lucide/copy')['default'] const ILucideCornerRightDown: typeof import('~icons/lucide/corner-right-down')['default'] + const ILucideCornerRightUp: typeof import('~icons/lucide/corner-right-up')['default'] const ILucideDatabase: typeof import('~icons/lucide/database')['default'] const ILucideDiff: typeof import('~icons/lucide/diff')['default'] const ILucideEarth: typeof import('~icons/lucide/earth')['default'] @@ -38,6 +43,7 @@ declare global { const ILucideFile: typeof import('~icons/lucide/file')['default'] const ILucideFileCode: typeof import('~icons/lucide/file-code')['default'] const ILucideFileJson: typeof import('~icons/lucide/file-json')['default'] + const ILucideFileSearch2: typeof import('~icons/lucide/file-search2')['default'] const ILucideFileStack: typeof import('~icons/lucide/file-stack')['default'] const ILucideFileTerminal: typeof import('~icons/lucide/file-terminal')['default'] const ILucideFileText: typeof import('~icons/lucide/file-text')['default'] @@ -48,6 +54,7 @@ declare global { const ILucideFolderGit2: typeof import('~icons/lucide/folder-git2')['default'] const ILucideFolderOpen: typeof import('~icons/lucide/folder-open')['default'] const ILucideFolderUp: typeof import('~icons/lucide/folder-up')['default'] + const ILucideFullscreen: typeof import('~icons/lucide/fullscreen')['default'] const ILucideGitBranch: typeof import('~icons/lucide/git-branch')['default'] const ILucideGitCommitVertical: typeof import('~icons/lucide/git-commit-vertical')['default'] const ILucideGitCompare: typeof import('~icons/lucide/git-compare')['default'] @@ -61,6 +68,7 @@ declare global { const ILucideLock: typeof import('~icons/lucide/lock')['default'] const ILucideMenu: typeof import('~icons/lucide/menu')['default'] const ILucideOctagonX: typeof import('~icons/lucide/octagon-x')['default'] + const ILucidePanelBottomClose: typeof import('~icons/lucide/panel-bottom-close')['default'] const ILucidePanelLeftClose: typeof import('~icons/lucide/panel-left-close')['default'] const ILucidePanelLeftOpen: typeof import('~icons/lucide/panel-left-open')['default'] const ILucidePencil: typeof import('~icons/lucide/pencil')['default'] @@ -69,9 +77,11 @@ declare global { const ILucideSearch: typeof import('~icons/lucide/search')['default'] const ILucideSearchX: typeof import('~icons/lucide/search-x')['default'] const ILucideSettings: typeof import('~icons/lucide/settings')['default'] + const ILucideSpline: typeof import('~icons/lucide/spline')['default'] const ILucideSquareFunction: typeof import('~icons/lucide/square-function')['default'] const ILucideSquareSlash: typeof import('~icons/lucide/square-slash')['default'] const ILucideStar: typeof import('~icons/lucide/star')['default'] + const ILucideSymbols: typeof import('~icons/lucide/symbols')['default'] const ILucideTag: typeof import('~icons/lucide/tag')['default'] const ILucideText: typeof import('~icons/lucide/text')['default'] const ILucideUser: typeof import('~icons/lucide/user')['default'] @@ -83,12 +93,19 @@ declare global { const IPhFileJpgLight: typeof import('~icons/ph/file-jpg-light')['default'] const IPhFilePngLight: typeof import('~icons/ph/file-png-light')['default'] const IPhGifFill: typeof import('~icons/ph/gif-fill')['default'] + const IPhJpgLight: typeof import('~icons/ph/jpg-light')['default'] + const IPhPngLight: typeof import('~icons/ph/png-light')['default'] + const IPhPnglight: typeof import('~icons/ph/pnglight')['default'] + const IPhosphorPngLight: typeof import('~icons/ph/osphor-png-light')['default'] + const IPhosphorePngLight: typeof import('~icons/ph/osphore-png-light')['default'] const ISgBatchChanges: typeof import('~icons/sg/batch-changes')['default'] const ISgCody: typeof import('~icons/sg/cody')['default'] const ISgMark: typeof import('~icons/sg/mark')['default'] + const ISgSymbols: typeof import('~icons/sg/symbols')['default'] const ISimpleIconsApachegroovy: typeof import('~icons/simple-icons/apachegroovy')['default'] const ISimpleIconsBitbucket: typeof import('~icons/simple-icons/bitbucket')['default'] const ISimpleIconsC: typeof import('~icons/simple-icons/c')['default'] + const ISimpleIconsCSS3: typeof import('~icons/simple-icons/c-s-s3')['default'] const ISimpleIconsClojure: typeof import('~icons/simple-icons/clojure')['default'] const ISimpleIconsCmake: typeof import('~icons/simple-icons/cmake')['default'] const ISimpleIconsCoffeescript: typeof import('~icons/simple-icons/coffeescript')['default'] @@ -115,6 +132,7 @@ declare global { const ISimpleIconsHtml5: typeof import('~icons/simple-icons/html5')['default'] const ISimpleIconsJavascript: typeof import('~icons/simple-icons/javascript')['default'] const ISimpleIconsJinja: typeof import('~icons/simple-icons/jinja')['default'] + const ISimpleIconsJpeg: typeof import('~icons/simple-icons/jpeg')['default'] const ISimpleIconsJulia: typeof import('~icons/simple-icons/julia')['default'] const ISimpleIconsKotlin: typeof import('~icons/simple-icons/kotlin')['default'] const ISimpleIconsLlvm: typeof import('~icons/simple-icons/llvm')['default'] diff --git a/client/web-sveltekit/src/lib/CodeMirrorBlob.svelte b/client/web-sveltekit/src/lib/CodeMirrorBlob.svelte index 8e2e71714b2..921411db76f 100644 --- a/client/web-sveltekit/src/lib/CodeMirrorBlob.svelte +++ b/client/web-sveltekit/src/lib/CodeMirrorBlob.svelte @@ -131,6 +131,7 @@ import { browser } from '$app/environment' import { goto } from '$app/navigation' + import { getExplorePanelContext } from '$lib/codenav/ExplorePanel.svelte' import type { LineOrPositionOrRange } from '$lib/common' import { type CodeIntelAPI, Occurrence } from '$lib/shared' import { @@ -166,7 +167,7 @@ getScrollSnapshot as getScrollSnapshot_internal, } from './codemirror/utils' import { registerHotkey } from './Hotkey' - import { goToDefinition, openImplementations, openReferences } from './repo/blob' + import { goToDefinition, openImplementations } from './repo/blob' import { createLocalWritable } from './stores' export let blobInfo: BlobInfo @@ -229,6 +230,7 @@ filePath: blobInfo.filePath, languages: blobInfo.languages, } + const { openReferences } = getExplorePanelContext() $: codeIntelExtension = codeIntelAPI ? createCodeIntelExtension({ api: { @@ -236,7 +238,7 @@ documentInfo: documentInfo, goToDefinition: (view, definition, options) => goToDefinition(documentInfo, view, definition, options), - openReferences, + openReferences: (_view, documentInfo, occurrence) => openReferences({ documentInfo, occurrence }), openImplementations, createTooltipView: options => new HovercardView(options.view, options.token, options.hovercardData), }, diff --git a/client/web-sveltekit/src/lib/Scroller.svelte b/client/web-sveltekit/src/lib/Scroller.svelte index 4ebb0543e92..229efc07ae5 100644 --- a/client/web-sveltekit/src/lib/Scroller.svelte +++ b/client/web-sveltekit/src/lib/Scroller.svelte @@ -8,9 +8,11 @@ import { afterUpdate, createEventDispatcher } from 'svelte' export let margin: number + export let viewport: HTMLElement | undefined = undefined + export let scroller: HTMLElement | undefined = undefined export function capture(): Capture { - return { scroll: scroller.scrollTop } + return { scroll: scroller?.scrollTop || 0 } } export function restore(data?: Capture) { @@ -31,14 +33,13 @@ const dispatch = createEventDispatcher<{ more: void }>() - let viewport: HTMLElement - let scroller: HTMLElement - function handleScroll() { - const remaining = scroller.scrollHeight - (scroller.scrollTop + viewport.clientHeight) + if (scroller && viewport) { + const remaining = scroller.scrollHeight - (scroller.scrollTop + (viewport?.clientHeight ?? 0)) - if (remaining < margin) { - dispatch('more') + if (remaining < margin) { + dispatch('more') + } } } @@ -46,13 +47,13 @@ // This premptively triggers a 'more' event when the scrollable content is smaller than than // scroller. Without this, the 'more' event would not be triggered because there is nothing // to scroll. - if (scroller.scrollHeight <= scroller.clientHeight) { + if (scroller && scroller.scrollHeight <= scroller.clientHeight) { dispatch('more') } }) -
+
diff --git a/client/web-sveltekit/src/lib/Tabs.svelte b/client/web-sveltekit/src/lib/Tabs.svelte index f3323723a73..d338c4feb99 100644 --- a/client/web-sveltekit/src/lib/Tabs.svelte +++ b/client/web-sveltekit/src/lib/Tabs.svelte @@ -93,11 +93,12 @@ display: flex; align-items: center; border-bottom: 1px solid var(--border-color); + gap: 2rem; .actions { - flex-shrink: 0; margin-left: auto; margin-right: var(--tabs-horizontal-spacing); + min-width: 0; } } } diff --git a/client/web-sveltekit/src/lib/TreeNode.svelte b/client/web-sveltekit/src/lib/TreeNode.svelte index 0b8970c931e..794184e2190 100644 --- a/client/web-sveltekit/src/lib/TreeNode.svelte +++ b/client/web-sveltekit/src/lib/TreeNode.svelte @@ -31,6 +31,7 @@ $: selected = $treeState.selected === nodeID $: tabindex = $treeState.focused === nodeID ? 0 : -1 $: children = expandable && expanded ? treeProvider.fetchChildren(entry) : null + $: disableScope = $treeState.disableScope let level = getContext('tree-node-nesting')?.level ?? 0 setContext('tree-node-nesting', { level: level + 1 }) @@ -76,30 +77,37 @@ {tabindex} data-treeitem data-node-id={nodeID} + class:disable-scope={disableScope} style="--tree-node-nested-level: {level}" > - +
+ - {#if expandable} - - - {/if} - - +
+ {#if expandable} + + + {/if} + +
+
{#if expanded && children} {#await children}
@@ -123,67 +131,70 @@ $shiftWidth: 1.25rem; $gap: 0.25rem; - [role='treeitem'] { - border-radius: var(--border-radius); + li[role='treeitem'] { + --indent-size: calc(var(--tree-node-nested-level) * #{$shiftWidth}); + + --scope-size: calc(var(--icon-inline-size) + #{$gap} - 1px); + &.disable-scope { + --scope-size: 0px; + :global([data-scope-button]) { + display: none; + } + } &[tabindex='0']:focus { box-shadow: none; > .label { - box-shadow: var(--focus-box-shadow); + box-shadow: var(--focus-shadow-inner); } } - } - .loading { - // Indent with two rem since loading represents next nested level - margin-left: calc(var(--tree-node-nested-level) * #{$shiftWidth} + 2 * var(--icon-inline-size) + 2 * #{$gap}); - margin-top: 0.25rem; - } + .label { + display: flex; + gap: $gap; + padding: 0.2rem $gap; + align-items: center; - .label { - display: flex; - gap: $gap; - padding: 0.2rem $gap; - justify-content: space-between; - align-items: center; + // Change icon color based on selected item state + --icon-color: var(--tree-node-expand-icon-color); + color: var(--tree-node-label-color, var(--text-body)); - // Change icon color based on selected item state - --icon-color: var(--tree-node-expand-icon-color); - color: var(--tree-node-label-color, var(--text-body)); - - li[data-treeitem][aria-selected='true'] > & { - --icon-color: currentColor; - --file-icon-color: currentColor; - - color: var(--tree-node-label-color, var(--body-bg)); - } - - :global([data-scope-button]) { - visibility: hidden; - margin-right: calc(var(--tree-node-nested-level) * #{$shiftWidth}); - } - - &.expandable:hover, - &.expandable:focus { :global([data-scope-button]) { - visibility: visible; + visibility: hidden; + } + + &.expandable:hover, + &.expandable:focus { + :global([data-scope-button]) { + visibility: visible; + } + } + + .indented { + display: inherit; + gap: inherit; + margin-left: var(--indent-size); } } - } - ul { - position: relative; - isolation: isolate; - &::before { - position: absolute; - content: ''; - border-left: 1px solid var(--secondary); - height: 100%; - transform: translateX( - calc(var(--tree-node-nested-level) * #{$shiftWidth} + var(--icon-inline-size) * 1.5 + #{$gap} + 2px) - ); - z-index: 1; + .loading { + // Indent with two rem since loading represents next nested level + margin-left: calc(var(--scope-size) + var(--indent-size) + 2 * #{$gap}); + margin-top: 0.25rem; + } + + ul { + position: relative; + isolation: isolate; + &::before { + position: absolute; + content: ''; + border-left: 1px solid var(--secondary); + height: 100%; + transform: translateX(calc(#{$gap} + var(--scope-size) + var(--icon-inline-size) / 2 - 1px)); + z-index: 1; + } } } diff --git a/client/web-sveltekit/src/lib/TreeView.ts b/client/web-sveltekit/src/lib/TreeView.ts index c65b99f46e0..bf3a315f481 100644 --- a/client/web-sveltekit/src/lib/TreeView.ts +++ b/client/web-sveltekit/src/lib/TreeView.ts @@ -7,7 +7,7 @@ export interface TreeProvider { */ getEntries(): T[] /** - * Whether or not the provided entry is has (possibly) children or not. + * Whether or not the provided entry has (possibly) children or not. */ isExpandable(entry: T): boolean /** @@ -29,6 +29,7 @@ export interface SingleSelectTreeState { focused: string selected: string expandedNodes: Set + disableScope: boolean } export type TreeState = SingleSelectTreeState @@ -38,6 +39,7 @@ export function createEmptySingleSelectTreeState(): SingleSelectTreeState { focused: '', selected: '', expandedNodes: new Set(), + disableScope: false, } } diff --git a/client/web-sveltekit/src/lib/codenav/ExplorePanel.gql b/client/web-sveltekit/src/lib/codenav/ExplorePanel.gql new file mode 100644 index 00000000000..2e53038b45c --- /dev/null +++ b/client/web-sveltekit/src/lib/codenav/ExplorePanel.gql @@ -0,0 +1,50 @@ +query ExplorePanel_Usages( + $repoName: String! + $revspec: String! + $filePath: String! + $rangeStart: PositionInput! + $rangeEnd: PositionInput! + $symbolComparator: SymbolComparator + $first: Int! + $afterCursor: String +) { + usagesForSymbol( + symbol: $symbolComparator + range: { repository: $repoName, revision: $revspec, path: $filePath, start: $rangeStart, end: $rangeEnd } + first: $first + after: $afterCursor + ) { + ...ExplorePanel_UsageConnection + pageInfo { + hasNextPage + endCursor + } + } +} + +fragment ExplorePanel_UsageConnection on UsageConnection { + nodes { + ...ExplorePanel_Usage + } +} + +fragment ExplorePanel_Usage on Usage { + provenance + usageRange { + repository + revision + path + range { + start { + line + character + } + end { + line + character + } + } + } + surroundingContent + usageKind +} diff --git a/client/web-sveltekit/src/lib/codenav/ExplorePanel.stories.svelte b/client/web-sveltekit/src/lib/codenav/ExplorePanel.stories.svelte new file mode 100644 index 00000000000..4c2e13a7880 --- /dev/null +++ b/client/web-sveltekit/src/lib/codenav/ExplorePanel.stories.svelte @@ -0,0 +1,66 @@ + + + + + +
+ +
+
+ + +
+ +
+
+ + diff --git a/client/web-sveltekit/src/lib/codenav/ExplorePanel.svelte b/client/web-sveltekit/src/lib/codenav/ExplorePanel.svelte new file mode 100644 index 00000000000..431114b35ae --- /dev/null +++ b/client/web-sveltekit/src/lib/codenav/ExplorePanel.svelte @@ -0,0 +1,427 @@ + + + + +{#if $inputs.activeOccurrence === undefined} +
+ +

Select a symbol in the code panel to view references.

+
+{:else} + + + + + + + {#if loading} +
+ + + +
+ {:else} + connection?.fetchMore()}> + {#if displayGroups.length > 0} +
    + {#each displayGroups as pathGroup} +
  • + +
  • + {/each} +
+ {#if loading} + + {/if} + {:else} +
No results.
+ {/if} +
+ {/if} +
+
+{/if} + + diff --git a/client/web-sveltekit/src/lib/codenav/ExplorePanelFileUsages.svelte b/client/web-sveltekit/src/lib/codenav/ExplorePanelFileUsages.svelte new file mode 100644 index 00000000000..8be60a91858 --- /dev/null +++ b/client/web-sveltekit/src/lib/codenav/ExplorePanelFileUsages.svelte @@ -0,0 +1,173 @@ + + +
(visible = visible || event.detail)} +> +
+ + + + + + +
+
+ {#each usageExcerpts as excerpt} + + + + {/each} +
+
+ + diff --git a/client/web-sveltekit/src/lib/path/DisplayPath.svelte b/client/web-sveltekit/src/lib/path/DisplayPath.svelte index fb1c9fbb7de..ef63314d55c 100644 --- a/client/web-sveltekit/src/lib/path/DisplayPath.svelte +++ b/client/web-sveltekit/src/lib/path/DisplayPath.svelte @@ -58,7 +58,7 @@ Wrap the anchor element with a span because otherwise it adds spaces around it when copied -->{#if pathHref}{part}{:else}{part}{/if}{#if showCopyButton}{/if} @@ -111,7 +110,7 @@ // HACK: The file icon is placed after the file name in the DOM so it // doesn't add any spaces in the file path when copied. This visually // reorders the last path element after the file icon. - .after { + .last { order: 1; } @@ -123,6 +122,7 @@ } [data-copy-button] { + order: 1; margin-left: 0.5rem; user-select: none; // Avoids a trailing space on select + copy } diff --git a/client/web-sveltekit/src/lib/repo/LastCommit.svelte b/client/web-sveltekit/src/lib/repo/LastCommit.svelte index 2a643da67e6..5ee62e34b7b 100644 --- a/client/web-sveltekit/src/lib/repo/LastCommit.svelte +++ b/client/web-sveltekit/src/lib/repo/LastCommit.svelte @@ -30,6 +30,7 @@ } a { + flex: 1; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; diff --git a/client/web-sveltekit/src/lib/repo/blob.ts b/client/web-sveltekit/src/lib/repo/blob.ts index 7f18d0c51da..ad7634476c1 100644 --- a/client/web-sveltekit/src/lib/repo/blob.ts +++ b/client/web-sveltekit/src/lib/repo/blob.ts @@ -3,7 +3,7 @@ import { get } from 'svelte/store' import { goto as svelteGoto } from '$app/navigation' import { page } from '$app/stores' -import { toPrettyBlobURL } from '$lib/shared' +import { Occurrence, toPrettyBlobURL } from '$lib/shared' import { positionToOffset, type Definition, @@ -89,11 +89,7 @@ export async function goToDefinition( } } -export function openReferences( - view: EditorView, - documentInfo: DocumentInfo, - occurrence: Definition['occurrence'] -): void { +export function openReferences(view: EditorView, documentInfo: DocumentInfo, occurrence: Occurrence): void { const url = toPrettyBlobURL({ repoName: documentInfo.repoName, revision: documentInfo.revision, diff --git a/client/web-sveltekit/src/lib/wildcard/resizable-panel/PanelResizeHandle.svelte b/client/web-sveltekit/src/lib/wildcard/resizable-panel/PanelResizeHandle.svelte index f290ab32c95..4de090b4ff6 100644 --- a/client/web-sveltekit/src/lib/wildcard/resizable-panel/PanelResizeHandle.svelte +++ b/client/web-sveltekit/src/lib/wildcard/resizable-panel/PanelResizeHandle.svelte @@ -5,11 +5,13 @@ - -
- - - - {#if !$references.fetching && !$references.error && locations.length === 0} -
- No references found. -
- {/if} -
    - {#each locations as location (location.canonicalURL)} - {@const selected = selectedLocation?.canonicalURL === location.canonicalURL} - -
  • (selectedLocation = selected ? null : location)} - > - - - - - - - {location.resource.name} - - - - {#if location.range} - :{location.range.start.line + 1}:{location.range.start.character + 1} - {/if} -
  • - {/each} -
- {#if $references.fetching} -
- {:else if $references.error} -
- Unable to load references: {$references.error.message} -
- {/if} -
-
- {#if previewURL} - - - (selectedLocation = null)} /> - - {/if} -
-
- - diff --git a/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/ReferencePanelCodeExcerpt.gql b/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/ReferencePanelCodeExcerpt.gql deleted file mode 100644 index b761e1094a2..00000000000 --- a/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/ReferencePanelCodeExcerpt.gql +++ /dev/null @@ -1,23 +0,0 @@ -fragment ReferencePanelCodeExcerpt_Location on Location { - resource { - content - path - commit { - oid - } - repository { - id - name - } - } - range { - start { - line - character - } - end { - line - character - } - } -} diff --git a/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/ReferencePanelCodeExcerpt.svelte b/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/ReferencePanelCodeExcerpt.svelte deleted file mode 100644 index df00b5bf532..00000000000 --- a/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/ReferencePanelCodeExcerpt.svelte +++ /dev/null @@ -1,77 +0,0 @@ - - - - -{#if location.range && plaintextLines.length > 0} -
(visible = visible || event.detail)}> - -
-{:else} -
(no content information)
-{/if} diff --git a/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/layout.gql b/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/layout.gql index f218540d090..003778ebab9 100644 --- a/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/layout.gql +++ b/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/layout.gql @@ -38,36 +38,3 @@ fragment GitHistory_HistoryConnection on GitCommitConnection { endCursor } } - -query RepoPage_PreciseCodeIntel( - $repoName: String! - $revspec: String! - $filePath: String! - $line: Int! - $character: Int! - $first: Int - $afterCursor: String -) { - repository(name: $repoName) { - id - commit(rev: $revspec) { - id - blob(path: $filePath) { - canonicalURL - lsif { - references(line: $line, character: $character, first: $first, after: $afterCursor) { - ...RepoPage_ReferencesLocationConnection - } - } - } - } - } -} - -fragment RepoPage_ReferencesLocationConnection on LocationConnection { - ...ReferencePanel_LocationConnection - pageInfo { - hasNextPage - endCursor - } -} diff --git a/client/web-sveltekit/src/routes/svelte-overrides.scss b/client/web-sveltekit/src/routes/svelte-overrides.scss index 511568e0faa..a1ebef52355 100644 --- a/client/web-sveltekit/src/routes/svelte-overrides.scss +++ b/client/web-sveltekit/src/routes/svelte-overrides.scss @@ -21,6 +21,7 @@ body { --font-size-tiny: 0.8125rem; --code-font-size: 13px; --border-radius: 4px; + --focus-shadow-inner: 0 0 0 2px var(--primary-2) inset; input::placeholder { color: var(--text-muted); diff --git a/client/web/src/repo/blob/codemirror/codeintel/occurrences.ts b/client/web/src/repo/blob/codemirror/codeintel/occurrences.ts index 443621e2bb4..b1e1a3eca73 100644 --- a/client/web/src/repo/blob/codemirror/codeintel/occurrences.ts +++ b/client/web/src/repo/blob/codemirror/codeintel/occurrences.ts @@ -6,7 +6,7 @@ import { Occurrence, Position, nonOverlappingOccurrences } from '@sourcegraph/sh // we can't reference that type from here since it is generated by // Svelte-specific build tooling. export interface CodeGraphData { - provenance: string + provenance: Provenance commit: string toolInfo: { name: string | null @@ -16,6 +16,8 @@ export interface CodeGraphData { occurrences: Occurrence[] } +export type Provenance = 'PRECISE' | 'SYNTACTIC' | 'SEARCH_BASED' + // IndexedCodeGraphData adds an occurrence index to the code graph // data, which guarantees things like non-overlapping ranges, sorted // ranges, and a line index for faster lookups.