Skip to content
This repository was archived by the owner on Jan 22, 2019. It is now read-only.

Commit f19c77b

Browse files
committed
feat: remove code host search box integration
(The location bar search autocomplete feature remains.) Reason: The experience was not great (it opened results in a new window) and it was disabled by default. It is not worth maintaining a feature that is disabled by default and that has no current plan for improvement. BREAKING CHANGE: The "Open a new window with Sourcegraph search results when you perform a search on your code host." feature was removed. See https://docs.sourcegraph.com/integration/browser_search_engine for a better solution that is provided by the browser extension.
1 parent 5ebcc5d commit f19c77b

File tree

11 files changed

+1
-212
lines changed

11 files changed

+1
-212
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ The tooltips include features like:
2121
- symbol type information & documentation
2222
- go to definition & find references (currently for Go, Java, TypeScript, JavaScript, Python)
2323
- find references
24-
- improved search functionality
2524

2625
#### 🚀 Install: [**Sourcegraph for Chrome**](https://chrome.google.com/webstore/detail/sourcegraph/dgjhfomjieaadpoljlnidmbgkdffpack)[**Sourcegraph for Firefox**](https://addons.mozilla.org/en-US/firefox/addon/sourcegraph/)
2726

src/browser/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export interface StorageItems {
4444
phabricatorURL: string
4545
inlineSymbolSearchEnabled: boolean
4646
renderMermaidGraphsEnabled: boolean
47-
executeSearchEnabled: boolean
4847
identity: string
4948
serverUrls: string[]
5049
enterpriseUrls: string[]
@@ -86,7 +85,6 @@ export const defaultStorageItems: StorageItems = {
8685
phabricatorURL: '',
8786
inlineSymbolSearchEnabled: true,
8887
renderMermaidGraphsEnabled: false,
89-
executeSearchEnabled: false,
9088
identity: '',
9189
enterpriseUrls: [],
9290
serverUserId: '',

src/extension/scripts/inject.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import * as runtime from '../../browser/runtime'
77
import storage from '../../browser/storage'
88
import { StorageItems } from '../../browser/types'
99
import {
10-
setExecuteSearchEnabled,
1110
setInlineSymbolSearchEnabled,
1211
setRenderMermaidGraphsEnabled,
1312
setSourcegraphUrl,
@@ -81,7 +80,6 @@ function injectApplication(): void {
8180
setInlineSymbolSearchEnabled(
8281
items.inlineSymbolSearchEnabled === undefined ? false : items.inlineSymbolSearchEnabled
8382
)
84-
setExecuteSearchEnabled(items.executeSearchEnabled === undefined ? true : items.executeSearchEnabled)
8583
injectGitHubApplication(extensionMarker)
8684
} else if (isSourcegraphServer || /^https?:\/\/(www.)?sourcegraph.com/.test(href)) {
8785
setSourcegraphUrl(sourcegraphServerUrl)

src/libs/code_intelligence/code_intelligence.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import { gitlabCodeHost } from '../gitlab/code_intelligence'
3131
import { phabricatorCodeHost } from '../phabricator/code_intelligence'
3232
import { findCodeViews, getContentOfCodeView } from './code_views'
3333
import { applyDecoration, Controllers, initializeExtensions } from './extensions'
34-
import { initSearch, SearchFeature } from './search'
3534

3635
/**
3736
* Defines a type of code view a given code host can have. It tells us how to
@@ -125,11 +124,6 @@ export interface CodeHost {
125124
*/
126125
adjustOverlayPosition?: (position: OverlayPosition) => OverlayPosition
127126

128-
/**
129-
* Implementation of the search feature for a code host.
130-
*/
131-
search?: SearchFeature
132-
133127
// Extensions related input
134128

135129
/**
@@ -326,10 +320,6 @@ export interface ResolvedCodeView extends CodeViewWithOutSelector {
326320
}
327321

328322
function handleCodeHost(codeHost: CodeHost): Subscription {
329-
if (codeHost.search) {
330-
initSearch(codeHost.search)
331-
}
332-
333323
const documentsSubject = new BehaviorSubject<TextDocumentItem[] | null>([])
334324
const {
335325
hoverifier,

src/libs/code_intelligence/search.ts

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/libs/github/inject.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ import {
6262
import { featureFlags } from '../../shared/util/featureFlags'
6363
import { diffDomFunctions, searchCodeSnippetDOMFunctions, singleFileDOMFunctions } from './dom_functions'
6464
import { injectExtensionsGlobalComponents } from './extensions'
65-
import { initSearch } from './search'
6665
import {
6766
createBlobAnnotatorMount,
6867
getCodeCommentContainers,
@@ -287,7 +286,6 @@ function inject(): void {
287286

288287
injectMermaid()
289288

290-
initSearch()
291289
injectInlineSearch()
292290
}
293291

src/libs/github/search.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/libs/gitlab/code_intelligence.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
import { getCommandPaletteMount } from './extensions'
99
import { resolveCommitFileInfo, resolveDiffFileInfo, resolveFileInfo } from './file_info'
1010
import { getPageInfo, GitLabPageKind } from './scrape'
11-
import { search } from './search'
1211

1312
const toolbarButtonProps = {
1413
className: 'btn btn-default btn-sm',
@@ -95,6 +94,5 @@ export const gitlabCodeHost: CodeHost = {
9594
check: checkIsGitlab,
9695
codeViewResolver,
9796
adjustOverlayPosition,
98-
search,
9997
getCommandPaletteMount,
10098
}

src/libs/gitlab/search.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/shared/components/options/FeatureFlagCard.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ interface Props {
99
}
1010

1111
export class FeatureFlagCard extends React.Component<Props, {}> {
12-
private onExecuteSearchToggled = () => {
13-
storage.setSync({ executeSearchEnabled: !this.props.storage.executeSearchEnabled })
14-
}
15-
1612
private onMermaidToggled = () => {
1713
const renderMermaidGraphsEnabled = !this.props.storage.renderMermaidGraphsEnabled
1814
storage.setSync({ renderMermaidGraphsEnabled })
@@ -27,30 +23,14 @@ export class FeatureFlagCard extends React.Component<Props, {}> {
2723
}
2824

2925
public render(): JSX.Element | null {
30-
const {
31-
inlineSymbolSearchEnabled,
32-
renderMermaidGraphsEnabled,
33-
executeSearchEnabled,
34-
useExtensions,
35-
} = this.props.storage
26+
const { inlineSymbolSearchEnabled, renderMermaidGraphsEnabled, useExtensions } = this.props.storage
3627
return (
3728
<Row className="pb-3">
3829
<Col>
3930
<Card>
4031
<CardHeader>Feature flags</CardHeader>
4132
<CardBody>
4233
<Form>
43-
<FormGroup check={true}>
44-
<Label check={true}>
45-
<Input
46-
onClick={this.onExecuteSearchToggled}
47-
defaultChecked={executeSearchEnabled}
48-
type="checkbox"
49-
/>{' '}
50-
Open a new window with Sourcegraph search results when you perform a search on
51-
your code host.
52-
</Label>
53-
</FormGroup>
5434
<FormGroup check={true}>
5535
<Label check={true}>
5636
<Input

0 commit comments

Comments
 (0)