mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:51:50 +00:00
refactor: extract codeintellify as new package (#29233)
* refactor: extract codeintellify as new package * feat: add client/codeintellify into lsif-ts Co-authored-by: gitstart-sourcegraph <gitstart@users.noreply.github.com>
This commit is contained in:
parent
990ac78b34
commit
f9dc317cfe
1
.github/workflows/lsif-ts.yml
vendored
1
.github/workflows/lsif-ts.yml
vendored
@ -24,6 +24,7 @@ jobs:
|
||||
- client/web
|
||||
- client/wildcard
|
||||
- client/common
|
||||
- client/codeintellify
|
||||
steps:
|
||||
# Setup
|
||||
- name: Checkout
|
||||
|
||||
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -66,6 +66,7 @@
|
||||
"./client/storybook",
|
||||
"./client/extension-api-types",
|
||||
"./client/extension-api",
|
||||
"./client/codeintellify",
|
||||
],
|
||||
"go.lintTool": "golangci-lint",
|
||||
"shellformat.flag": "-i 2 -ci",
|
||||
|
||||
@ -7,13 +7,14 @@ import { useHistory, useLocation } from 'react-router'
|
||||
import { BehaviorSubject, from, Observable, combineLatest } from 'rxjs'
|
||||
import { map, switchMap } from 'rxjs/operators'
|
||||
|
||||
import { MaybeLoadingResult } from '@sourcegraph/codeintellify'
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { Location } from '@sourcegraph/extension-api-types'
|
||||
import { ActionsNavItems } from '@sourcegraph/shared/src/actions/ActionsNavItems'
|
||||
import { wrapRemoteObservable } from '@sourcegraph/shared/src/api/client/api/common'
|
||||
import { PanelViewData } from '@sourcegraph/shared/src/api/extension/extensionHostApi'
|
||||
import { haveInitialExtensionsLoaded } from '@sourcegraph/shared/src/api/features'
|
||||
import { ContributableMenu, Contributions, Evaluated } from '@sourcegraph/shared/src/api/protocol'
|
||||
import { MaybeLoadingResult } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { ActivationProps } from '@sourcegraph/shared/src/components/activation/Activation'
|
||||
import { FetchFileParameters } from '@sourcegraph/shared/src/components/CodeExcerpt'
|
||||
import { Resizable } from '@sourcegraph/shared/src/components/Resizable'
|
||||
@ -23,7 +24,6 @@ import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings'
|
||||
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
import { combineLatestOrDefault } from '@sourcegraph/shared/src/util/rxjs/combineLatestOrDefault'
|
||||
import { isDefined } from '@sourcegraph/shared/src/util/types'
|
||||
import { useObservable } from '@sourcegraph/shared/src/util/useObservable'
|
||||
|
||||
import { match } from '../../../../shared/src/api/client/types/textDocument'
|
||||
|
||||
@ -7,7 +7,7 @@ import { Observable, Subject, Subscription } from 'rxjs'
|
||||
import { catchError, distinctUntilChanged, map, startWith, switchMap } from 'rxjs/operators'
|
||||
import { Badged } from 'sourcegraph'
|
||||
|
||||
import { asError, ErrorLike, isErrorLike } from '@sourcegraph/common'
|
||||
import { asError, ErrorLike, isErrorLike, isDefined } from '@sourcegraph/common'
|
||||
import { Location } from '@sourcegraph/extension-api-types'
|
||||
import { FetchFileParameters } from '@sourcegraph/shared/src/components/CodeExcerpt'
|
||||
import { FileMatch } from '@sourcegraph/shared/src/components/FileMatch'
|
||||
@ -15,7 +15,7 @@ import { VirtualList } from '@sourcegraph/shared/src/components/VirtualList'
|
||||
import { ContentMatch } from '@sourcegraph/shared/src/search/stream'
|
||||
import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings'
|
||||
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
|
||||
import { isDefined, property } from '@sourcegraph/shared/src/util/types'
|
||||
import { property } from '@sourcegraph/shared/src/util/types'
|
||||
import { parseRepoURI } from '@sourcegraph/shared/src/util/url'
|
||||
import { LoadingSpinner } from '@sourcegraph/wildcard'
|
||||
|
||||
|
||||
@ -5,10 +5,10 @@ import React from 'react'
|
||||
import { concat, EMPTY, NEVER, of } from 'rxjs'
|
||||
import * as sinon from 'sinon'
|
||||
|
||||
import { MaybeLoadingResult } from '@sourcegraph/codeintellify'
|
||||
import { Location } from '@sourcegraph/extension-api-types'
|
||||
import { FlatExtensionHostAPI } from '@sourcegraph/shared/src/api/contract'
|
||||
import { pretendProxySubscribable, pretendRemote } from '@sourcegraph/shared/src/api/util'
|
||||
import { MaybeLoadingResult } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { Controller } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { SettingsCascadeOrError } from '@sourcegraph/shared/src/settings/settings'
|
||||
import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService'
|
||||
|
||||
@ -5,9 +5,9 @@ import * as React from 'react'
|
||||
import { Observable, of, Subject, Subscription } from 'rxjs'
|
||||
import { catchError, distinctUntilChanged, endWith, map, startWith, switchMap, tap } from 'rxjs/operators'
|
||||
|
||||
import { MaybeLoadingResult } from '@sourcegraph/codeintellify'
|
||||
import { asError, ErrorLike, isErrorLike } from '@sourcegraph/common'
|
||||
import { Location } from '@sourcegraph/extension-api-types'
|
||||
import { MaybeLoadingResult } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { FetchFileParameters } from '@sourcegraph/shared/src/components/CodeExcerpt'
|
||||
import { Resizable } from '@sourcegraph/shared/src/components/Resizable'
|
||||
import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller'
|
||||
|
||||
@ -13,5 +13,10 @@
|
||||
},
|
||||
"include": ["**/*", ".*", "./src/**/*.json"],
|
||||
"exclude": ["../../node_modules", "./node_modules", "./out"],
|
||||
"references": [{ "path": "../shared" }, { "path": "../storybook" }, { "path": "../common" }],
|
||||
"references": [
|
||||
{ "path": "../shared" },
|
||||
{ "path": "../storybook" },
|
||||
{ "path": "../common" },
|
||||
{ "path": "../codeintellify" },
|
||||
],
|
||||
}
|
||||
|
||||
@ -18,11 +18,11 @@ import {
|
||||
} from 'rxjs/operators'
|
||||
import addDomainPermissionToggle from 'webext-domain-permission-toggle'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { createExtensionHostWorker } from '@sourcegraph/shared/src/api/extension/worker'
|
||||
import { GraphQLResult, requestGraphQLCommon } from '@sourcegraph/shared/src/graphql/graphql'
|
||||
import { EndpointPair } from '@sourcegraph/shared/src/platform/context'
|
||||
import { fetchCache } from '@sourcegraph/shared/src/util/fetchCache'
|
||||
import { isDefined } from '@sourcegraph/shared/src/util/types'
|
||||
|
||||
import { getHeaders } from '../../shared/backend/headers'
|
||||
import { fetchSite } from '../../shared/backend/server'
|
||||
|
||||
@ -5,11 +5,11 @@ import { Target, Page } from 'puppeteer'
|
||||
import { fromEvent } from 'rxjs'
|
||||
import { first, filter, timeout, mergeMap } from 'rxjs/operators'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { getConfig } from '@sourcegraph/shared/src/testing/config'
|
||||
import { Driver, createDriverForTest } from '@sourcegraph/shared/src/testing/driver'
|
||||
import { afterEachSaveScreenshotIfFailed } from '@sourcegraph/shared/src/testing/screenshotReporter'
|
||||
import { retry } from '@sourcegraph/shared/src/testing/utils'
|
||||
import { isDefined } from '@sourcegraph/shared/src/util/types'
|
||||
|
||||
import { closeInstallPageTab, testSingleFilePage } from './shared'
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { URL } from 'url'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations'
|
||||
import {
|
||||
createSharedIntegrationTestContext,
|
||||
IntegrationTestContext,
|
||||
IntegrationTestOptions,
|
||||
} from '@sourcegraph/shared/src/testing/integration/context'
|
||||
import { isDefined } from '@sourcegraph/shared/src/util/types'
|
||||
|
||||
import { BrowserGraphQlOperations } from '../graphql-operations'
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { from } from 'rxjs'
|
||||
import { take } from 'rxjs/operators'
|
||||
|
||||
import { ErrorLike, isErrorLike } from '@sourcegraph/common'
|
||||
import { ErrorLike, isErrorLike, isDefined } from '@sourcegraph/common'
|
||||
import { Settings } from '@sourcegraph/shared/src/settings/settings'
|
||||
import { isDefined, isNot } from '@sourcegraph/shared/src/util/types'
|
||||
import { isNot } from '@sourcegraph/shared/src/util/types'
|
||||
import { buildSearchURLQuery } from '@sourcegraph/shared/src/util/url'
|
||||
|
||||
import { SearchPatternType } from '../../graphql-operations'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { DiffPart } from '@sourcegraph/shared/src/codeintellify/tokenPosition'
|
||||
import { DiffPart } from '@sourcegraph/codeintellify'
|
||||
|
||||
import { DOMFunctions } from '../shared/codeViews'
|
||||
|
||||
|
||||
@ -3,9 +3,9 @@ import { Observable } from 'rxjs'
|
||||
import { fromFetch } from 'rxjs/fetch'
|
||||
import { filter, map } from 'rxjs/operators'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { checkOk } from '@sourcegraph/shared/src/backend/fetch'
|
||||
import { memoizeObservable } from '@sourcegraph/shared/src/util/memoizeObservable'
|
||||
import { isDefined } from '@sourcegraph/shared/src/util/types'
|
||||
|
||||
import { DiffResolvedRevisionSpec } from '../../repo'
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@ import classNames from 'classnames'
|
||||
import { of } from 'rxjs'
|
||||
import { Omit } from 'utility-types'
|
||||
|
||||
import { AdjustmentDirection, PositionAdjuster } from '@sourcegraph/codeintellify'
|
||||
import { NotificationType } from '@sourcegraph/shared/src/api/extension/extensionHostApi'
|
||||
import { AdjustmentDirection, PositionAdjuster } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { FileSpec, RepoSpec, ResolvedRevisionSpec, RevisionSpec } from '@sourcegraph/shared/src/util/url'
|
||||
|
||||
import { querySelectorOrSelf } from '../../util/dom'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { DiffPart } from '@sourcegraph/shared/src/codeintellify/tokenPosition'
|
||||
import { DiffPart } from '@sourcegraph/codeintellify'
|
||||
|
||||
import { DOMFunctions } from '../shared/codeViews'
|
||||
|
||||
|
||||
@ -5,8 +5,8 @@ import { defer, of } from 'rxjs'
|
||||
import { map } from 'rxjs/operators'
|
||||
import { Omit } from 'utility-types'
|
||||
|
||||
import { AdjustmentDirection, PositionAdjuster } from '@sourcegraph/codeintellify'
|
||||
import { NotificationType } from '@sourcegraph/shared/src/api/extension/extensionHostApi'
|
||||
import { AdjustmentDirection, PositionAdjuster } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { PlatformContext } from '@sourcegraph/shared/src/platform/context'
|
||||
import { observeSystemIsLightTheme } from '@sourcegraph/shared/src/theme'
|
||||
import {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { DiffPart } from '@sourcegraph/shared/src/codeintellify/tokenPosition'
|
||||
import { DiffPart } from '@sourcegraph/codeintellify'
|
||||
|
||||
import { DOMFunctions } from '../shared/codeViews'
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { DiffPart } from '@sourcegraph/shared/src/codeintellify/tokenPosition'
|
||||
import { DiffPart } from '@sourcegraph/codeintellify'
|
||||
|
||||
import { DOMFunctions } from '../shared/codeViews'
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import classNames from 'classnames'
|
||||
import { map } from 'rxjs/operators'
|
||||
|
||||
import { AdjustmentDirection, PositionAdjuster } from '@sourcegraph/codeintellify'
|
||||
import { Position } from '@sourcegraph/extension-api-types'
|
||||
import { NotificationType } from '@sourcegraph/shared/src/api/extension/extensionHostApi'
|
||||
import { AdjustmentDirection, PositionAdjuster } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { PlatformContext } from '@sourcegraph/shared/src/platform/context'
|
||||
import { FileSpec, RepoSpec, ResolvedRevisionSpec, RevisionSpec } from '@sourcegraph/shared/src/util/url'
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { DiffPart } from '@sourcegraph/shared/src/codeintellify/tokenPosition'
|
||||
import { DiffPart } from '@sourcegraph/codeintellify'
|
||||
|
||||
import { DOMFunctions } from '../shared/codeViews'
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ import { TestScheduler } from 'rxjs/testing'
|
||||
import * as sinon from 'sinon'
|
||||
import * as sourcegraph from 'sourcegraph'
|
||||
|
||||
import { DiffPart } from '@sourcegraph/codeintellify'
|
||||
import { Range } from '@sourcegraph/extension-api-classes'
|
||||
import { TextDocumentDecoration } from '@sourcegraph/extension-api-types'
|
||||
import { wrapRemoteObservable } from '@sourcegraph/shared/src/api/client/api/common'
|
||||
@ -17,7 +18,6 @@ import { FlatExtensionHostAPI } from '@sourcegraph/shared/src/api/contract'
|
||||
import { ExtensionCodeEditor } from '@sourcegraph/shared/src/api/extension/api/codeEditor'
|
||||
import { NotificationType } from '@sourcegraph/shared/src/api/extension/extensionHostApi'
|
||||
import { integrationTestContext } from '@sourcegraph/shared/src/api/integration-test/testHelpers'
|
||||
import { DiffPart } from '@sourcegraph/shared/src/codeintellify/tokenPosition'
|
||||
import { Controller } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { SuccessGraphQLResult } from '@sourcegraph/shared/src/graphql/graphql'
|
||||
import { IQuery } from '@sourcegraph/shared/src/graphql/schema'
|
||||
|
||||
@ -36,7 +36,16 @@ import {
|
||||
} from 'rxjs/operators'
|
||||
import { NotificationType, HoverAlert } from 'sourcegraph'
|
||||
|
||||
import { asError } from '@sourcegraph/common'
|
||||
import {
|
||||
ContextResolver,
|
||||
createHoverifier,
|
||||
findPositionsFromEvents,
|
||||
Hoverifier,
|
||||
HoverState,
|
||||
MaybeLoadingResult,
|
||||
DiffPart,
|
||||
} from '@sourcegraph/codeintellify'
|
||||
import { asError, isDefined } from '@sourcegraph/common'
|
||||
import { TextDocumentDecoration, WorkspaceRoot } from '@sourcegraph/extension-api-types'
|
||||
import { ActionItemAction, urlForClientCommandOpen } from '@sourcegraph/shared/src/actions/ActionItem'
|
||||
import { wrapRemoteObservable } from '@sourcegraph/shared/src/api/client/api/common'
|
||||
@ -45,15 +54,6 @@ import { DecorationMapByLine } from '@sourcegraph/shared/src/api/extension/api/d
|
||||
import { CodeEditorData, CodeEditorWithPartialModel } from '@sourcegraph/shared/src/api/viewerTypes'
|
||||
import { isRepoNotFoundErrorLike } from '@sourcegraph/shared/src/backend/errors'
|
||||
import { isHTTPAuthError } from '@sourcegraph/shared/src/backend/fetch'
|
||||
import {
|
||||
ContextResolver,
|
||||
createHoverifier,
|
||||
findPositionsFromEvents,
|
||||
Hoverifier,
|
||||
HoverState,
|
||||
MaybeLoadingResult,
|
||||
} from '@sourcegraph/shared/src/codeintellify'
|
||||
import { DiffPart } from '@sourcegraph/shared/src/codeintellify/tokenPosition'
|
||||
import {
|
||||
CommandListClassProps,
|
||||
CommandListPopoverButtonClassProps,
|
||||
@ -69,7 +69,7 @@ import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryServi
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
import { isFirefox } from '@sourcegraph/shared/src/util/browserDetection'
|
||||
import { asObservable } from '@sourcegraph/shared/src/util/rxjs/asObservable'
|
||||
import { isDefined, isInstanceOf, property } from '@sourcegraph/shared/src/util/types'
|
||||
import { isInstanceOf, property } from '@sourcegraph/shared/src/util/types'
|
||||
import {
|
||||
FileSpec,
|
||||
UIPositionSpec,
|
||||
|
||||
@ -4,7 +4,7 @@ import { readFile } from 'mz/fs'
|
||||
import Simmer, { Options as SimmerOptions } from 'simmerjs'
|
||||
import { SetIntersection } from 'utility-types'
|
||||
|
||||
import { DiffPart } from '@sourcegraph/shared/src/codeintellify/tokenPosition'
|
||||
import { DiffPart } from '@sourcegraph/codeintellify'
|
||||
|
||||
import { CodeHost, MountGetter } from './codeHost'
|
||||
import { CodeView, DOMFunctions } from './codeViews'
|
||||
|
||||
@ -2,9 +2,8 @@ import { Observable, of, zip, OperatorFunction, from } from 'rxjs'
|
||||
import { catchError, map, switchMap } from 'rxjs/operators'
|
||||
import { Omit } from 'utility-types'
|
||||
|
||||
import { DiffPart, DOMFunctions as CodeIntellifyDOMFuncions, PositionAdjuster } from '@sourcegraph/codeintellify'
|
||||
import { Selection } from '@sourcegraph/extension-api-types'
|
||||
import { PositionAdjuster } from '@sourcegraph/shared/src/codeintellify/hoverifier'
|
||||
import { DiffPart, DOMFunctions as CodeIntellifyDOMFuncions } from '@sourcegraph/shared/src/codeintellify/tokenPosition'
|
||||
import { PlatformContext } from '@sourcegraph/shared/src/platform/context'
|
||||
import { FileSpec, RepoSpec, ResolvedRevisionSpec, RevisionSpec } from '@sourcegraph/shared/src/util/url'
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import { isEqual } from 'lodash'
|
||||
import * as React from 'react'
|
||||
import { render } from 'react-dom'
|
||||
|
||||
import { DiffPart } from '@sourcegraph/codeintellify'
|
||||
import { TextDocumentDecoration } from '@sourcegraph/extension-api-types'
|
||||
import {
|
||||
decorationAttachmentStyleForTheme,
|
||||
@ -12,7 +13,6 @@ import {
|
||||
groupDecorationsByLine,
|
||||
} from '@sourcegraph/shared/src/api/extension/api/decorations'
|
||||
import { ContributableMenu } from '@sourcegraph/shared/src/api/protocol'
|
||||
import { DiffPart } from '@sourcegraph/shared/src/codeintellify/tokenPosition'
|
||||
import {
|
||||
CommandListPopoverButton,
|
||||
CommandListPopoverButtonProps,
|
||||
|
||||
@ -13,13 +13,13 @@ import {
|
||||
} from 'rxjs/operators'
|
||||
import type { HoverAlert } from 'sourcegraph'
|
||||
|
||||
import { ErrorLike, isErrorLike } from '@sourcegraph/common'
|
||||
import { ErrorLike, isErrorLike, isDefined } from '@sourcegraph/common'
|
||||
import { MarkupKind } from '@sourcegraph/extension-api-classes'
|
||||
import { syncRemoteSubscription } from '@sourcegraph/shared/src/api/util'
|
||||
import { Controller as ExtensionsController } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { PlatformContext } from '@sourcegraph/shared/src/platform/context'
|
||||
import { Settings } from '@sourcegraph/shared/src/settings/settings'
|
||||
import { isDefined, isNot } from '@sourcegraph/shared/src/util/types'
|
||||
import { isNot } from '@sourcegraph/shared/src/util/types'
|
||||
|
||||
import { MutationRecordLike } from '../../util/dom'
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import { asyncScheduler, defer, from, Observable, OperatorFunction, Subscription } from 'rxjs'
|
||||
import { concatAll, filter, mergeMap, observeOn, tap } from 'rxjs/operators'
|
||||
|
||||
import { isDefined, isInstanceOf } from '@sourcegraph/shared/src/util/types'
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { isInstanceOf } from '@sourcegraph/shared/src/util/types'
|
||||
|
||||
import { MutationRecordLike, querySelectorAllOrSelf } from '../../util/dom'
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
{ "path": "../branded" },
|
||||
{ "path": "../../schema" },
|
||||
{ "path": "../common" },
|
||||
{ "path": "../codeintellify" },
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
|
||||
1
client/codeintellify/.eslintignore
Normal file
1
client/codeintellify/.eslintignore
Normal file
@ -0,0 +1 @@
|
||||
out/
|
||||
19
client/codeintellify/.eslintrc.js
Normal file
19
client/codeintellify/.eslintrc.js
Normal file
@ -0,0 +1,19 @@
|
||||
// @ts-check
|
||||
const baseConfig = require('../../.eslintrc.js')
|
||||
module.exports = {
|
||||
extends: '../../.eslintrc.js',
|
||||
parserOptions: {
|
||||
...baseConfig.parserOptions,
|
||||
project: [__dirname + '/tsconfig.json'],
|
||||
},
|
||||
rules: {},
|
||||
overrides: [
|
||||
...baseConfig.overrides,
|
||||
{
|
||||
files: ['src/*.test.*', 'src/testutils/**'],
|
||||
rules: {
|
||||
'import/extensions': ['error', 'never', { html: 'always' }],
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
5
client/codeintellify/babel.config.js
Normal file
5
client/codeintellify/babel.config.js
Normal file
@ -0,0 +1,5 @@
|
||||
// @ts-check
|
||||
|
||||
module.exports = {
|
||||
extends: '../../babel.config.js',
|
||||
}
|
||||
13
client/codeintellify/jest.config.js
Normal file
13
client/codeintellify/jest.config.js
Normal file
@ -0,0 +1,13 @@
|
||||
// @ts-check
|
||||
|
||||
const config = require('../../jest.config.base')
|
||||
|
||||
const exportedConfig = {
|
||||
...config,
|
||||
displayName: 'codeintellify',
|
||||
rootDir: __dirname,
|
||||
roots: ['<rootDir>'],
|
||||
verbose: true,
|
||||
}
|
||||
|
||||
module.exports = exportedConfig
|
||||
13
client/codeintellify/package.json
Normal file
13
client/codeintellify/package.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@sourcegraph/codeintellify",
|
||||
"version": "0.0.1",
|
||||
"description": "Sourcegraph Codeintellify",
|
||||
"main": "./src/index.ts",
|
||||
"sideEffects": false,
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"eslint": "eslint --cache 'src/**/*.[jt]s?(x)'",
|
||||
"test": "jest"
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,8 @@ import { Observable, from } from 'rxjs'
|
||||
import { map } from 'rxjs/operators'
|
||||
import { Subscribable } from 'sourcegraph'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
|
||||
import { MaybeLoadingResult } from './loading'
|
||||
|
||||
/**
|
||||
@ -20,11 +22,6 @@ export const toMaybeLoadingProviderResult = <T>(
|
||||
): Observable<MaybeLoadingResult<T>> =>
|
||||
isPromiseLike(value) ? from(value).pipe(map(result => ({ isLoading: false, result }))) : from(value)
|
||||
|
||||
/**
|
||||
* Returns true if `val` is not `null` or `undefined`
|
||||
*/
|
||||
export const isDefined = <T>(value: T): value is NonNullable<T> => value !== undefined && value !== null
|
||||
|
||||
/**
|
||||
* Returns a function that returns `true` if the given `key` of the object is not `null` or `undefined`.
|
||||
*
|
||||
@ -3,9 +3,10 @@ import { EMPTY, NEVER, of, Subject, Subscription } from 'rxjs'
|
||||
import { delay, distinctUntilChanged, filter, first, map, takeWhile } from 'rxjs/operators'
|
||||
import { TestScheduler } from 'rxjs/testing'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { Range } from '@sourcegraph/extension-api-types'
|
||||
|
||||
import { isDefined, propertyIsDefined } from './helpers'
|
||||
import { propertyIsDefined } from './helpers'
|
||||
import {
|
||||
AdjustmentDirection,
|
||||
createHoverifier,
|
||||
@ -35,9 +35,9 @@ import {
|
||||
startWith,
|
||||
} from 'rxjs/operators'
|
||||
|
||||
import { asError, ErrorLike, isErrorLike } from '@sourcegraph/common'
|
||||
import { Position, Range } from '@sourcegraph/extension-api-types'
|
||||
|
||||
import { asError, ErrorLike, isErrorLike } from './errors'
|
||||
import { elementOverlaps, scrollIntoCenterIfNeeded, toMaybeLoadingProviderResult } from './helpers'
|
||||
import { emitLoading, MaybeLoadingResult, LOADING } from './loading'
|
||||
import { calculateOverlayPosition } from './overlayPosition'
|
||||
@ -1,4 +1,6 @@
|
||||
export * from './tokenPosition'
|
||||
export * from './hoverifier'
|
||||
export * from './positions'
|
||||
export * from './overlayPosition'
|
||||
export * from './types'
|
||||
export * from './loading'
|
||||
@ -1,6 +1,6 @@
|
||||
import { ErrorLike } from '@sourcegraph/common'
|
||||
import { Position, Range } from '@sourcegraph/extension-api-types'
|
||||
|
||||
import { ErrorLike } from './errors'
|
||||
import { LOADING } from './loading'
|
||||
import { HoveredToken } from './tokenPosition'
|
||||
|
||||
12
client/codeintellify/tsconfig.json
Normal file
12
client/codeintellify/tsconfig.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"sourceRoot": "src",
|
||||
"rootDir": ".",
|
||||
"outDir": "./out",
|
||||
"baseUrl": "./src",
|
||||
},
|
||||
"references": [{ "path": "../common" }],
|
||||
"include": ["./src/**/*", "./*.ts"],
|
||||
}
|
||||
@ -1 +1,2 @@
|
||||
export * from './types'
|
||||
export * from './errors'
|
||||
|
||||
1
client/common/src/types/index.ts
Normal file
1
client/common/src/types/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './utils'
|
||||
4
client/common/src/types/utils.ts
Normal file
4
client/common/src/types/utils.ts
Normal file
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Returns true if `val` is not `null` or `undefined`
|
||||
*/
|
||||
export const isDefined = <T>(value: T): value is NonNullable<T> => value !== undefined && value !== null
|
||||
@ -21,19 +21,5 @@ module.exports = {
|
||||
},
|
||||
],
|
||||
},
|
||||
overrides: [
|
||||
...baseConfig.overrides,
|
||||
{
|
||||
files: ['src/codeintellify/testdata/**'],
|
||||
rules: {
|
||||
'no-sync': 'warn',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['src/codeintellify/*.test.*', 'src/codeintellify/testutils/**'],
|
||||
rules: {
|
||||
'import/extensions': ['error', 'never', { html: 'always' }],
|
||||
},
|
||||
},
|
||||
],
|
||||
overrides: baseConfig.overrides,
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
|
||||
import { ConfiguredExtension, getScriptURLFromExtensionManifest } from '../../extensions/extension'
|
||||
import { isDefined } from '../../util/types'
|
||||
import { ExecutableExtension, extensionsWithMatchedActivationEvent } from '../extension/activation'
|
||||
|
||||
/** Ensure that we only add <link> tags once for each scriptURL */
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { Remote, ProxyMarked } from 'comlink'
|
||||
import * as sourcegraph from 'sourcegraph'
|
||||
|
||||
import { MaybeLoadingResult } from '@sourcegraph/codeintellify'
|
||||
import { ErrorLike } from '@sourcegraph/common'
|
||||
import * as clientType from '@sourcegraph/extension-api-types'
|
||||
import { MaybeLoadingResult } from '@sourcegraph/shared/src/codeintellify'
|
||||
|
||||
import { ConfiguredExtension } from '../extensions/extension'
|
||||
import { GraphQLResult } from '../graphql/graphql'
|
||||
|
||||
@ -2,9 +2,9 @@ import { from, Observable, of } from 'rxjs'
|
||||
import { catchError, defaultIfEmpty, map, mergeMap, scan, startWith, switchMap } from 'rxjs/operators'
|
||||
import sourcegraph from 'sourcegraph'
|
||||
|
||||
import { asError, ErrorLike } from '@sourcegraph/common'
|
||||
import { asError, ErrorLike, isDefined } from '@sourcegraph/common'
|
||||
|
||||
import { allOf, isDefined, isExactly, isNot, property } from '../../../util/types'
|
||||
import { allOf, isExactly, isNot, property } from '../../../util/types'
|
||||
import { ContributableViewContainer } from '../../protocol'
|
||||
import { RegisteredViewProvider, ViewContexts, ViewProviderResult } from '../extensionHostApi'
|
||||
|
||||
|
||||
@ -12,13 +12,13 @@ import {
|
||||
} from 'rxjs/operators'
|
||||
import * as sourcegraph from 'sourcegraph'
|
||||
|
||||
import { asError, ErrorLike } from '@sourcegraph/common'
|
||||
import { LOADING, MaybeLoadingResult } from '@sourcegraph/codeintellify'
|
||||
import { asError, ErrorLike, isDefined } from '@sourcegraph/common'
|
||||
import * as clientType from '@sourcegraph/extension-api-types'
|
||||
import { LOADING, MaybeLoadingResult } from '@sourcegraph/shared/src/codeintellify'
|
||||
|
||||
import { getModeFromPath } from '../../languages'
|
||||
import { combineLatestOrDefault } from '../../util/rxjs/combineLatestOrDefault'
|
||||
import { allOf, isDefined, isExactly, isNot, property } from '../../util/types'
|
||||
import { allOf, isExactly, isNot, property } from '../../util/types'
|
||||
import { parseRepoURI } from '../../util/url'
|
||||
import { fromHoverMerged } from '../client/types/hover'
|
||||
import { match, TextDocumentIdentifier } from '../client/types/textDocument'
|
||||
|
||||
@ -2,8 +2,8 @@ import { ProxyMarked, proxyMarker, Remote } from 'comlink'
|
||||
import { Observer, of } from 'rxjs'
|
||||
import { Hover } from 'sourcegraph'
|
||||
|
||||
import { MaybeLoadingResult } from '@sourcegraph/codeintellify'
|
||||
import { MarkupKind } from '@sourcegraph/extension-api-classes'
|
||||
import { MaybeLoadingResult } from '@sourcegraph/shared/src/codeintellify'
|
||||
|
||||
import { SettingsCascade } from '../../../settings/settings'
|
||||
import { ClientAPI } from '../../client/api/api'
|
||||
|
||||
@ -2,8 +2,8 @@ import { Observable } from 'rxjs'
|
||||
import { TestScheduler } from 'rxjs/testing'
|
||||
import { DocumentHighlight, Hover } from 'sourcegraph'
|
||||
|
||||
import { LOADING } from '@sourcegraph/codeintellify'
|
||||
import { MarkupKind, Range } from '@sourcegraph/extension-api-classes'
|
||||
import { LOADING } from '@sourcegraph/shared/src/codeintellify'
|
||||
|
||||
import { fromHoverMerged, HoverMerged } from '../../client/types/hover'
|
||||
import { TextDocumentIdentifier } from '../../client/types/textDocument'
|
||||
|
||||
@ -2,10 +2,11 @@ import { from } from 'rxjs'
|
||||
import { distinctUntilChanged, first, switchMap, take, toArray, filter } from 'rxjs/operators'
|
||||
import * as sourcegraph from 'sourcegraph'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { Range, Selection } from '@sourcegraph/extension-api-classes'
|
||||
import * as clientType from '@sourcegraph/extension-api-types'
|
||||
|
||||
import { isDefined, isTaggedUnionMember } from '../../util/types'
|
||||
import { isTaggedUnionMember } from '../../util/types'
|
||||
import { wrapRemoteObservable } from '../client/api/common'
|
||||
|
||||
import { assertToJSON, integrationTestContext } from './testHelpers'
|
||||
|
||||
@ -3,9 +3,9 @@ import { asyncScheduler, Observable, of } from 'rxjs'
|
||||
import { observeOn, take, toArray, map, first } from 'rxjs/operators'
|
||||
import * as sourcegraph from 'sourcegraph'
|
||||
|
||||
import { MaybeLoadingResult } from '@sourcegraph/codeintellify'
|
||||
import { MarkupKind } from '@sourcegraph/extension-api-classes'
|
||||
import { Location } from '@sourcegraph/extension-api-types'
|
||||
import { MaybeLoadingResult } from '@sourcegraph/shared/src/codeintellify'
|
||||
|
||||
import { wrapRemoteObservable } from '../client/api/common'
|
||||
import { FlatExtensionHostAPI } from '../contract'
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
import { from } from 'rxjs'
|
||||
import { distinctUntilChanged, filter, switchMap } from 'rxjs/operators'
|
||||
|
||||
import { isDefined, isTaggedUnionMember } from '../../util/types'
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
|
||||
import { isTaggedUnionMember } from '../../util/types'
|
||||
|
||||
import { assertToJSON, collectSubscribableValues, integrationTestContext } from './testHelpers'
|
||||
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
export interface ErrorLike {
|
||||
message: string
|
||||
name?: string
|
||||
}
|
||||
|
||||
export const isErrorLike = (value: any): value is ErrorLike =>
|
||||
typeof value === 'object' && value !== null && ('message' in value || 'stack' in value) && !('__typename' in value)
|
||||
|
||||
/**
|
||||
* Ensures a value is a proper Error, copying all properties if needed
|
||||
*/
|
||||
export const asError = (error: any): Error => {
|
||||
if (error instanceof Error) {
|
||||
return error
|
||||
}
|
||||
if (typeof error === 'object' && error !== null) {
|
||||
return Object.assign(new Error(error.message), error)
|
||||
}
|
||||
return new Error(error)
|
||||
}
|
||||
@ -4,7 +4,7 @@ import { noop } from 'lodash'
|
||||
import React, { useCallback, AnchorHTMLAttributes } from 'react'
|
||||
import { Key } from 'ts-key-enum'
|
||||
|
||||
import { isDefined } from '../util/types'
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
|
||||
import { Link } from './Link'
|
||||
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
import { isPlainObject } from 'lodash'
|
||||
|
||||
import { ErrorLike, isErrorLike } from '@sourcegraph/common'
|
||||
import { ErrorLike, isErrorLike, isDefined } from '@sourcegraph/common'
|
||||
|
||||
import { ExtensionManifest as ExtensionManifestSchema, EXTENSION_HEADER_COLORS } from '../schema/extensionSchema'
|
||||
import { parseJSONCOrError } from '../util/jsonc'
|
||||
import { isDefined } from '../util/types'
|
||||
|
||||
/**
|
||||
* Represents an input object that is validated against a subset of properties of the {@link ExtensionManifest}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { NotificationType } from 'sourcegraph'
|
||||
|
||||
import { HoverOverlayProps as GenericHoverOverlayProps } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { HoverOverlayProps as GenericHoverOverlayProps } from '@sourcegraph/codeintellify'
|
||||
|
||||
import { ActionItemAction } from '../actions/ActionItem'
|
||||
import { HoverMerged } from '../api/client/types/hover'
|
||||
|
||||
@ -6,9 +6,9 @@ import { TestScheduler } from 'rxjs/testing'
|
||||
import * as sinon from 'sinon'
|
||||
import * as sourcegraph from 'sourcegraph'
|
||||
|
||||
import { HoveredToken, LOADER_DELAY, MaybeLoadingResult } from '@sourcegraph/codeintellify'
|
||||
import { Position, Range } from '@sourcegraph/extension-api-classes'
|
||||
import { Location } from '@sourcegraph/extension-api-types'
|
||||
import { LOADER_DELAY, MaybeLoadingResult } from '@sourcegraph/shared/src/codeintellify'
|
||||
|
||||
import { ActionItemAction } from '../actions/ActionItem'
|
||||
import { ExposedToClient } from '../api/client/mainthread-api'
|
||||
@ -16,7 +16,6 @@ import { FlatExtensionHostAPI } from '../api/contract'
|
||||
import { WorkspaceRootWithMetadata } from '../api/extension/extensionHostApi'
|
||||
import { integrationTestContext } from '../api/integration-test/testHelpers'
|
||||
import { TextDocumentPositionParameters } from '../api/protocol'
|
||||
import { HoveredToken } from '../codeintellify/tokenPosition'
|
||||
import { GraphQLResult, SuccessGraphQLResult } from '../graphql/graphql'
|
||||
import { PlatformContext, URLToFileContext } from '../platform/context'
|
||||
import { resetAllMemoizationCaches } from '../util/memoizeObservable'
|
||||
|
||||
@ -16,9 +16,9 @@ import {
|
||||
mapTo,
|
||||
} from 'rxjs/operators'
|
||||
|
||||
import { HoveredToken, LOADER_DELAY, MaybeLoadingResult, emitLoading } from '@sourcegraph/codeintellify'
|
||||
import { asError, ErrorLike, isErrorLike } from '@sourcegraph/common'
|
||||
import { Location } from '@sourcegraph/extension-api-types'
|
||||
import { LOADER_DELAY, MaybeLoadingResult, emitLoading } from '@sourcegraph/shared/src/codeintellify'
|
||||
|
||||
import { ActionItemAction } from '../actions/ActionItem'
|
||||
import { wrapRemoteObservable } from '../api/client/api/common'
|
||||
@ -28,7 +28,6 @@ import { WorkspaceRootWithMetadata } from '../api/extension/extensionHostApi'
|
||||
import { ContributableMenu, TextDocumentPositionParameters } from '../api/protocol'
|
||||
import { syncRemoteSubscription } from '../api/util'
|
||||
import { resolveRawRepoName } from '../backend/repo'
|
||||
import { HoveredToken } from '../codeintellify/tokenPosition'
|
||||
import { getContributedActionItems } from '../contributions/contributions'
|
||||
import { Controller, ExtensionsControllerProps } from '../extensions/controller'
|
||||
import { PlatformContext, PlatformContextProps, URLToFileContext } from '../platform/context'
|
||||
|
||||
@ -3,11 +3,11 @@ import { isObject } from 'lodash'
|
||||
import { NextObserver, Observable, Subscribable, Subscription } from 'rxjs'
|
||||
import { InputBoxOptions } from 'sourcegraph'
|
||||
|
||||
import { DiffPart } from '@sourcegraph/codeintellify'
|
||||
import { ErrorLike } from '@sourcegraph/common'
|
||||
|
||||
import { SettingsEdit } from '../api/client/services/settings'
|
||||
import { ExecutableExtension } from '../api/extension/activation'
|
||||
import { DiffPart } from '../codeintellify/tokenPosition'
|
||||
import { Scalars } from '../graphql-operations'
|
||||
import { GraphQLClient, GraphQLResult } from '../graphql/graphql'
|
||||
import { Settings, SettingsCascadeOrError } from '../settings/settings'
|
||||
|
||||
@ -4,8 +4,9 @@ import { Observable } from 'rxjs'
|
||||
import { first } from 'rxjs/operators'
|
||||
import { Omit } from 'utility-types'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
|
||||
import { SymbolKind } from '../../graphql-operations'
|
||||
import { isDefined } from '../../util/types'
|
||||
import { MatchedSymbol, PathMatch, RepositoryMatch, SearchMatch } from '../stream'
|
||||
|
||||
import { FilterType, isNegatableFilter, resolveFilter, FILTERS, escapeSpaces } from './filters'
|
||||
|
||||
@ -26,11 +26,12 @@ import { filter, map, concatAll, mergeMap, mergeAll, takeUntil } from 'rxjs/oper
|
||||
import { Key } from 'ts-key-enum'
|
||||
import webExt from 'web-ext'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
|
||||
import { ExternalServiceKind } from '../graphql-operations'
|
||||
import { dataOrThrowErrors, gql, GraphQLResult } from '../graphql/graphql'
|
||||
import { IMutation, IQuery, IRepository } from '../graphql/schema'
|
||||
import { Settings } from '../settings/settings'
|
||||
import { isDefined } from '../util/types'
|
||||
|
||||
import { getConfig } from './config'
|
||||
import { formatPuppeteerConsoleMessage } from './console'
|
||||
|
||||
@ -20,11 +20,6 @@ export type DeepReplace<T, M, R> = {
|
||||
// eslint-disable-next-line unicorn/consistent-function-scoping
|
||||
export const subtypeOf = <U>() => <T extends U>(value: T): T => value
|
||||
|
||||
/**
|
||||
* Returns true if `val` is not `null` or `undefined`
|
||||
*/
|
||||
export const isDefined = <T>(value: T): value is NonNullable<T> => value !== undefined && value !== null
|
||||
|
||||
/**
|
||||
* Returns a type guard that checks whether the given value is strictly equal to a specific value.
|
||||
* This can for example be used with `isNot()` to exclude string literals like `"loading"`.
|
||||
|
||||
@ -13,5 +13,5 @@
|
||||
},
|
||||
"include": ["**/*", ".*", "./src/**/*.json"],
|
||||
"exclude": ["../../node_modules", "./node_modules", "./out", "./src/end-to-end"],
|
||||
"references": [{ "path": "../common" }],
|
||||
"references": [{ "path": "../common" }, { "path": "../codeintellify" }],
|
||||
}
|
||||
|
||||
@ -3,11 +3,11 @@ import { Observable, from, concat } from 'rxjs'
|
||||
import { switchMap } from 'rxjs/operators'
|
||||
import { DocumentHighlight } from 'sourcegraph'
|
||||
|
||||
import { MaybeLoadingResult } from '@sourcegraph/codeintellify'
|
||||
import { wrapRemoteObservable } from '@sourcegraph/shared/src/api/client/api/common'
|
||||
import { HoverMerged } from '@sourcegraph/shared/src/api/client/types/hover'
|
||||
import { FlatExtensionHostAPI } from '@sourcegraph/shared/src/api/contract'
|
||||
import { FileDecorationsByPath } from '@sourcegraph/shared/src/api/extension/extensionHostApi'
|
||||
import { MaybeLoadingResult } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { memoizeObservable } from '@sourcegraph/shared/src/util/memoizeObservable'
|
||||
import {
|
||||
|
||||
@ -7,8 +7,7 @@ import SourceRepositoryMultipleIcon from 'mdi-react/SourceRepositoryMultipleIcon
|
||||
import React, { useEffect, useMemo } from 'react'
|
||||
import { catchError, startWith } from 'rxjs/operators'
|
||||
|
||||
import { asError } from '@sourcegraph/common'
|
||||
import { isErrorLike } from '@sourcegraph/shared/src/codeintellify/errors'
|
||||
import { asError, isErrorLike } from '@sourcegraph/common'
|
||||
import { ActivationProps } from '@sourcegraph/shared/src/components/activation/Activation'
|
||||
import { Link } from '@sourcegraph/shared/src/components/Link'
|
||||
import { displayRepoName } from '@sourcegraph/shared/src/components/RepoFileLink'
|
||||
|
||||
@ -5,8 +5,8 @@ import ChevronRightIcon from 'mdi-react/ChevronRightIcon'
|
||||
import React, { useState, useEffect, useMemo, useCallback } from 'react'
|
||||
import { Unsubscribable } from 'sourcegraph'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { Link } from '@sourcegraph/shared/src/components/Link'
|
||||
import { isDefined } from '@sourcegraph/shared/src/util/types'
|
||||
|
||||
import styles from './Breadcrumbs.module.scss'
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import * as React from 'react'
|
||||
import { useLocation } from 'react-router'
|
||||
import { Link } from 'react-router-dom'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import {
|
||||
decorationAttachmentStyleForTheme,
|
||||
DecorationMapByLine,
|
||||
@ -11,7 +12,7 @@ import {
|
||||
} from '@sourcegraph/shared/src/api/extension/api/decorations'
|
||||
import { LinkOrSpan } from '@sourcegraph/shared/src/components/LinkOrSpan'
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
import { isDefined, property } from '@sourcegraph/shared/src/util/types'
|
||||
import { property } from '@sourcegraph/shared/src/util/types'
|
||||
|
||||
import { DiffHunkLineType, FileDiffHunkFields } from '../../graphql-operations'
|
||||
|
||||
|
||||
@ -2,10 +2,11 @@ import classNames from 'classnames'
|
||||
import * as React from 'react'
|
||||
import { useLocation } from 'react-router'
|
||||
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { TextDocumentDecoration } from '@sourcegraph/extension-api-types'
|
||||
import { DecorationMapByLine, decorationStyleForTheme } from '@sourcegraph/shared/src/api/extension/api/decorations'
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
import { isDefined, property } from '@sourcegraph/shared/src/util/types'
|
||||
import { property } from '@sourcegraph/shared/src/util/types'
|
||||
|
||||
import { DiffHunkLineType, FileDiffHunkFields } from '../../graphql-operations'
|
||||
|
||||
|
||||
@ -4,14 +4,14 @@ import { concatMap, distinctUntilChanged, filter, map, mapTo, switchMap } from '
|
||||
import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect'
|
||||
import { Omit } from 'utility-types'
|
||||
|
||||
import { ErrorLike, isErrorLike } from '@sourcegraph/common'
|
||||
import { Hoverifier } from '@sourcegraph/codeintellify'
|
||||
import { ErrorLike, isErrorLike, isDefined } from '@sourcegraph/common'
|
||||
import { ActionItemAction } from '@sourcegraph/shared/src/actions/ActionItem'
|
||||
import { HoverMerged } from '@sourcegraph/shared/src/api/client/types/hover'
|
||||
import { TextDocumentData, ViewerData, ViewerId } from '@sourcegraph/shared/src/api/viewerTypes'
|
||||
import { Hoverifier } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { Controller as ExtensionsController } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { getModeFromPath } from '@sourcegraph/shared/src/languages'
|
||||
import { isDefined, property } from '@sourcegraph/shared/src/util/types'
|
||||
import { property } from '@sourcegraph/shared/src/util/types'
|
||||
import { FileSpec, RepoSpec, ResolvedRevisionSpec, RevisionSpec, toURIWithPath } from '@sourcegraph/shared/src/util/url'
|
||||
import { useObservable } from '@sourcegraph/shared/src/util/useObservable'
|
||||
|
||||
|
||||
@ -5,12 +5,13 @@ import { combineLatest, from, NEVER, Observable, of, ReplaySubject, Subscription
|
||||
import { distinctUntilKeyChanged, filter, first, map, switchMap, tap } from 'rxjs/operators'
|
||||
import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect'
|
||||
|
||||
import { findPositionsFromEvents } from '@sourcegraph/codeintellify'
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { wrapRemoteObservable } from '@sourcegraph/shared/src/api/client/api/common'
|
||||
import { DecorationMapByLine, groupDecorationsByLine } from '@sourcegraph/shared/src/api/extension/api/decorations'
|
||||
import { ViewerId } from '@sourcegraph/shared/src/api/viewerTypes'
|
||||
import { findPositionsFromEvents } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
import { isDefined, property } from '@sourcegraph/shared/src/util/types'
|
||||
import { property } from '@sourcegraph/shared/src/util/types'
|
||||
import { toURIWithPath } from '@sourcegraph/shared/src/util/url'
|
||||
import { useObservable } from '@sourcegraph/shared/src/util/useObservable'
|
||||
|
||||
|
||||
@ -3,17 +3,17 @@ import React, { useCallback, useMemo, useEffect } from 'react'
|
||||
import { Subject } from 'rxjs'
|
||||
import { repeatWhen, withLatestFrom, filter, map, delay } from 'rxjs/operators'
|
||||
|
||||
import { ErrorLike } from '@sourcegraph/common'
|
||||
import { createHoverifier } from '@sourcegraph/codeintellify'
|
||||
import { ErrorLike, isDefined } from '@sourcegraph/common'
|
||||
import { ActionItemAction } from '@sourcegraph/shared/src/actions/ActionItem'
|
||||
import { HoverMerged } from '@sourcegraph/shared/src/api/client/types/hover'
|
||||
import { createHoverifier } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { ChangesetState } from '@sourcegraph/shared/src/graphql-operations'
|
||||
import { getHoverActions } from '@sourcegraph/shared/src/hover/actions'
|
||||
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
|
||||
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
import { isDefined, property } from '@sourcegraph/shared/src/util/types'
|
||||
import { property } from '@sourcegraph/shared/src/util/types'
|
||||
import { RepoSpec, RevisionSpec, FileSpec, ResolvedRevisionSpec } from '@sourcegraph/shared/src/util/url'
|
||||
import { useObservable } from '@sourcegraph/shared/src/util/useObservable'
|
||||
import { Container } from '@sourcegraph/wildcard'
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import * as H from 'history'
|
||||
import React from 'react'
|
||||
|
||||
import { Hoverifier } from '@sourcegraph/codeintellify'
|
||||
import { ActionItemAction } from '@sourcegraph/shared/src/actions/ActionItem'
|
||||
import { HoverMerged } from '@sourcegraph/shared/src/api/client/types/hover'
|
||||
import { Hoverifier } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
import { RepoSpec, RevisionSpec, FileSpec, ResolvedRevisionSpec } from '@sourcegraph/shared/src/util/url'
|
||||
|
||||
@ -4,9 +4,9 @@ import ChevronDownIcon from 'mdi-react/ChevronDownIcon'
|
||||
import ChevronRightIcon from 'mdi-react/ChevronRightIcon'
|
||||
import React, { useState, useCallback } from 'react'
|
||||
|
||||
import { Hoverifier } from '@sourcegraph/codeintellify'
|
||||
import { ActionItemAction } from '@sourcegraph/shared/src/actions/ActionItem'
|
||||
import { HoverMerged } from '@sourcegraph/shared/src/api/client/types/hover'
|
||||
import { Hoverifier } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
import { RepoSpec, RevisionSpec, FileSpec, ResolvedRevisionSpec } from '@sourcegraph/shared/src/util/url'
|
||||
|
||||
@ -3,16 +3,17 @@ import React, { useState, useCallback, useMemo, useEffect, useContext } from 're
|
||||
import { Subject } from 'rxjs'
|
||||
import { withLatestFrom, map, filter } from 'rxjs/operators'
|
||||
|
||||
import { createHoverifier } from '@sourcegraph/codeintellify'
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
import { ActionItemAction } from '@sourcegraph/shared/src/actions/ActionItem'
|
||||
import { HoverMerged } from '@sourcegraph/shared/src/api/client/types/hover'
|
||||
import { createHoverifier } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { dataOrThrowErrors } from '@sourcegraph/shared/src/graphql/graphql'
|
||||
import { getHoverActions } from '@sourcegraph/shared/src/hover/actions'
|
||||
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
|
||||
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
import { property, isDefined } from '@sourcegraph/shared/src/util/types'
|
||||
import { property } from '@sourcegraph/shared/src/util/types'
|
||||
import { RepoSpec, RevisionSpec, FileSpec, ResolvedRevisionSpec } from '@sourcegraph/shared/src/util/url'
|
||||
import { useObservable } from '@sourcegraph/shared/src/util/useObservable'
|
||||
import { useConnection } from '@sourcegraph/web/src/components/FilteredConnection/hooks/useConnection'
|
||||
|
||||
@ -2,9 +2,9 @@ import * as H from 'history'
|
||||
import React, { useState, useCallback, useMemo } from 'react'
|
||||
import { map, tap } from 'rxjs/operators'
|
||||
|
||||
import { Hoverifier } from '@sourcegraph/codeintellify'
|
||||
import { ActionItemAction } from '@sourcegraph/shared/src/actions/ActionItem'
|
||||
import { HoverMerged } from '@sourcegraph/shared/src/api/client/types/hover'
|
||||
import { Hoverifier } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
import { RepoSpec, RevisionSpec, FileSpec, ResolvedRevisionSpec } from '@sourcegraph/shared/src/util/url'
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import * as H from 'history'
|
||||
import React from 'react'
|
||||
|
||||
import { Hoverifier } from '@sourcegraph/codeintellify'
|
||||
import { ActionItemAction } from '@sourcegraph/shared/src/actions/ActionItem'
|
||||
import { HoverMerged } from '@sourcegraph/shared/src/api/client/types/hover'
|
||||
import { Hoverifier } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
import { RepoSpec, RevisionSpec, FileSpec, ResolvedRevisionSpec } from '@sourcegraph/shared/src/util/url'
|
||||
|
||||
@ -5,10 +5,10 @@ import ChevronRightIcon from 'mdi-react/ChevronRightIcon'
|
||||
import SyncIcon from 'mdi-react/SyncIcon'
|
||||
import React, { useState, useCallback, useEffect } from 'react'
|
||||
|
||||
import { Hoverifier } from '@sourcegraph/codeintellify'
|
||||
import { asError, isErrorLike } from '@sourcegraph/common'
|
||||
import { ActionItemAction } from '@sourcegraph/shared/src/actions/ActionItem'
|
||||
import { HoverMerged } from '@sourcegraph/shared/src/api/client/types/hover'
|
||||
import { Hoverifier } from '@sourcegraph/shared/src/codeintellify'
|
||||
import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller'
|
||||
import { ChangesetState } from '@sourcegraph/shared/src/graphql-operations'
|
||||
import { ThemeProps } from '@sourcegraph/shared/src/theme'
|
||||
|
||||
@ -8,7 +8,7 @@ import ProgressClockIcon from 'mdi-react/ProgressClockIcon'
|
||||
import TimerSandIcon from 'mdi-react/TimerSandIcon'
|
||||
import React, { useMemo } from 'react'
|
||||
|
||||
import { isDefined } from '@sourcegraph/shared/src/util/types'
|
||||
import { isDefined } from '@sourcegraph/common'
|
||||
|
||||
import { ExecutionLogEntry } from '../../../components/ExecutionLogEntry'
|
||||
import { Timeline, TimelineStage } from '../../../components/Timeline'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user