feat: enable code search and add sponsor Sourcegraph (#211)

This commit is contained in:
netcon
2021-03-05 21:53:09 +08:00
committed by GitHub
parent a274e92717
commit b0c1857439
5 changed files with 85 additions and 13 deletions

View File

@@ -105,11 +105,14 @@ $ yarn build
The continued development and maintenance of GitHub1s is made possible by these generous sponsors:
<br />
<a href="https://vercel.com/?utm_source=vscode-github1s&utm_campaign=oss">
<img src="https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/vercel-logo.svg">
</a>
<br /><br />
<table><tbody><tr>
<td><a href="https://vercel.com/?utm_source=vscode-github1s&utm_campaign=oss">
<img height="40px" src="https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/sourcegraph-logo.svg">
</a></td>
<td><a href="https://vercel.com/?utm_source=vscode-github1s&utm_campaign=oss">
<img height="40px" src="https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/vercel-logo.svg">
</a></td>
</tr></tbody></table>
## Third-party Related Projects

View File

@@ -17,7 +17,7 @@ import {
import {
GitHub1sFileSystemProvider,
GitHub1sFileSearchProvider,
// GitHub1sTextSearchProvider,
GitHub1sTextSearchProvider,
GitHub1sSubmoduleDecorationProvider,
} from '@/providers';
import { showSponsors } from '@/sponsors';
@@ -40,13 +40,10 @@ export function activate(context: vscode.ExtensionContext) {
GitHub1sFileSearchProvider.scheme,
new GitHub1sFileSearchProvider(fsProvider)
),
// TODO: The Code Search ability is powered by Sourcegraph
// We are actively in touch with the Sourcegraph Team
// It will be enabled if we get their permission
// vscode.workspace.registerTextSearchProvider(
// GitHub1sTextSearchProvider.scheme,
// new GitHub1sTextSearchProvider()
// ),
vscode.workspace.registerTextSearchProvider(
GitHub1sTextSearchProvider.scheme,
new GitHub1sTextSearchProvider()
),
vscode.window.registerFileDecorationProvider(
new GitHub1sSubmoduleDecorationProvider(fsProvider)
)

View File

@@ -11,6 +11,11 @@ const sponsors = [
link: 'https://vercel.com/?utm_source=vscode-github1s&utm_campaign=oss',
description: 'Develop. Preview. Ship.',
},
{
name: 'Sourcegraph',
link: 'https://sourcegraph.com',
description: 'Universal code search',
},
];
export const showSponsors = () => {

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 312.8 52.8" style="enable-background:new 0 0 312.8 52.8;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F96216;}
.st1{fill:#B200F8;}
.st2{fill:#00B4F2;}
.st3{fill:#242427;}
</style>
<path class="st0" d="M15.6,6.8l11.7,41.9c0.8,2.8,3.8,4.5,6.6,3.7c2.9-0.8,4.6-3.7,3.8-6.5L26,4c-0.8-2.8-3.8-4.5-6.6-3.7
C16.5,1.1,14.8,4,15.6,6.8z"/>
<path class="st1" d="M37.3,6.5L7.9,38.9c-2,2.2-1.8,5.5,0.5,7.5c2.2,1.9,5.6,1.7,7.6-0.5l29.3-32.4c2-2.2,1.8-5.5-0.5-7.5
C42.7,4.1,39.2,4.3,37.3,6.5z"/>
<path class="st2" d="M4,24.6l41.8,13.5c2.8,0.9,5.9-0.6,6.8-3.4c0.9-2.8-0.6-5.8-3.4-6.7L7.4,14.5c-2.8-0.9-5.9,0.6-6.8,3.4
C-0.3,20.7,1.2,23.7,4,24.6z"/>
<path class="st3" d="M82.5,32.5c0-1-0.4-1.8-1.1-2.4c-0.7-0.6-1.6-1.1-2.7-1.6c-1.1-0.5-2.2-1-3.5-1.5c-1.2-0.5-2.4-1.2-3.5-1.9
c-1.1-0.8-1.9-1.8-2.7-2.9c-0.7-1.1-1-2.6-1-4.4c0-1.5,0.3-2.9,0.8-4c0.5-1.1,1.2-2.1,2.2-2.9c1-0.8,2.1-1.3,3.4-1.7
c1.3-0.4,2.7-0.5,4.3-0.5c1.8,0,3.6,0.2,5.2,0.5c1.6,0.3,3,0.8,4,1.4L86,15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.2,1.4-0.3,2.3-0.4c0.9-0.1,1.8,0,2.7,0V34.1z"/>
<path class="st3" d="M285.8,20.5c-1.4-1.8-3.5-2.7-6.4-2.7c-1.5,0-2.9,0.3-3.9,0.8c-1.1,0.5-2,1.4-2.8,2.5h-0.2l-0.7-2.7h-4.3v31.7
h5.9v-9.3c0.6,0.3,1.2,0.5,1.8,0.6c0.6,0.2,1.4,0.2,2.3,0.2c1.7,0,3.1-0.3,4.4-0.9c1.3-0.6,2.4-1.4,3.3-2.5c0.9-1.1,1.6-2.4,2-3.9
c0.5-1.6,0.7-3.3,0.7-5.3C288,25.1,287.3,22.3,285.8,20.5z M280.6,34.9c-0.8,1.2-2.1,1.8-3.8,1.8c-0.8,0-1.5-0.1-2-0.3
c-0.5-0.2-0.9-0.5-1.4-0.8v-9.4c0.4-1.1,0.9-2,1.5-2.6c0.7-0.6,1.6-0.9,2.7-0.9c1.5,0,2.6,0.5,3.2,1.6s1,2.6,1,4.6
C281.9,31.7,281.5,33.7,280.6,34.9z"/>
<path class="st3" d="M306.5,41.1V28.2c0-1.8-0.3-3.2-0.8-4c-0.5-0.8-1.4-1.2-2.8-1.2c-1,0-1.9,0.3-2.8,1c-0.8,0.7-1.4,1.5-1.6,2.6
v14.5h-5.9V9.3h5.9v11.6h0.2c0.7-1,1.6-1.7,2.7-2.3c1.1-0.6,2.4-0.9,4-0.9c1.1,0,2.2,0.2,3,0.5s1.6,0.8,2.2,1.5
c0.6,0.7,1,1.6,1.3,2.9c0.3,1.2,0.5,2.6,0.5,4.4v14.1H306.5z"/>
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@@ -306,6 +306,7 @@ const github1sDefaultTrustedDomains = [
'*.microsoft.com',
'*.github1s.com',
'*.vercel.com',
'*.sourcegraph.com',
];
export function readStaticTrustedDomains(