Skip to content

Instantly share code, notes, and snippets.

@sqs
sqs / eventemitter.ts
Created June 21, 2017 12:25
typescript eventemitter
/**
* An EventEmitter that implements the NodeJS.EventEmitter interface.
*/
export class EventEmitter implements NodeJS.EventEmitter {
private _events: { [name: string]: Function[] } = Object.create(null);
private _maxListeners = 10;
private _onceListeners: Function[] = [];
@sqs
sqs / remoteFileService.ts
Created July 26, 2017 08:17
RemoteFileService with lazy-loaded extensions
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import URI from 'vs/base/common/uri';
import { FileService } from 'vs/workbench/services/files/electron-browser/fileService';
import { IContent, IStreamContent, IFileStat, IResolveContentOptions, IResolveFileOptions, IResolveFileResult, IUpdateContentOptions, FileChangesEvent, FileChangeType, IImportResult } from 'vs/platform/files/common/files';
import { TPromise } from "vs/base/common/winjs.base";
@sqs
sqs / sourcegraph-user-config.json
Created January 11, 2018 08:39
Full-text/regexp search across the top 500 Rust crates on Sourcegraph
// Full-text/regexp search across the top 500 Rust crates:
//
// 1. Sign up for Sourcegraph.com at https://sourcegraph.com/sign-up (or sign in)
// 2. Click your username in the top right
// 3. Go to Configuration
// 4. Paste this entire JSON in and click Save
// 5. In the search box, type a search query of the form "repogroup:crates YOUR QUERY"
// and hit enter (regexps, exact matching, etc., are supported)
//
// Examples: "repogroup:crates remove_file"
diff --git a/doc/extensions/authoring/publishing.md b/doc/extensions/authoring/publishing.md
index ddd670600..147efece3 100644
--- a/doc/extensions/authoring/publishing.md
+++ b/doc/extensions/authoring/publishing.md
@@ -19,11 +19,26 @@ At this point, your extension has been built and sent to Sourcegraph. The output
Any user can publish to the Sourcegraph.com extension registry, all Sourcegraph instances can use extensions from Sourcegraph.com, and all Sourcegraph.com extensions are visible to everyone. If you need to publish an extension privately, use a private extension registry on your own self-hosted Sourcegraph instance.
-## Testing your extension
+## Using extensions in local development (sideloading)
import { describe, expect, test } from 'vitest'
import { lastValueFromAsyncGenerator } from '../common/asyncGenerator'
import { parseMessageXMLLike } from './structuredMessageParser'
describe('parseXmlTags', () => {
test('parses XML tags correctly', async () => {
const input = '<tag1>content1</tag1><tag2>content2</tag2><tag1>content3</tag1>'
async function* generateChunks() {
yield input
}