├── .gitignore ├── .vscodeignore ├── README.md ├── .vscode └── tasks.json ├── tsconfig.json ├── CODE_OF_CONDUCT.md ├── LICENSE ├── extension.webpack.config.js ├── package.json ├── SECURITY.md ├── vscode.proposed.fileSearchProvider.d.ts ├── src ├── extension.ts ├── exampleFiles.ts └── memfs.ts ├── vscode.proposed.textSearchProvider.d.ts └── dist ├── extension.js └── extension.js.map /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | dist/** 3 | out/** 4 | src/** 5 | .gitignore 6 | extension.webpack.config.js 7 | tsconfig.json 8 | yarn.lock 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # VSCode-Web Playground 3 | 4 | This extension drives the [VSCode web playground](https://vscode-web-test-playground.azurewebsites.net) with some test data. It is not meant for production use. 5 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "command": "npm", 4 | "type": "shell", 5 | "presentation": { 6 | "reveal": "silent" 7 | }, 8 | "args": ["run", "compile"], 9 | "isBackground": true, 10 | "problemMatcher": "$tsc-watch" 11 | } 12 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "outDir": "out", 7 | "lib": [ "es2016", "WebWorker" ], 8 | "sourceMap": true 9 | }, 10 | 11 | "include": [ 12 | "src", 13 | "./*.d.ts" 14 | ] 15 | } -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /extension.webpack.config.js: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | //@ts-check 7 | 'use strict'; 8 | 9 | //@ts-check 10 | /** @typedef {import('webpack').Configuration} WebpackConfig **/ 11 | 12 | const path = require('path'); 13 | 14 | module.exports = /** @type WebpackConfig */ { 15 | context: __dirname, 16 | mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production') 17 | target: 'webworker', // extensions run in a webworker context 18 | entry: { 19 | extension: './src/extension.ts', 20 | }, 21 | resolve: { 22 | mainFields: ['module', 'main'], 23 | extensions: ['.ts', '.js'], // support ts-files and js-files 24 | alias: { 25 | } 26 | }, 27 | module: { 28 | rules: [{ 29 | test: /\.ts$/, 30 | exclude: /node_modules/, 31 | use: [{ 32 | // configure TypeScript loader: 33 | // * enable sources maps for end-to-end source maps 34 | loader: 'ts-loader', 35 | options: { 36 | compilerOptions: { 37 | 'sourceMap': true, 38 | 'declaration': false 39 | } 40 | } 41 | }] 42 | }] 43 | }, 44 | externals: { 45 | 'vscode': 'commonjs vscode', // ignored because it doesn't exist 46 | }, 47 | performance: { 48 | hints: false 49 | }, 50 | output: { 51 | filename: 'extension.js', 52 | path: path.join(__dirname, 'dist'), 53 | libraryTarget: 'commonjs' 54 | }, 55 | devtool: 'source-map' 56 | }; 57 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-web-playground", 3 | "description": "Web playground for VS Code", 4 | "version": "0.0.13", 5 | "publisher": "vscode", 6 | "license": "MIT", 7 | "enabledApiProposals": [ 8 | "fileSearchProvider", 9 | "textSearchProvider" 10 | ], 11 | "private": true, 12 | "activationEvents": [ 13 | "onFileSystem:memfs", 14 | "onDebug" 15 | ], 16 | "browser": "./dist/extension", 17 | "engines": { 18 | "vscode": "^1.48.0" 19 | }, 20 | "contributes": { 21 | "viewsWelcome": [ 22 | { 23 | "view": "debug", 24 | "contents": "In order to run and debug you'll need to create a local workspace." 25 | }, 26 | { 27 | "view": "terminal", 28 | "contents": "In order to run and debug you'll need to create a local workspace." 29 | } 30 | ], 31 | "taskDefinitions": [ 32 | { 33 | "type": "custombuildscript", 34 | "required": [ 35 | "flavor" 36 | ], 37 | "properties": { 38 | "flavor": { 39 | "type": "string", 40 | "description": "The build flavor. Should be either '32' or '64'." 41 | }, 42 | "flags": { 43 | "type": "array", 44 | "description": "Additional build flags." 45 | } 46 | } 47 | } 48 | ] 49 | }, 50 | "scripts": { 51 | "compile": "yarn webpack-cli --config extension.webpack.config --mode production", 52 | "watch": "yarn webpack-cli --config extension.webpack.config --mode production --watch --info-verbosity verbose", 53 | "prepublish": "yarn webpack-cli --config extension.webpack.config --mode production" 54 | }, 55 | "devDependencies": { 56 | "@types/vscode": "^1.48.0", 57 | "ts-loader": "^4.4.2", 58 | "typescript": "^3.9.7", 59 | "webpack": "^4.43.0", 60 | "webpack-cli": "^3.3.12" 61 | } 62 | } -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). 40 | 41 | -------------------------------------------------------------------------------- /vscode.proposed.fileSearchProvider.d.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | declare module 'vscode' { 7 | 8 | // https://github.com/microsoft/vscode/issues/73524 9 | 10 | /** 11 | * The parameters of a query for file search. 12 | */ 13 | export interface FileSearchQuery { 14 | /** 15 | * The search pattern to match against file paths. 16 | */ 17 | pattern: string; 18 | } 19 | 20 | /** 21 | * Options that apply to file search. 22 | */ 23 | export interface FileSearchOptions extends SearchOptions { 24 | /** 25 | * The maximum number of results to be returned. 26 | */ 27 | maxResults?: number; 28 | 29 | /** 30 | * A CancellationToken that represents the session for this search query. If the provider chooses to, this object can be used as the key for a cache, 31 | * and searches with the same session object can search the same cache. When the token is cancelled, the session is complete and the cache can be cleared. 32 | */ 33 | session?: CancellationToken; 34 | } 35 | 36 | /** 37 | * A FileSearchProvider provides search results for files in the given folder that match a query string. It can be invoked by quickopen or other extensions. 38 | * 39 | * A FileSearchProvider is the more powerful of two ways to implement file search in the editor. Use a FileSearchProvider if you wish to search within a folder for 40 | * all files that match the user's query. 41 | * 42 | * The FileSearchProvider will be invoked on every keypress in quickopen. When `workspace.findFiles` is called, it will be invoked with an empty query string, 43 | * and in that case, every file in the folder should be returned. 44 | */ 45 | export interface FileSearchProvider { 46 | /** 47 | * Provide the set of files that match a certain file path pattern. 48 | * @param query The parameters for this query. 49 | * @param options A set of options to consider while searching files. 50 | * @param token A cancellation token. 51 | */ 52 | provideFileSearchResults(query: FileSearchQuery, options: FileSearchOptions, token: CancellationToken): ProviderResult; 53 | } 54 | 55 | export namespace workspace { 56 | /** 57 | * Register a search provider. 58 | * 59 | * Only one provider can be registered per scheme. 60 | * 61 | * @param scheme The provider will be invoked for workspace folders that have this file scheme. 62 | * @param provider The provider. 63 | * @return A {@link Disposable} that unregisters this provider when being disposed. 64 | */ 65 | export function registerFileSearchProvider(scheme: string, provider: FileSearchProvider): Disposable; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/extension.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | // 7 | // ############################################################################ 8 | // 9 | // ! USED FOR RUNNING VSCODE OUT OF SOURCES FOR WEB ! 10 | // ! DO NOT REMOVE ! 11 | // 12 | // ############################################################################ 13 | // 14 | 15 | import * as vscode from 'vscode'; 16 | import { MemFS } from './memfs'; 17 | 18 | declare const navigator: unknown; 19 | 20 | export function activate(context: vscode.ExtensionContext) { 21 | if (typeof navigator === 'object') { // do not run under node.js 22 | const memFs = enableFs(context); 23 | memFs.seed(); 24 | enableProblems(context); 25 | enableTasks(); 26 | 27 | vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(`memfs:/sample-folder/large.ts`)); 28 | } 29 | } 30 | 31 | function enableFs(context: vscode.ExtensionContext): MemFS { 32 | const memFs = new MemFS(); 33 | context.subscriptions.push(memFs); 34 | 35 | return memFs; 36 | } 37 | 38 | function enableProblems(context: vscode.ExtensionContext): void { 39 | const collection = vscode.languages.createDiagnosticCollection('test'); 40 | if (vscode.window.activeTextEditor) { 41 | updateDiagnostics(vscode.window.activeTextEditor.document, collection); 42 | } 43 | context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(editor => { 44 | if (editor) { 45 | updateDiagnostics(editor.document, collection); 46 | } 47 | })); 48 | } 49 | 50 | function updateDiagnostics(document: vscode.TextDocument, collection: vscode.DiagnosticCollection): void { 51 | if (document && document.fileName === '/sample-folder/large.ts') { 52 | collection.set(document.uri, [{ 53 | code: '', 54 | message: 'cannot assign twice to immutable variable `storeHouses`', 55 | range: new vscode.Range(new vscode.Position(4, 12), new vscode.Position(4, 32)), 56 | severity: vscode.DiagnosticSeverity.Error, 57 | source: '', 58 | relatedInformation: [ 59 | new vscode.DiagnosticRelatedInformation(new vscode.Location(document.uri, new vscode.Range(new vscode.Position(1, 8), new vscode.Position(1, 9))), 'first assignment to `x`') 60 | ] 61 | }, { 62 | code: '', 63 | message: 'function does not follow naming conventions', 64 | range: new vscode.Range(new vscode.Position(7, 10), new vscode.Position(7, 23)), 65 | severity: vscode.DiagnosticSeverity.Warning, 66 | source: '' 67 | }]); 68 | } else { 69 | collection.clear(); 70 | } 71 | } 72 | 73 | function enableTasks(): void { 74 | 75 | interface CustomBuildTaskDefinition extends vscode.TaskDefinition { 76 | /** 77 | * The build flavor. Should be either '32' or '64'. 78 | */ 79 | flavor: string; 80 | 81 | /** 82 | * Additional build flags 83 | */ 84 | flags?: string[]; 85 | } 86 | 87 | class CustomBuildTaskProvider implements vscode.TaskProvider { 88 | static CustomBuildScriptType: string = 'custombuildscript'; 89 | private tasks: vscode.Task[] | undefined; 90 | 91 | // We use a CustomExecution task when state needs to be shared accross runs of the task or when 92 | // the task requires use of some VS Code API to run. 93 | // If you don't need to share state between runs and if you don't need to execute VS Code API in your task, 94 | // then a simple ShellExecution or ProcessExecution should be enough. 95 | // Since our build has this shared state, the CustomExecution is used below. 96 | private sharedState: string | undefined; 97 | 98 | constructor(private workspaceRoot: string) { } 99 | 100 | async provideTasks(): Promise { 101 | return this.getTasks(); 102 | } 103 | 104 | resolveTask(_task: vscode.Task): vscode.Task | undefined { 105 | const flavor: string = _task.definition.flavor; 106 | if (flavor) { 107 | const definition: CustomBuildTaskDefinition = _task.definition; 108 | return this.getTask(definition.flavor, definition.flags ? definition.flags : [], definition); 109 | } 110 | return undefined; 111 | } 112 | 113 | private getTasks(): vscode.Task[] { 114 | if (this.tasks !== undefined) { 115 | return this.tasks; 116 | } 117 | // In our fictional build, we have two build flavors 118 | const flavors: string[] = ['32', '64']; 119 | // Each flavor can have some options. 120 | const flags: string[][] = [['watch', 'incremental'], ['incremental'], []]; 121 | 122 | this.tasks = []; 123 | flavors.forEach(flavor => { 124 | flags.forEach(flagGroup => { 125 | this.tasks!.push(this.getTask(flavor, flagGroup)); 126 | }); 127 | }); 128 | return this.tasks; 129 | } 130 | 131 | private getTask(flavor: string, flags: string[], definition?: CustomBuildTaskDefinition): vscode.Task { 132 | if (definition === undefined) { 133 | definition = { 134 | type: CustomBuildTaskProvider.CustomBuildScriptType, 135 | flavor, 136 | flags 137 | }; 138 | } 139 | return new vscode.Task(definition, vscode.TaskScope.Workspace, `${flavor} ${flags.join(' ')}`, 140 | CustomBuildTaskProvider.CustomBuildScriptType, new vscode.CustomExecution(async (): Promise => { 141 | // When the task is executed, this callback will run. Here, we setup for running the task. 142 | return new CustomBuildTaskTerminal(this.workspaceRoot, flavor, flags, () => this.sharedState, (state: string) => this.sharedState = state); 143 | })); 144 | } 145 | } 146 | 147 | class CustomBuildTaskTerminal implements vscode.Pseudoterminal { 148 | private writeEmitter = new vscode.EventEmitter(); 149 | onDidWrite: vscode.Event = this.writeEmitter.event; 150 | private closeEmitter = new vscode.EventEmitter(); 151 | onDidClose?: vscode.Event = this.closeEmitter.event; 152 | 153 | private fileWatcher: vscode.FileSystemWatcher | undefined; 154 | 155 | constructor(private workspaceRoot: string, _flavor: string, private flags: string[], private getSharedState: () => string | undefined, private setSharedState: (state: string) => void) { 156 | } 157 | 158 | open(_initialDimensions: vscode.TerminalDimensions | undefined): void { 159 | // At this point we can start using the terminal. 160 | if (this.flags.indexOf('watch') > -1) { 161 | let pattern = this.workspaceRoot + '/customBuildFile'; 162 | this.fileWatcher = vscode.workspace.createFileSystemWatcher(pattern); 163 | this.fileWatcher.onDidChange(() => this.doBuild()); 164 | this.fileWatcher.onDidCreate(() => this.doBuild()); 165 | this.fileWatcher.onDidDelete(() => this.doBuild()); 166 | } 167 | this.doBuild(); 168 | } 169 | 170 | close(): void { 171 | // The terminal has been closed. Shutdown the build. 172 | if (this.fileWatcher) { 173 | this.fileWatcher.dispose(); 174 | } 175 | } 176 | 177 | private async doBuild(): Promise { 178 | return new Promise((resolve) => { 179 | this.writeEmitter.fire('Starting build...\r\n'); 180 | let isIncremental = this.flags.indexOf('incremental') > -1; 181 | if (isIncremental) { 182 | if (this.getSharedState()) { 183 | this.writeEmitter.fire('Using last build results: ' + this.getSharedState() + '\r\n'); 184 | } else { 185 | isIncremental = false; 186 | this.writeEmitter.fire('No result from last build. Doing full build.\r\n'); 187 | } 188 | } 189 | 190 | // Since we don't actually build anything in this example set a timeout instead. 191 | setTimeout(() => { 192 | const date = new Date(); 193 | this.setSharedState(date.toTimeString() + ' ' + date.toDateString()); 194 | this.writeEmitter.fire('Build complete.\r\n\r\n'); 195 | if (this.flags.indexOf('watch') === -1) { 196 | this.closeEmitter.fire(); 197 | resolve(); 198 | } 199 | }, isIncremental ? 1000 : 4000); 200 | }); 201 | } 202 | } 203 | 204 | vscode.tasks.registerTaskProvider(CustomBuildTaskProvider.CustomBuildScriptType, new CustomBuildTaskProvider(vscode.workspace.rootPath!)); 205 | } 206 | -------------------------------------------------------------------------------- /vscode.proposed.textSearchProvider.d.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | declare module 'vscode' { 7 | 8 | // https://github.com/microsoft/vscode/issues/59921 9 | 10 | /** 11 | * The parameters of a query for text search. 12 | */ 13 | export interface TextSearchQuery { 14 | /** 15 | * The text pattern to search for. 16 | */ 17 | pattern: string; 18 | 19 | /** 20 | * Whether or not `pattern` should match multiple lines of text. 21 | */ 22 | isMultiline?: boolean; 23 | 24 | /** 25 | * Whether or not `pattern` should be interpreted as a regular expression. 26 | */ 27 | isRegExp?: boolean; 28 | 29 | /** 30 | * Whether or not the search should be case-sensitive. 31 | */ 32 | isCaseSensitive?: boolean; 33 | 34 | /** 35 | * Whether or not to search for whole word matches only. 36 | */ 37 | isWordMatch?: boolean; 38 | } 39 | 40 | /** 41 | * A file glob pattern to match file paths against. 42 | * TODO@roblourens merge this with the GlobPattern docs/definition in vscode.d.ts. 43 | * @see {@link GlobPattern} 44 | */ 45 | export type GlobString = string; 46 | 47 | /** 48 | * Options common to file and text search 49 | */ 50 | export interface SearchOptions { 51 | /** 52 | * The root folder to search within. 53 | */ 54 | folder: Uri; 55 | 56 | /** 57 | * Files that match an `includes` glob pattern should be included in the search. 58 | */ 59 | includes: GlobString[]; 60 | 61 | /** 62 | * Files that match an `excludes` glob pattern should be excluded from the search. 63 | */ 64 | excludes: GlobString[]; 65 | 66 | /** 67 | * Whether external files that exclude files, like .gitignore, should be respected. 68 | * See the vscode setting `"search.useIgnoreFiles"`. 69 | */ 70 | useIgnoreFiles: boolean; 71 | 72 | /** 73 | * Whether symlinks should be followed while searching. 74 | * See the vscode setting `"search.followSymlinks"`. 75 | */ 76 | followSymlinks: boolean; 77 | 78 | /** 79 | * Whether global files that exclude files, like .gitignore, should be respected. 80 | * See the vscode setting `"search.useGlobalIgnoreFiles"`. 81 | */ 82 | useGlobalIgnoreFiles: boolean; 83 | } 84 | 85 | /** 86 | * Options to specify the size of the result text preview. 87 | * These options don't affect the size of the match itself, just the amount of preview text. 88 | */ 89 | export interface TextSearchPreviewOptions { 90 | /** 91 | * The maximum number of lines in the preview. 92 | * Only search providers that support multiline search will ever return more than one line in the match. 93 | */ 94 | matchLines: number; 95 | 96 | /** 97 | * The maximum number of characters included per line. 98 | */ 99 | charsPerLine: number; 100 | } 101 | 102 | /** 103 | * Options that apply to text search. 104 | */ 105 | export interface TextSearchOptions extends SearchOptions { 106 | /** 107 | * The maximum number of results to be returned. 108 | */ 109 | maxResults: number; 110 | 111 | /** 112 | * Options to specify the size of the result text preview. 113 | */ 114 | previewOptions?: TextSearchPreviewOptions; 115 | 116 | /** 117 | * Exclude files larger than `maxFileSize` in bytes. 118 | */ 119 | maxFileSize?: number; 120 | 121 | /** 122 | * Interpret files using this encoding. 123 | * See the vscode setting `"files.encoding"` 124 | */ 125 | encoding?: string; 126 | 127 | /** 128 | * Number of lines of context to include before each match. 129 | */ 130 | beforeContext?: number; 131 | 132 | /** 133 | * Number of lines of context to include after each match. 134 | */ 135 | afterContext?: number; 136 | } 137 | 138 | /** 139 | * Represents the severiry of a TextSearchComplete message. 140 | */ 141 | export enum TextSearchCompleteMessageType { 142 | Information = 1, 143 | Warning = 2, 144 | } 145 | 146 | /** 147 | * A message regarding a completed search. 148 | */ 149 | export interface TextSearchCompleteMessage { 150 | /** 151 | * Markdown text of the message. 152 | */ 153 | text: string, 154 | /** 155 | * Whether the source of the message is trusted, command links are disabled for untrusted message sources. 156 | * Messaged are untrusted by default. 157 | */ 158 | trusted?: boolean, 159 | /** 160 | * The message type, this affects how the message will be rendered. 161 | */ 162 | type: TextSearchCompleteMessageType, 163 | } 164 | 165 | /** 166 | * Information collected when text search is complete. 167 | */ 168 | export interface TextSearchComplete { 169 | /** 170 | * Whether the search hit the limit on the maximum number of search results. 171 | * `maxResults` on {@linkcode TextSearchOptions} specifies the max number of results. 172 | * - If exactly that number of matches exist, this should be false. 173 | * - If `maxResults` matches are returned and more exist, this should be true. 174 | * - If search hits an internal limit which is less than `maxResults`, this should be true. 175 | */ 176 | limitHit?: boolean; 177 | 178 | /** 179 | * Additional information regarding the state of the completed search. 180 | * 181 | * Messages with "Information" style support links in markdown syntax: 182 | * - Click to [run a command](command:workbench.action.OpenQuickPick) 183 | * - Click to [open a website](https://aka.ms) 184 | * 185 | * Commands may optionally return { triggerSearch: true } to signal to the editor that the original search should run be again. 186 | */ 187 | message?: TextSearchCompleteMessage | TextSearchCompleteMessage[]; 188 | } 189 | 190 | /** 191 | * A preview of the text result. 192 | */ 193 | export interface TextSearchMatchPreview { 194 | /** 195 | * The matching lines of text, or a portion of the matching line that contains the match. 196 | */ 197 | text: string; 198 | 199 | /** 200 | * The Range within `text` corresponding to the text of the match. 201 | * The number of matches must match the TextSearchMatch's range property. 202 | */ 203 | matches: Range | Range[]; 204 | } 205 | 206 | /** 207 | * A match from a text search 208 | */ 209 | export interface TextSearchMatch { 210 | /** 211 | * The uri for the matching document. 212 | */ 213 | uri: Uri; 214 | 215 | /** 216 | * The range of the match within the document, or multiple ranges for multiple matches. 217 | */ 218 | ranges: Range | Range[]; 219 | 220 | /** 221 | * A preview of the text match. 222 | */ 223 | preview: TextSearchMatchPreview; 224 | } 225 | 226 | /** 227 | * A line of context surrounding a TextSearchMatch. 228 | */ 229 | export interface TextSearchContext { 230 | /** 231 | * The uri for the matching document. 232 | */ 233 | uri: Uri; 234 | 235 | /** 236 | * One line of text. 237 | * previewOptions.charsPerLine applies to this 238 | */ 239 | text: string; 240 | 241 | /** 242 | * The line number of this line of context. 243 | */ 244 | lineNumber: number; 245 | } 246 | 247 | export type TextSearchResult = TextSearchMatch | TextSearchContext; 248 | 249 | /** 250 | * A TextSearchProvider provides search results for text results inside files in the workspace. 251 | */ 252 | export interface TextSearchProvider { 253 | /** 254 | * Provide results that match the given text pattern. 255 | * @param query The parameters for this query. 256 | * @param options A set of options to consider while searching. 257 | * @param progress A progress callback that must be invoked for all results. 258 | * @param token A cancellation token. 259 | */ 260 | provideTextSearchResults(query: TextSearchQuery, options: TextSearchOptions, progress: Progress, token: CancellationToken): ProviderResult; 261 | } 262 | 263 | export namespace workspace { 264 | /** 265 | * Register a text search provider. 266 | * 267 | * Only one provider can be registered per scheme. 268 | * 269 | * @param scheme The provider will be invoked for workspace folders that have this file scheme. 270 | * @param provider The provider. 271 | * @return A {@link Disposable} that unregisters this provider when being disposed. 272 | */ 273 | export function registerTextSearchProvider(scheme: string, provider: TextSearchProvider): Disposable; 274 | } 275 | } 276 | -------------------------------------------------------------------------------- /src/exampleFiles.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | export const largeTSFile = `/// 7 | /// 8 | 9 | module Mankala { 10 | export var storeHouses = [6,13]; 11 | export var svgNS = 'http://www.w3.org/2000/svg'; 12 | 13 | function createSVGRect(r:Rectangle) { 14 | var rect = document.createElementNS(svgNS,'rect'); 15 | rect.setAttribute('x', r.x.toString()); 16 | rect.setAttribute('y', r.y.toString()); 17 | rect.setAttribute('width', r.width.toString()); 18 | rect.setAttribute('height', r.height.toString()); 19 | return rect; 20 | } 21 | 22 | function createSVGEllipse(r:Rectangle) { 23 | var ell = document.createElementNS(svgNS,'ellipse'); 24 | ell.setAttribute('rx',(r.width/2).toString()); 25 | ell.setAttribute('ry',(r.height/2).toString()); 26 | ell.setAttribute('cx',(r.x+r.width/2).toString()); 27 | ell.setAttribute('cy',(r.y+r.height/2).toString()); 28 | return ell; 29 | } 30 | 31 | function createSVGEllipsePolar(angle:number,radius:number,tx:number,ty:number,cxo:number,cyo:number) { 32 | var ell = document.createElementNS(svgNS,'ellipse'); 33 | ell.setAttribute('rx',radius.toString()); 34 | ell.setAttribute('ry',(radius/3).toString()); 35 | ell.setAttribute('cx',cxo.toString()); 36 | ell.setAttribute('cy',cyo.toString()); 37 | var dangle = angle*(180/Math.PI); 38 | ell.setAttribute('transform','rotate('+dangle+','+cxo+','+cyo+') translate('+tx+','+ty+')'); 39 | return ell; 40 | } 41 | 42 | function createSVGInscribedCircle(sq:Square) { 43 | var circle = document.createElementNS(svgNS,'circle'); 44 | circle.setAttribute('r',(sq.length/2).toString()); 45 | circle.setAttribute('cx',(sq.x+(sq.length/2)).toString()); 46 | circle.setAttribute('cy',(sq.y+(sq.length/2)).toString()); 47 | return circle; 48 | } 49 | 50 | export class Position { 51 | 52 | seedCounts:number[]; 53 | startMove:number; 54 | turn:number; 55 | 56 | constructor(seedCounts:number[],startMove:number,turn:number) { 57 | this.seedCounts = seedCounts; 58 | this.startMove = startMove; 59 | this.turn = turn; 60 | } 61 | 62 | score() { 63 | var baseScore = this.seedCounts[storeHouses[1-this.turn]]-this.seedCounts[storeHouses[this.turn]]; 64 | var otherSpaces = homeSpaces[this.turn]; 65 | var sum = 0; 66 | for (var k = 0,len = otherSpaces.length;k0) { 87 | features.clear(); 88 | var len = this.seedCounts.length; 89 | for (var i = 0;i0) { 97 | if (nextSpace==storeHouses[this.turn]) { 98 | features.seedStoredCount++; 99 | } 100 | if ((nextSpace!=storeHouses[1-this.turn])) { 101 | nextSeedCounts[nextSpace]++; 102 | seedCount--; 103 | } 104 | if (seedCount==0) { 105 | if (nextSpace==storeHouses[this.turn]) { 106 | features.turnContinues = true; 107 | } 108 | else { 109 | if ((nextSeedCounts[nextSpace]==1)&& 110 | (nextSpace>=firstHomeSpace[this.turn])&& 111 | (nextSpace<=lastHomeSpace[this.turn])) { 112 | // capture 113 | var capturedSpace = capturedSpaces[nextSpace]; 114 | if (capturedSpace>=0) { 115 | features.spaceCaptured = capturedSpace; 116 | features.capturedCount = nextSeedCounts[capturedSpace]; 117 | nextSeedCounts[capturedSpace] = 0; 118 | nextSeedCounts[storeHouses[this.turn]] += features.capturedCount; 119 | features.seedStoredCount += nextSeedCounts[capturedSpace]; 120 | } 121 | } 122 | } 123 | } 124 | nextSpace = (nextSpace+1)%14; 125 | } 126 | return true; 127 | } 128 | else { 129 | return false; 130 | } 131 | } 132 | } 133 | 134 | export class SeedCoords { 135 | tx:number; 136 | ty:number; 137 | angle:number; 138 | 139 | constructor(tx:number, ty:number, angle:number) { 140 | this.tx = tx; 141 | this.ty = ty; 142 | this.angle = angle; 143 | } 144 | } 145 | 146 | export class DisplayPosition extends Position { 147 | 148 | config:SeedCoords[][]; 149 | 150 | constructor(seedCounts:number[],startMove:number,turn:number) { 151 | super(seedCounts,startMove,turn); 152 | 153 | this.config = []; 154 | 155 | for (var i = 0;i(); 157 | } 158 | } 159 | 160 | 161 | seedCircleRect(rect:Rectangle,seedCount:number,board:Element,seed:number) { 162 | var coords = this.config[seed]; 163 | var sq = rect.inner(0.95).square(); 164 | var cxo = (sq.width/2)+sq.x; 165 | var cyo = (sq.height/2)+sq.y; 166 | var seedNumbers = [5,7,9,11]; 167 | var ringIndex = 0; 168 | var ringRem = seedNumbers[ringIndex]; 169 | var angleDelta = (2*Math.PI)/ringRem; 170 | var angle = angleDelta; 171 | var seedLength = sq.width/(seedNumbers.length<<1); 172 | var crMax = sq.width/2-(seedLength/2); 173 | var pit = createSVGInscribedCircle(sq); 174 | if (seed<7) { 175 | pit.setAttribute('fill','brown'); 176 | } 177 | else { 178 | pit.setAttribute('fill','saddlebrown'); 179 | } 180 | board.appendChild(pit); 181 | var seedsSeen = 0; 182 | while (seedCount > 0) { 183 | if (ringRem == 0) { 184 | ringIndex++; 185 | ringRem = seedNumbers[ringIndex]; 186 | angleDelta = (2*Math.PI)/ringRem; 187 | angle = angleDelta; 188 | } 189 | var tx:number; 190 | var ty:number; 191 | var tangle = angle; 192 | if (coords.length>seedsSeen) { 193 | tx = coords[seedsSeen].tx; 194 | ty = coords[seedsSeen].ty; 195 | tangle = coords[seedsSeen].angle; 196 | } 197 | else { 198 | tx = (Math.random()*crMax)-(crMax/3); 199 | ty = (Math.random()*crMax)-(crMax/3); 200 | coords[seedsSeen] = new SeedCoords(tx,ty,angle); 201 | } 202 | var ell = createSVGEllipsePolar(tangle,seedLength,tx,ty,cxo,cyo); 203 | board.appendChild(ell); 204 | angle += angleDelta; 205 | ringRem--; 206 | seedCount--; 207 | seedsSeen++; 208 | } 209 | } 210 | 211 | toCircleSVG() { 212 | var seedDivisions = 14; 213 | var board = document.createElementNS(svgNS,'svg'); 214 | var boardRect = new Rectangle(0,0,1800,800); 215 | board.setAttribute('width','1800'); 216 | board.setAttribute('height','800'); 217 | var whole = createSVGRect(boardRect); 218 | whole.setAttribute('fill','tan'); 219 | board.appendChild(whole); 220 | var labPlayLab = boardRect.proportionalSplitVert(20,760,20); 221 | var playSurface = labPlayLab[1]; 222 | var storeMainStore = playSurface.proportionalSplitHoriz(8,48,8); 223 | var mainPair = storeMainStore[1].subDivideVert(2); 224 | var playerRects = [mainPair[0].subDivideHoriz(6), mainPair[1].subDivideHoriz(6)]; 225 | // reverse top layer because storehouse on left 226 | for (var k = 0;k<3;k++) { 227 | var temp = playerRects[0][k]; 228 | playerRects[0][k] = playerRects[0][5-k]; 229 | playerRects[0][5-k] = temp; 230 | } 231 | var storehouses = [storeMainStore[0],storeMainStore[2]]; 232 | var playerSeeds = this.seedCounts.length>>1; 233 | for (var i = 0;i<2;i++) { 234 | var player = playerRects[i]; 235 | var storehouse = storehouses[i]; 236 | var r:Rectangle; 237 | for (var j = 0;j(); 250 | } 251 | } 252 | } 253 | return board; 254 | } 255 | } 256 | } 257 | `; 258 | 259 | export const debuggableFile = `# VS Code Mock Debug 260 | 261 | This is a starter sample for developing VS Code debug adapters. 262 | 263 | **Mock Debug** simulates a debug adapter for Visual Studio Code. 264 | It supports *step*, *continue*, *breakpoints*, *exceptions*, and 265 | *variable access* but it is not connected to any real debugger. 266 | 267 | The sample is meant as an educational piece showing how to implement a debug 268 | adapter for VS Code. It can be used as a starting point for developing a real adapter. 269 | 270 | More information about how to develop a new debug adapter can be found 271 | [here](https://code.visualstudio.com/docs/extensions/example-debuggers). 272 | Or discuss debug adapters on Gitter: 273 | [![Gitter Chat](https://img.shields.io/badge/chat-online-brightgreen.svg)](https://gitter.im/Microsoft/vscode) 274 | 275 | ## Using Mock Debug 276 | 277 | * Install the **Mock Debug** extension in VS Code. 278 | * Create a new 'program' file 'readme.md' and enter several lines of arbitrary text. 279 | * Switch to the debug viewlet and press the gear dropdown. 280 | * Select the debug environment "Mock Debug". 281 | * Press the green 'play' button to start debugging. 282 | 283 | You can now 'step through' the 'readme.md' file, set and hit breakpoints, and run into exceptions (if the word exception appears in a line). 284 | 285 | ![Mock Debug](file.jpg) 286 | 287 | ## Build and Run 288 | 289 | [![build status](https://travis-ci.org/Microsoft/vscode-mock-debug.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-mock-debug) 290 | [![build status](https://ci.appveyor.com/api/projects/status/empmw5q1tk6h1fly/branch/master?svg=true)](https://ci.appveyor.com/project/weinand/vscode-mock-debug) 291 | 292 | 293 | * Clone the project [https://github.com/Microsoft/vscode-mock-debug.git](https://github.com/Microsoft/vscode-mock-debug.git) 294 | * Open the project folder in VS Code. 295 | * Press 'F5' to build and launch Mock Debug in another VS Code window. In that window: 296 | * Open a new workspace, create a new 'program' file 'readme.md' and enter several lines of arbitrary text. 297 | * Switch to the debug viewlet and press the gear dropdown. 298 | * Select the debug environment "Mock Debug". 299 | * Press 'F5' to start debugging.`; 300 | 301 | export function getImageFile(): Uint8Array { 302 | const data = atob(`/9j/4AAQSkZJRgABAQAASABIAAD/2wCEAA4ODg4ODhcODhchFxcXIS0hISEhLTktLS0tLTlFOTk5OTk5RUVFRUVFRUVSUlJSUlJgYGBgYGxsbGxsbGxsbGwBERISGxkbLxkZL3FMP0xxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcf/AABEIAFYAZAMBIgACEQEDEQH/xAB1AAACAwEBAQAAAAAAAAAAAAAABAMFBgIBBxAAAgIBAwMCBQQCAwAAAAAAAQIAAxEEBSESMUFRcRMiIzJhFIGRoQbBQlKxAQEBAQEAAAAAAAAAAAAAAAABAgADEQEBAQADAQEAAAAAAAAAAAAAARESITECQf/aAAwDAQACEQMRAD8A2LEZkLc/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xQiMKyeX7CGqxqtDuK7lYK2BXnAz3JMuNZoPpDAyV5zHNt2bRbcA1S/Pjljyf7jerWxx0V4wQeZgynxrUXoUnIif629GJY595cptr1N9XJYjOfEi1G3LYMLgH1m04qxelrAtnj/qZYIvUPpMcHwYtTT8FzVaMN6+sslqVF6gcQ1sRivPccwjS314+bGYRBnqzws6FhUfL7CQ8gdI7+TDIHHgcSVGBYRznMXfUL2J5ngPUOYCpfM2tiq1tnUpVRnMe0DGtAKyQIw+mU4GJCKmrPy+I6V0lxYYIzxOCtdjZyVIMRqtPsYx8RT37+sdRhsFlHzcyC0J0kmcfqFX5cxC7VAk4OPUQtM+UVtYf7vH8iKP8SnKg5U9xHQwsGV7jxF9QnWACMEcgwlUjT4ZUE+YRRLGRehwciEpLRMAAT6SALlIQkF4kl7HEIQLwuQfac9RPeEJi5H3TruvvmEJo1QOcgGQuvVg+sITM8rDKeDHVItXkQhKgqM6esnJEIQlJf//Z`); 303 | return Uint8Array.from([...data].map(x => x.charCodeAt(0))); 304 | } 305 | 306 | // encoded from 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя' 307 | export const windows1251File = Uint8Array.from([192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255]); 308 | 309 | // encoded from '中国abc' 310 | export const gbkFile = Uint8Array.from([214, 208, 185, 250, 97, 98, 99]); 311 | -------------------------------------------------------------------------------- /src/memfs.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { 7 | CancellationToken, 8 | Disposable, 9 | Event, 10 | EventEmitter, 11 | FileChangeEvent, 12 | FileChangeType, 13 | FileSearchOptions, 14 | FileSearchProvider, 15 | FileSearchQuery, 16 | FileStat, 17 | FileSystemError, 18 | FileSystemProvider, 19 | FileType, 20 | Position, 21 | Progress, 22 | ProviderResult, 23 | Range, 24 | TextSearchComplete, 25 | TextSearchOptions, 26 | TextSearchQuery, 27 | TextSearchProvider, 28 | TextSearchResult, 29 | Uri, 30 | workspace, 31 | } from 'vscode'; 32 | import { largeTSFile, getImageFile, debuggableFile, windows1251File, gbkFile } from './exampleFiles'; 33 | 34 | export class File implements FileStat { 35 | 36 | type: FileType; 37 | ctime: number; 38 | mtime: number; 39 | size: number; 40 | 41 | name: string; 42 | data?: Uint8Array; 43 | 44 | constructor(public uri: Uri, name: string) { 45 | this.type = FileType.File; 46 | this.ctime = Date.now(); 47 | this.mtime = Date.now(); 48 | this.size = 0; 49 | this.name = name; 50 | } 51 | } 52 | 53 | export class Directory implements FileStat { 54 | 55 | type: FileType; 56 | ctime: number; 57 | mtime: number; 58 | size: number; 59 | 60 | name: string; 61 | entries: Map; 62 | 63 | constructor(public uri: Uri, name: string) { 64 | this.type = FileType.Directory; 65 | this.ctime = Date.now(); 66 | this.mtime = Date.now(); 67 | this.size = 0; 68 | this.name = name; 69 | this.entries = new Map(); 70 | } 71 | } 72 | 73 | export type Entry = File | Directory; 74 | 75 | const textEncoder = new TextEncoder(); 76 | 77 | export class MemFS implements FileSystemProvider, FileSearchProvider, TextSearchProvider, Disposable { 78 | static scheme = 'memfs'; 79 | 80 | private readonly disposable: Disposable; 81 | 82 | constructor() { 83 | this.disposable = Disposable.from( 84 | workspace.registerFileSystemProvider(MemFS.scheme, this, { isCaseSensitive: true }), 85 | workspace.registerFileSearchProvider(MemFS.scheme, this), 86 | workspace.registerTextSearchProvider(MemFS.scheme, this) 87 | ); 88 | } 89 | 90 | dispose() { 91 | this.disposable?.dispose(); 92 | } 93 | 94 | seed() { 95 | this.createDirectory(Uri.parse(`memfs:/sample-folder/`)); 96 | 97 | // most common files types 98 | this.writeFile(Uri.parse(`memfs:/sample-folder/large.ts`), textEncoder.encode(largeTSFile), { create: true, overwrite: true }); 99 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.txt`), textEncoder.encode('foo'), { create: true, overwrite: true }); 100 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.html`), textEncoder.encode('

Hello

'), { create: true, overwrite: true }); 101 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.js`), textEncoder.encode('console.log("JavaScript")'), { create: true, overwrite: true }); 102 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.json`), textEncoder.encode('{ "json": true }'), { create: true, overwrite: true }); 103 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.ts`), textEncoder.encode('console.log("TypeScript")'), { create: true, overwrite: true }); 104 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.css`), textEncoder.encode('* { color: green; }'), { create: true, overwrite: true }); 105 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.md`), textEncoder.encode(debuggableFile), { create: true, overwrite: true }); 106 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.xml`), textEncoder.encode(''), { create: true, overwrite: true }); 107 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.py`), textEncoder.encode('import base64, sys; base64.decode(open(sys.argv[1], "rb"), open(sys.argv[2], "wb"))'), { create: true, overwrite: true }); 108 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.yaml`), textEncoder.encode('- just: write something'), { create: true, overwrite: true }); 109 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.jpg`), getImageFile(), { create: true, overwrite: true }); 110 | this.writeFile(Uri.parse(`memfs:/sample-folder/file.php`), textEncoder.encode(''), { create: true, overwrite: true }); 111 | 112 | // some more files & folders 113 | this.createDirectory(Uri.parse(`memfs:/sample-folder/folder/`)); 114 | this.createDirectory(Uri.parse(`memfs:/sample-folder/workspaces/`)); 115 | this.createDirectory(Uri.parse(`memfs:/sample-folder/large/`)); 116 | this.createDirectory(Uri.parse(`memfs:/sample-folder/xyz/`)); 117 | this.createDirectory(Uri.parse(`memfs:/sample-folder/xyz/abc`)); 118 | this.createDirectory(Uri.parse(`memfs:/sample-folder/xyz/def`)); 119 | 120 | this.writeFile(Uri.parse(`memfs:/sample-folder/folder/empty.txt`), new Uint8Array(0), { create: true, overwrite: true }); 121 | this.writeFile(Uri.parse(`memfs:/sample-folder/folder/empty.foo`), new Uint8Array(0), { create: true, overwrite: true }); 122 | this.writeFile(Uri.parse(`memfs:/sample-folder/folder/file.ts`), textEncoder.encode('let a:number = true; console.log(a);'), { create: true, overwrite: true }); 123 | this.writeFile(Uri.parse(`memfs:/sample-folder/large/rnd.foo`), randomData(50000), { create: true, overwrite: true }); 124 | this.writeFile(Uri.parse(`memfs:/sample-folder/xyz/UPPER.txt`), textEncoder.encode('UPPER'), { create: true, overwrite: true }); 125 | this.writeFile(Uri.parse(`memfs:/sample-folder/xyz/upper.txt`), textEncoder.encode('upper'), { create: true, overwrite: true }); 126 | this.writeFile(Uri.parse(`memfs:/sample-folder/xyz/def/foo.md`), textEncoder.encode('*MemFS*'), { create: true, overwrite: true }); 127 | this.writeFile(Uri.parse(`memfs:/sample-folder/workspaces/mem.code-workspace`), textEncoder.encode(JSON.stringify({ 128 | "folders": [ 129 | { 130 | "name": "sample-folder-large", 131 | "uri": "memfs:/sample-folder/large" 132 | }, 133 | { 134 | "name": "sample-folder-xyz", 135 | "uri": "memfs:/sample-folder/xyz" 136 | }, 137 | { 138 | "name": "sample-folder-folder", 139 | "uri": "memfs:/sample-folder/folder" 140 | } 141 | ] 142 | }, undefined, '\t')), { create: true, overwrite: true }); 143 | 144 | // some files in different encodings 145 | this.createDirectory(Uri.parse(`memfs:/sample-folder/encodings/`)); 146 | this.writeFile( 147 | Uri.parse(`memfs:/sample-folder/encodings/windows1251.txt`), 148 | windows1251File, 149 | { create: true, overwrite: true } 150 | ); 151 | this.writeFile( 152 | Uri.parse(`memfs:/sample-folder/encodings/gbk.txt`), 153 | gbkFile, 154 | { create: true, overwrite: true } 155 | ); 156 | } 157 | 158 | root = new Directory(Uri.parse('memfs:/'), ''); 159 | 160 | // --- manage file metadata 161 | 162 | stat(uri: Uri): FileStat { 163 | return this._lookup(uri, false); 164 | } 165 | 166 | readDirectory(uri: Uri): [string, FileType][] { 167 | const entry = this._lookupAsDirectory(uri, false); 168 | let result: [string, FileType][] = []; 169 | for (const [name, child] of entry.entries) { 170 | result.push([name, child.type]); 171 | } 172 | return result; 173 | } 174 | 175 | // --- manage file contents 176 | 177 | readFile(uri: Uri): Uint8Array { 178 | const data = this._lookupAsFile(uri, false).data; 179 | if (data) { 180 | return data; 181 | } 182 | throw FileSystemError.FileNotFound(); 183 | } 184 | 185 | writeFile(uri: Uri, content: Uint8Array, options: { create: boolean, overwrite: boolean }): void { 186 | let basename = this._basename(uri.path); 187 | let parent = this._lookupParentDirectory(uri); 188 | let entry = parent.entries.get(basename); 189 | if (entry instanceof Directory) { 190 | throw FileSystemError.FileIsADirectory(uri); 191 | } 192 | if (!entry && !options.create) { 193 | throw FileSystemError.FileNotFound(uri); 194 | } 195 | if (entry && options.create && !options.overwrite) { 196 | throw FileSystemError.FileExists(uri); 197 | } 198 | if (!entry) { 199 | entry = new File(uri, basename); 200 | parent.entries.set(basename, entry); 201 | this._fireSoon({ type: FileChangeType.Created, uri }); 202 | } 203 | entry.mtime = Date.now(); 204 | entry.size = content.byteLength; 205 | entry.data = content; 206 | 207 | this._fireSoon({ type: FileChangeType.Changed, uri }); 208 | } 209 | 210 | // --- manage files/folders 211 | 212 | rename(oldUri: Uri, newUri: Uri, options: { overwrite: boolean }): void { 213 | if (!options.overwrite && this._lookup(newUri, true)) { 214 | throw FileSystemError.FileExists(newUri); 215 | } 216 | 217 | let entry = this._lookup(oldUri, false); 218 | let oldParent = this._lookupParentDirectory(oldUri); 219 | 220 | let newParent = this._lookupParentDirectory(newUri); 221 | let newName = this._basename(newUri.path); 222 | 223 | oldParent.entries.delete(entry.name); 224 | entry.name = newName; 225 | newParent.entries.set(newName, entry); 226 | 227 | this._fireSoon( 228 | { type: FileChangeType.Deleted, uri: oldUri }, 229 | { type: FileChangeType.Created, uri: newUri } 230 | ); 231 | } 232 | 233 | delete(uri: Uri): void { 234 | let dirname = uri.with({ path: this._dirname(uri.path) }); 235 | let basename = this._basename(uri.path); 236 | let parent = this._lookupAsDirectory(dirname, false); 237 | if (!parent.entries.has(basename)) { 238 | throw FileSystemError.FileNotFound(uri); 239 | } 240 | parent.entries.delete(basename); 241 | parent.mtime = Date.now(); 242 | parent.size -= 1; 243 | this._fireSoon({ type: FileChangeType.Changed, uri: dirname }, { uri, type: FileChangeType.Deleted }); 244 | } 245 | 246 | createDirectory(uri: Uri): void { 247 | let basename = this._basename(uri.path); 248 | let dirname = uri.with({ path: this._dirname(uri.path) }); 249 | let parent = this._lookupAsDirectory(dirname, false); 250 | 251 | let entry = new Directory(uri, basename); 252 | parent.entries.set(entry.name, entry); 253 | parent.mtime = Date.now(); 254 | parent.size += 1; 255 | this._fireSoon({ type: FileChangeType.Changed, uri: dirname }, { type: FileChangeType.Created, uri }); 256 | } 257 | 258 | // --- lookup 259 | 260 | private _lookup(uri: Uri, silent: false): Entry; 261 | private _lookup(uri: Uri, silent: boolean): Entry | undefined; 262 | private _lookup(uri: Uri, silent: boolean): Entry | undefined { 263 | let parts = uri.path.split('/'); 264 | let entry: Entry = this.root; 265 | for (const part of parts) { 266 | if (!part) { 267 | continue; 268 | } 269 | let child: Entry | undefined; 270 | if (entry instanceof Directory) { 271 | child = entry.entries.get(part); 272 | } 273 | if (!child) { 274 | if (!silent) { 275 | throw FileSystemError.FileNotFound(uri); 276 | } else { 277 | return undefined; 278 | } 279 | } 280 | entry = child; 281 | } 282 | return entry; 283 | } 284 | 285 | private _lookupAsDirectory(uri: Uri, silent: boolean): Directory { 286 | let entry = this._lookup(uri, silent); 287 | if (entry instanceof Directory) { 288 | return entry; 289 | } 290 | throw FileSystemError.FileNotADirectory(uri); 291 | } 292 | 293 | private _lookupAsFile(uri: Uri, silent: boolean): File { 294 | let entry = this._lookup(uri, silent); 295 | if (entry instanceof File) { 296 | return entry; 297 | } 298 | throw FileSystemError.FileIsADirectory(uri); 299 | } 300 | 301 | private _lookupParentDirectory(uri: Uri): Directory { 302 | const dirname = uri.with({ path: this._dirname(uri.path) }); 303 | return this._lookupAsDirectory(dirname, false); 304 | } 305 | 306 | // --- manage file events 307 | 308 | private _emitter = new EventEmitter(); 309 | private _bufferedEvents: FileChangeEvent[] = []; 310 | private _fireSoonHandle?: any; 311 | 312 | readonly onDidChangeFile: Event = this._emitter.event; 313 | 314 | watch(_resource: Uri): Disposable { 315 | // ignore, fires for all changes... 316 | return new Disposable(() => { }); 317 | } 318 | 319 | private _fireSoon(...events: FileChangeEvent[]): void { 320 | this._bufferedEvents.push(...events); 321 | 322 | if (this._fireSoonHandle) { 323 | clearTimeout(this._fireSoonHandle); 324 | } 325 | 326 | this._fireSoonHandle = setTimeout(() => { 327 | this._emitter.fire(this._bufferedEvents); 328 | this._bufferedEvents.length = 0; 329 | }, 5); 330 | } 331 | 332 | // --- path utils 333 | 334 | private _basename(path: string): string { 335 | path = this._rtrim(path, '/'); 336 | if (!path) { 337 | return ''; 338 | } 339 | 340 | return path.substr(path.lastIndexOf('/') + 1); 341 | } 342 | 343 | private _dirname(path: string): string { 344 | path = this._rtrim(path, '/'); 345 | if (!path) { 346 | return '/'; 347 | } 348 | 349 | return path.substr(0, path.lastIndexOf('/')); 350 | } 351 | 352 | private _rtrim(haystack: string, needle: string): string { 353 | if (!haystack || !needle) { 354 | return haystack; 355 | } 356 | 357 | const needleLen = needle.length, 358 | haystackLen = haystack.length; 359 | 360 | if (needleLen === 0 || haystackLen === 0) { 361 | return haystack; 362 | } 363 | 364 | let offset = haystackLen, 365 | idx = -1; 366 | 367 | while (true) { 368 | idx = haystack.lastIndexOf(needle, offset - 1); 369 | if (idx === -1 || idx + needleLen !== offset) { 370 | break; 371 | } 372 | if (idx === 0) { 373 | return ''; 374 | } 375 | offset = idx; 376 | } 377 | 378 | return haystack.substring(0, offset); 379 | } 380 | 381 | private _getFiles(): Set { 382 | const files = new Set(); 383 | 384 | this._doGetFiles(this.root, files); 385 | 386 | return files; 387 | } 388 | 389 | private _doGetFiles(dir: Directory, files: Set): void { 390 | dir.entries.forEach(entry => { 391 | if (entry instanceof File) { 392 | files.add(entry); 393 | } else { 394 | this._doGetFiles(entry, files); 395 | } 396 | }); 397 | } 398 | 399 | private _convertSimple2RegExpPattern(pattern: string): string { 400 | return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*'); 401 | } 402 | 403 | // --- search provider 404 | 405 | provideFileSearchResults(query: FileSearchQuery, _options: FileSearchOptions, _token: CancellationToken): ProviderResult { 406 | return this._findFiles(query.pattern); 407 | } 408 | 409 | private _findFiles(query: string | undefined): Uri[] { 410 | const files = this._getFiles(); 411 | const result: Uri[] = []; 412 | 413 | const pattern = query ? new RegExp(this._convertSimple2RegExpPattern(query)) : null; 414 | 415 | for (const file of files) { 416 | if (!pattern || pattern.exec(file.name)) { 417 | result.push(file.uri); 418 | } 419 | } 420 | 421 | return result; 422 | } 423 | 424 | private _textDecoder = new TextDecoder(); 425 | 426 | provideTextSearchResults(query: TextSearchQuery, options: TextSearchOptions, progress: Progress, _token: CancellationToken) { 427 | const result: TextSearchComplete = { limitHit: false }; 428 | 429 | const files = this._findFiles(options.includes[0]); 430 | if (files) { 431 | for (const file of files) { 432 | const content = this._textDecoder.decode(this.readFile(file)); 433 | 434 | const lines = content.split('\n'); 435 | for (let i = 0; i < lines.length; i++) { 436 | const line = lines[i]; 437 | const index = line.indexOf(query.pattern); 438 | if (index !== -1) { 439 | progress.report({ 440 | uri: file, 441 | ranges: new Range(new Position(i, index), new Position(i, index + query.pattern.length)), 442 | preview: { 443 | text: line, 444 | matches: new Range(new Position(0, index), new Position(0, index + query.pattern.length)) 445 | } 446 | }); 447 | } 448 | } 449 | } 450 | } 451 | 452 | return result; 453 | } 454 | } 455 | 456 | function randomData(lineCnt: number, lineLen = 155): Uint8Array { 457 | let lines: string[] = []; 458 | for (let i = 0; i < lineCnt; i++) { 459 | let line = ''; 460 | while (line.length < lineLen) { 461 | line += Math.random().toString(2 + (i % 34)).substr(2); 462 | } 463 | lines.push(line.substr(0, lineLen)); 464 | } 465 | return textEncoder.encode(lines.join('\n')); 466 | } 467 | -------------------------------------------------------------------------------- /dist/extension.js: -------------------------------------------------------------------------------- 1 | !function(t,e){for(var r in e)t[r]=e[r]}(exports,function(t){var e={};function r(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)r.d(n,s,function(e){return t[e]}.bind(null,s));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e){t.exports=require("vscode")},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{l(n.next(t))}catch(t){i(t)}}function a(t){try{l(n.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.activate=void 0;const s=r(0),i=r(2);function o(t,e){t&&"/sample-folder/large.ts"===t.fileName?e.set(t.uri,[{code:"",message:"cannot assign twice to immutable variable `storeHouses`",range:new s.Range(new s.Position(4,12),new s.Position(4,32)),severity:s.DiagnosticSeverity.Error,source:"",relatedInformation:[new s.DiagnosticRelatedInformation(new s.Location(t.uri,new s.Range(new s.Position(1,8),new s.Position(1,9))),"first assignment to `x`")]},{code:"",message:"function does not follow naming conventions",range:new s.Range(new s.Position(7,10),new s.Position(7,23)),severity:s.DiagnosticSeverity.Warning,source:""}]):e.clear()}e.activate=function(t){if("object"==typeof navigator){(function(t){const e=new i.MemFS;return t.subscriptions.push(e),e})(t).seed(),function(t){const e=s.languages.createDiagnosticCollection("test");s.window.activeTextEditor&&o(s.window.activeTextEditor.document,e);t.subscriptions.push(s.window.onDidChangeActiveTextEditor(t=>{t&&o(t.document,e)}))}(t),function(){class t{constructor(t){this.workspaceRoot=t}provideTasks(){return n(this,void 0,void 0,(function*(){return this.getTasks()}))}resolveTask(t){if(t.definition.flavor){const e=t.definition;return this.getTask(e.flavor,e.flags?e.flags:[],e)}}getTasks(){if(void 0!==this.tasks)return this.tasks;const t=[["watch","incremental"],["incremental"],[]];return this.tasks=[],["32","64"].forEach(e=>{t.forEach(t=>{this.tasks.push(this.getTask(e,t))})}),this.tasks}getTask(r,i,o){return void 0===o&&(o={type:t.CustomBuildScriptType,flavor:r,flags:i}),new s.Task(o,s.TaskScope.Workspace,`${r} ${i.join(" ")}`,t.CustomBuildScriptType,new s.CustomExecution(()=>n(this,void 0,void 0,(function*(){return new e(this.workspaceRoot,r,i,()=>this.sharedState,t=>this.sharedState=t)}))))}}t.CustomBuildScriptType="custombuildscript";class e{constructor(t,e,r,n,i){this.workspaceRoot=t,this.flags=r,this.getSharedState=n,this.setSharedState=i,this.writeEmitter=new s.EventEmitter,this.onDidWrite=this.writeEmitter.event,this.closeEmitter=new s.EventEmitter,this.onDidClose=this.closeEmitter.event}open(t){if(this.flags.indexOf("watch")>-1){let t=this.workspaceRoot+"/customBuildFile";this.fileWatcher=s.workspace.createFileSystemWatcher(t),this.fileWatcher.onDidChange(()=>this.doBuild()),this.fileWatcher.onDidCreate(()=>this.doBuild()),this.fileWatcher.onDidDelete(()=>this.doBuild())}this.doBuild()}close(){this.fileWatcher&&this.fileWatcher.dispose()}doBuild(){return n(this,void 0,void 0,(function*(){return new Promise(t=>{this.writeEmitter.fire("Starting build...\r\n");let e=this.flags.indexOf("incremental")>-1;e&&(this.getSharedState()?this.writeEmitter.fire("Using last build results: "+this.getSharedState()+"\r\n"):(e=!1,this.writeEmitter.fire("No result from last build. Doing full build.\r\n"))),setTimeout(()=>{const e=new Date;this.setSharedState(e.toTimeString()+" "+e.toDateString()),this.writeEmitter.fire("Build complete.\r\n\r\n"),-1===this.flags.indexOf("watch")&&(this.closeEmitter.fire(),t())},e?1e3:4e3)})}))}}s.tasks.registerTaskProvider(t.CustomBuildScriptType,new t(s.workspace.rootPath))}(),s.commands.executeCommand("vscode.open",s.Uri.parse("memfs:/sample-folder/large.ts"))}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MemFS=e.Directory=e.File=void 0;const n=r(0),s=r(3);class i{constructor(t,e){this.uri=t,this.type=n.FileType.File,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e}}e.File=i;class o{constructor(t,e){this.uri=t,this.type=n.FileType.Directory,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e,this.entries=new Map}}e.Directory=o;const a=new TextEncoder;class l{constructor(){this.root=new o(n.Uri.parse("memfs:/"),""),this._emitter=new n.EventEmitter,this._bufferedEvents=[],this.onDidChangeFile=this._emitter.event,this._textDecoder=new TextDecoder,this.disposable=n.Disposable.from(n.workspace.registerFileSystemProvider(l.scheme,this,{isCaseSensitive:!0}),n.workspace.registerFileSearchProvider(l.scheme,this),n.workspace.registerTextSearchProvider(l.scheme,this))}dispose(){var t;null===(t=this.disposable)||void 0===t||t.dispose()}seed(){this.createDirectory(n.Uri.parse("memfs:/sample-folder/")),this.writeFile(n.Uri.parse("memfs:/sample-folder/large.ts"),a.encode(s.largeTSFile),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.txt"),a.encode("foo"),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.html"),a.encode('

Hello

'),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.js"),a.encode('console.log("JavaScript")'),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.json"),a.encode('{ "json": true }'),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.ts"),a.encode('console.log("TypeScript")'),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.css"),a.encode("* { color: green; }"),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.md"),a.encode(s.debuggableFile),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.xml"),a.encode(''),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.py"),a.encode('import base64, sys; base64.decode(open(sys.argv[1], "rb"), open(sys.argv[2], "wb"))'),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.yaml"),a.encode("- just: write something"),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.jpg"),s.getImageFile(),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/file.php"),a.encode(''),{create:!0,overwrite:!0}),this.createDirectory(n.Uri.parse("memfs:/sample-folder/folder/")),this.createDirectory(n.Uri.parse("memfs:/sample-folder/workspaces/")),this.createDirectory(n.Uri.parse("memfs:/sample-folder/large/")),this.createDirectory(n.Uri.parse("memfs:/sample-folder/xyz/")),this.createDirectory(n.Uri.parse("memfs:/sample-folder/xyz/abc")),this.createDirectory(n.Uri.parse("memfs:/sample-folder/xyz/def")),this.writeFile(n.Uri.parse("memfs:/sample-folder/folder/empty.txt"),new Uint8Array(0),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/folder/empty.foo"),new Uint8Array(0),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/folder/file.ts"),a.encode("let a:number = true; console.log(a);"),{create:!0,overwrite:!0}),this.writeFile(n.Uri.parse("memfs:/sample-folder/large/rnd.foo"),function(t,e=155){let r=[];for(let n=0;n{})}_fireSoon(...t){this._bufferedEvents.push(...t),this._fireSoonHandle&&clearTimeout(this._fireSoonHandle),this._fireSoonHandle=setTimeout(()=>{this._emitter.fire(this._bufferedEvents),this._bufferedEvents.length=0},5)}_basename(t){return(t=this._rtrim(t,"/"))?t.substr(t.lastIndexOf("/")+1):""}_dirname(t){return(t=this._rtrim(t,"/"))?t.substr(0,t.lastIndexOf("/")):"/"}_rtrim(t,e){if(!t||!e)return t;const r=e.length,n=t.length;if(0===r||0===n)return t;let s=n,i=-1;for(;i=t.lastIndexOf(e,s-1),-1!==i&&i+r===s;){if(0===i)return"";s=i}return t.substring(0,s)}_getFiles(){const t=new Set;return this._doGetFiles(this.root,t),t}_doGetFiles(t,e){t.entries.forEach(t=>{t instanceof i?e.add(t):this._doGetFiles(t,e)})}_convertSimple2RegExpPattern(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}provideFileSearchResults(t,e,r){return this._findFiles(t.pattern)}_findFiles(t){const e=this._getFiles(),r=[],n=t?new RegExp(this._convertSimple2RegExpPattern(t)):null;for(const t of e)n&&!n.exec(t.name)||r.push(t.uri);return r}provideTextSearchResults(t,e,r,s){const i=this._findFiles(e.includes[0]);if(i)for(const e of i){const s=this._textDecoder.decode(this.readFile(e)).split("\n");for(let i=0;i\n/// \n\nmodule Mankala {\nexport var storeHouses = [6,13];\nexport var svgNS = 'http://www.w3.org/2000/svg';\n\nfunction createSVGRect(r:Rectangle) {\n\tvar rect = document.createElementNS(svgNS,'rect');\n\trect.setAttribute('x', r.x.toString());\n\trect.setAttribute('y', r.y.toString());\n\trect.setAttribute('width', r.width.toString());\n\trect.setAttribute('height', r.height.toString());\n\treturn rect;\n}\n\nfunction createSVGEllipse(r:Rectangle) {\n\tvar ell = document.createElementNS(svgNS,'ellipse');\n\tell.setAttribute('rx',(r.width/2).toString());\n\tell.setAttribute('ry',(r.height/2).toString());\n\tell.setAttribute('cx',(r.x+r.width/2).toString());\n\tell.setAttribute('cy',(r.y+r.height/2).toString());\n\treturn ell;\n}\n\nfunction createSVGEllipsePolar(angle:number,radius:number,tx:number,ty:number,cxo:number,cyo:number) {\n\tvar ell = document.createElementNS(svgNS,'ellipse');\n\tell.setAttribute('rx',radius.toString());\n\tell.setAttribute('ry',(radius/3).toString());\n\tell.setAttribute('cx',cxo.toString());\n\tell.setAttribute('cy',cyo.toString());\n\tvar dangle = angle*(180/Math.PI);\n\tell.setAttribute('transform','rotate('+dangle+','+cxo+','+cyo+') translate('+tx+','+ty+')');\n\treturn ell;\n}\n\nfunction createSVGInscribedCircle(sq:Square) {\n\tvar circle = document.createElementNS(svgNS,'circle');\n\tcircle.setAttribute('r',(sq.length/2).toString());\n\tcircle.setAttribute('cx',(sq.x+(sq.length/2)).toString());\n\tcircle.setAttribute('cy',(sq.y+(sq.length/2)).toString());\n\treturn circle;\n}\n\nexport class Position {\n\n\tseedCounts:number[];\n\tstartMove:number;\n\tturn:number;\n\n\tconstructor(seedCounts:number[],startMove:number,turn:number) {\n\t\tthis.seedCounts = seedCounts;\n\t\tthis.startMove = startMove;\n\t\tthis.turn = turn;\n\t}\n\n\tscore() {\n\t\tvar baseScore = this.seedCounts[storeHouses[1-this.turn]]-this.seedCounts[storeHouses[this.turn]];\n\t\tvar otherSpaces = homeSpaces[this.turn];\n\t\tvar sum = 0;\n\t\tfor (var k = 0,len = otherSpaces.length;k0) {\n\t\t\tfeatures.clear();\n\t\t\tvar len = this.seedCounts.length;\n\t\t\tfor (var i = 0;i0) {\n\t\t\t\tif (nextSpace==storeHouses[this.turn]) {\n\t\t\t\t\tfeatures.seedStoredCount++;\n\t\t\t\t}\n\t\t\t\tif ((nextSpace!=storeHouses[1-this.turn])) {\n\t\t\t\t\tnextSeedCounts[nextSpace]++;\n\t\t\t\t\tseedCount--;\n\t\t\t\t}\n\t\t\t\tif (seedCount==0) {\n\t\t\t\t\tif (nextSpace==storeHouses[this.turn]) {\n\t\t\t\t\t\tfeatures.turnContinues = true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ((nextSeedCounts[nextSpace]==1)&&\n\t\t\t\t\t\t\t(nextSpace>=firstHomeSpace[this.turn])&&\n\t\t\t\t\t\t\t(nextSpace<=lastHomeSpace[this.turn])) {\n\t\t\t\t\t\t\t// capture\n\t\t\t\t\t\t\tvar capturedSpace = capturedSpaces[nextSpace];\n\t\t\t\t\t\t\tif (capturedSpace>=0) {\n\t\t\t\t\t\t\t\tfeatures.spaceCaptured = capturedSpace;\n\t\t\t\t\t\t\t\tfeatures.capturedCount = nextSeedCounts[capturedSpace];\n\t\t\t\t\t\t\t\tnextSeedCounts[capturedSpace] = 0;\n\t\t\t\t\t\t\t\tnextSeedCounts[storeHouses[this.turn]] += features.capturedCount;\n\t\t\t\t\t\t\t\tfeatures.seedStoredCount += nextSeedCounts[capturedSpace];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextSpace = (nextSpace+1)%14;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\nexport class SeedCoords {\n\ttx:number;\n\tty:number;\n\tangle:number;\n\n\tconstructor(tx:number, ty:number, angle:number) {\n\t\tthis.tx = tx;\n\t\tthis.ty = ty;\n\t\tthis.angle = angle;\n\t}\n}\n\nexport class DisplayPosition extends Position {\n\n\tconfig:SeedCoords[][];\n\n\tconstructor(seedCounts:number[],startMove:number,turn:number) {\n\t\tsuper(seedCounts,startMove,turn);\n\n\t\tthis.config = [];\n\n\t\tfor (var i = 0;i();\n\t\t}\n\t}\n\n\n\tseedCircleRect(rect:Rectangle,seedCount:number,board:Element,seed:number) {\n\t\tvar coords = this.config[seed];\n\t\tvar sq = rect.inner(0.95).square();\n\t\tvar cxo = (sq.width/2)+sq.x;\n\t\tvar cyo = (sq.height/2)+sq.y;\n\t\tvar seedNumbers = [5,7,9,11];\n\t\tvar ringIndex = 0;\n\t\tvar ringRem = seedNumbers[ringIndex];\n\t\tvar angleDelta = (2*Math.PI)/ringRem;\n\t\tvar angle = angleDelta;\n\t\tvar seedLength = sq.width/(seedNumbers.length<<1);\n\t\tvar crMax = sq.width/2-(seedLength/2);\n\t\tvar pit = createSVGInscribedCircle(sq);\n\t\tif (seed<7) {\n\t\t\tpit.setAttribute('fill','brown');\n\t\t}\n\t\telse {\n\t\t\tpit.setAttribute('fill','saddlebrown');\n\t\t}\n\t\tboard.appendChild(pit);\n\t\tvar seedsSeen = 0;\n\t\twhile (seedCount > 0) {\n\t\t\tif (ringRem == 0) {\n\t\t\t\tringIndex++;\n\t\t\t\tringRem = seedNumbers[ringIndex];\n\t\t\t\tangleDelta = (2*Math.PI)/ringRem;\n\t\t\t\tangle = angleDelta;\n\t\t\t}\n\t\t\tvar tx:number;\n\t\t\tvar ty:number;\n\t\t\tvar tangle = angle;\n\t\t\tif (coords.length>seedsSeen) {\n\t\t\t\ttx = coords[seedsSeen].tx;\n\t\t\t\tty = coords[seedsSeen].ty;\n\t\t\t\ttangle = coords[seedsSeen].angle;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttx = (Math.random()*crMax)-(crMax/3);\n\t\t\t\tty = (Math.random()*crMax)-(crMax/3);\n\t\t\t\tcoords[seedsSeen] = new SeedCoords(tx,ty,angle);\n\t\t\t}\n\t\t\tvar ell = createSVGEllipsePolar(tangle,seedLength,tx,ty,cxo,cyo);\n\t\t\tboard.appendChild(ell);\n\t\t\tangle += angleDelta;\n\t\t\tringRem--;\n\t\t\tseedCount--;\n\t\t\tseedsSeen++;\n\t\t}\n\t}\n\n\ttoCircleSVG() {\n\t\tvar seedDivisions = 14;\n\t\tvar board = document.createElementNS(svgNS,'svg');\n\t\tvar boardRect = new Rectangle(0,0,1800,800);\n\t\tboard.setAttribute('width','1800');\n\t\tboard.setAttribute('height','800');\n\t\tvar whole = createSVGRect(boardRect);\n\t\twhole.setAttribute('fill','tan');\n\t\tboard.appendChild(whole);\n\t\tvar labPlayLab = boardRect.proportionalSplitVert(20,760,20);\n\t\tvar playSurface = labPlayLab[1];\n\t\tvar storeMainStore = playSurface.proportionalSplitHoriz(8,48,8);\n\t\tvar mainPair = storeMainStore[1].subDivideVert(2);\n\t\tvar playerRects = [mainPair[0].subDivideHoriz(6), mainPair[1].subDivideHoriz(6)];\n\t\t// reverse top layer because storehouse on left\n\t\tfor (var k = 0;k<3;k++) {\n\t\t\tvar temp = playerRects[0][k];\n\t\t\tplayerRects[0][k] = playerRects[0][5-k];\n\t\t\tplayerRects[0][5-k] = temp;\n\t\t}\n\t\tvar storehouses = [storeMainStore[0],storeMainStore[2]];\n\t\tvar playerSeeds = this.seedCounts.length>>1;\n\t\tfor (var i = 0;i<2;i++) {\n\t\t\tvar player = playerRects[i];\n\t\t\tvar storehouse = storehouses[i];\n\t\t\tvar r:Rectangle;\n\t\t\tfor (var j = 0;j();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn board;\n\t}\n}\n}\n",e.debuggableFile="# VS Code Mock Debug\n\nThis is a starter sample for developing VS Code debug adapters.\n\n**Mock Debug** simulates a debug adapter for Visual Studio Code.\nIt supports *step*, *continue*, *breakpoints*, *exceptions*, and\n*variable access* but it is not connected to any real debugger.\n\nThe sample is meant as an educational piece showing how to implement a debug\nadapter for VS Code. It can be used as a starting point for developing a real adapter.\n\nMore information about how to develop a new debug adapter can be found\n[here](https://code.visualstudio.com/docs/extensions/example-debuggers).\nOr discuss debug adapters on Gitter:\n[![Gitter Chat](https://img.shields.io/badge/chat-online-brightgreen.svg)](https://gitter.im/Microsoft/vscode)\n\n## Using Mock Debug\n\n* Install the **Mock Debug** extension in VS Code.\n* Create a new 'program' file 'readme.md' and enter several lines of arbitrary text.\n* Switch to the debug viewlet and press the gear dropdown.\n* Select the debug environment \"Mock Debug\".\n* Press the green 'play' button to start debugging.\n\nYou can now 'step through' the 'readme.md' file, set and hit breakpoints, and run into exceptions (if the word exception appears in a line).\n\n![Mock Debug](file.jpg)\n\n## Build and Run\n\n[![build status](https://travis-ci.org/Microsoft/vscode-mock-debug.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-mock-debug)\n[![build status](https://ci.appveyor.com/api/projects/status/empmw5q1tk6h1fly/branch/master?svg=true)](https://ci.appveyor.com/project/weinand/vscode-mock-debug)\n\n\n* Clone the project [https://github.com/Microsoft/vscode-mock-debug.git](https://github.com/Microsoft/vscode-mock-debug.git)\n* Open the project folder in VS Code.\n* Press 'F5' to build and launch Mock Debug in another VS Code window. In that window:\n* Open a new workspace, create a new 'program' file 'readme.md' and enter several lines of arbitrary text.\n* Switch to the debug viewlet and press the gear dropdown.\n* Select the debug environment \"Mock Debug\".\n* Press 'F5' to start debugging.",e.getImageFile=function(){const t=atob("/9j/4AAQSkZJRgABAQAASABIAAD/2wCEAA4ODg4ODhcODhchFxcXIS0hISEhLTktLS0tLTlFOTk5OTk5RUVFRUVFRUVSUlJSUlJgYGBgYGxsbGxsbGxsbGwBERISGxkbLxkZL3FMP0xxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcf/AABEIAFYAZAMBIgACEQEDEQH/xAB1AAACAwEBAQAAAAAAAAAAAAAABAMFBgIBBxAAAgIBAwMCBQQCAwAAAAAAAQIAA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8QEYK5hGpUUJVc1lTgcDjEe1FPxqGQHBZSMiQqa8/Z38xgOoHB/aIfJNVZrdFqirsVbsfzLXT7+UQLYmcDHBlh/k+g+KP1dOCV+4efcTNbdtGq3CxQiMKyeX7CGqxqtDuK7lYK2BXnAz3JMuNZoPpDAyV5zHNt2bRbcA1S/Pjljyf7jerWxx0V4wQeZgynxrUXoUnIif629GJY595cptr1N9XJYjOfEi1G3LYMLgH1m04qxelrAtnj/qZYIvUPpMcHwYtTT8FzVaMN6+sslqVF6gcQ1sRivPccwjS314+bGYRBnqzws6FhUfL7CQ8gdI7+TDIHHgcSVGBYRznMXfUL2J5ngPUOYCpfM2tiq1tnUpVRnMe0DGtAKyQIw+mU4GJCKmrPy+I6V0lxYYIzxOCtdjZyVIMRqtPsYx8RT37+sdRhsFlHzcyC0J0kmcfqFX5cxC7VAk4OPUQtM+UVtYf7vH8iKP8SnKg5U9xHQwsGV7jxF9QnWACMEcgwlUjT4ZUE+YRRLGRehwciEpLRMAAT6SALlIQkF4kl7HEIQLwuQfac9RPeEJi5H3TruvvmEJo1QOcgGQuvVg+sITM8rDKeDHVItXkQhKgqM6esnJEIQlJf//Z");return Uint8Array.from([...t].map(t=>t.charCodeAt(0)))},e.windows1251File=Uint8Array.from([192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]),e.gbkFile=Uint8Array.from([214,208,185,250,97,98,99])}])); 2 | //# sourceMappingURL=extension.js.map -------------------------------------------------------------------------------- /dist/extension.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"vscode\"","webpack:///./src/extension.ts","webpack:///./src/memfs.ts","webpack:///./src/exampleFiles.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","require","updateDiagnostics","document","collection","fileName","set","uri","code","message","range","vscode","Range","Position","severity","DiagnosticSeverity","Error","source","relatedInformation","DiagnosticRelatedInformation","Location","Warning","clear","context","navigator","memFs","MemFS","subscriptions","push","enableFs","seed","languages","createDiagnosticCollection","window","activeTextEditor","onDidChangeActiveTextEditor","editor","enableProblems","CustomBuildTaskProvider","workspaceRoot","this","getTasks","_task","definition","flavor","getTask","flags","undefined","tasks","forEach","flagGroup","type","CustomBuildScriptType","Task","TaskScope","Workspace","join","CustomExecution","CustomBuildTaskTerminal","sharedState","state","_flavor","getSharedState","setSharedState","writeEmitter","EventEmitter","onDidWrite","event","closeEmitter","onDidClose","_initialDimensions","indexOf","pattern","fileWatcher","workspace","createFileSystemWatcher","onDidChange","doBuild","onDidCreate","onDidDelete","dispose","Promise","resolve","fire","isIncremental","setTimeout","date","Date","toTimeString","toDateString","registerTaskProvider","rootPath","enableTasks","commands","executeCommand","Uri","parse","File","FileType","ctime","now","mtime","size","Directory","entries","Map","textEncoder","TextEncoder","root","_emitter","_bufferedEvents","onDidChangeFile","_textDecoder","TextDecoder","disposable","Disposable","from","registerFileSystemProvider","scheme","isCaseSensitive","registerFileSearchProvider","registerTextSearchProvider","createDirectory","writeFile","encode","largeTSFile","overwrite","debuggableFile","getImageFile","Uint8Array","lineCnt","lineLen","lines","line","length","Math","random","toString","substr","randomData","JSON","stringify","windows1251File","gbkFile","_lookup","entry","_lookupAsDirectory","result","child","data","_lookupAsFile","FileSystemError","FileNotFound","content","options","basename","_basename","path","parent","_lookupParentDirectory","FileIsADirectory","FileExists","_fireSoon","FileChangeType","Created","byteLength","Changed","oldUri","newUri","oldParent","newParent","newName","delete","Deleted","dirname","with","_dirname","has","silent","parts","split","part","FileNotADirectory","_resource","events","_fireSoonHandle","clearTimeout","_rtrim","lastIndexOf","haystack","needle","needleLen","haystackLen","offset","idx","substring","files","Set","_doGetFiles","dir","add","replace","query","_options","_token","_findFiles","_getFiles","RegExp","_convertSimple2RegExpPattern","file","exec","progress","includes","decode","readFile","index","report","ranges","preview","text","matches","limitHit","atob","map","x","charCodeAt"],"mappings":"6DACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OA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AK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,MAG9V,EAAA2B,QAAUd,WAAWb,KAAK,CAAC,IAAK,IAAK,IAAK,IAAK,GAAI,GAAI","file":"extension.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","module.exports = require(\"vscode\");","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n//\n// ############################################################################\n//\n//\t\t\t\t\t\t! USED FOR RUNNING VSCODE OUT OF SOURCES FOR WEB !\n//\t\t\t\t\t\t\t\t\t\t! DO NOT REMOVE !\n//\n// ############################################################################\n//\n\nimport * as vscode from 'vscode';\nimport { MemFS } from './memfs';\n\ndeclare const navigator: unknown;\n\nexport function activate(context: vscode.ExtensionContext) {\n\tif (typeof navigator === 'object') {\t// do not run under node.js\n\t\tconst memFs = enableFs(context);\n\t\tmemFs.seed();\n\t\tenableProblems(context);\n\t\tenableTasks();\n\n\t\tvscode.commands.executeCommand('vscode.open', vscode.Uri.parse(`memfs:/sample-folder/large.ts`));\n\t}\n}\n\nfunction enableFs(context: vscode.ExtensionContext): MemFS {\n\tconst memFs = new MemFS();\n\tcontext.subscriptions.push(memFs);\n\n\treturn memFs;\n}\n\nfunction enableProblems(context: vscode.ExtensionContext): void {\n\tconst collection = vscode.languages.createDiagnosticCollection('test');\n\tif (vscode.window.activeTextEditor) {\n\t\tupdateDiagnostics(vscode.window.activeTextEditor.document, collection);\n\t}\n\tcontext.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(editor => {\n\t\tif (editor) {\n\t\t\tupdateDiagnostics(editor.document, collection);\n\t\t}\n\t}));\n}\n\nfunction updateDiagnostics(document: vscode.TextDocument, collection: vscode.DiagnosticCollection): void {\n\tif (document && document.fileName === '/sample-folder/large.ts') {\n\t\tcollection.set(document.uri, [{\n\t\t\tcode: '',\n\t\t\tmessage: 'cannot assign twice to immutable variable `storeHouses`',\n\t\t\trange: new vscode.Range(new vscode.Position(4, 12), new vscode.Position(4, 32)),\n\t\t\tseverity: vscode.DiagnosticSeverity.Error,\n\t\t\tsource: '',\n\t\t\trelatedInformation: [\n\t\t\t\tnew vscode.DiagnosticRelatedInformation(new vscode.Location(document.uri, new vscode.Range(new vscode.Position(1, 8), new vscode.Position(1, 9))), 'first assignment to `x`')\n\t\t\t]\n\t\t}, {\n\t\t\tcode: '',\n\t\t\tmessage: 'function does not follow naming conventions',\n\t\t\trange: new vscode.Range(new vscode.Position(7, 10), new vscode.Position(7, 23)),\n\t\t\tseverity: vscode.DiagnosticSeverity.Warning,\n\t\t\tsource: ''\n\t\t}]);\n\t} else {\n\t\tcollection.clear();\n\t}\n}\n\nfunction enableTasks(): void {\n\n\tinterface CustomBuildTaskDefinition extends vscode.TaskDefinition {\n\t\t/**\n\t\t * The build flavor. Should be either '32' or '64'.\n\t\t */\n\t\tflavor: string;\n\n\t\t/**\n\t\t * Additional build flags\n\t\t */\n\t\tflags?: string[];\n\t}\n\n\tclass CustomBuildTaskProvider implements vscode.TaskProvider {\n\t\tstatic CustomBuildScriptType: string = 'custombuildscript';\n\t\tprivate tasks: vscode.Task[] | undefined;\n\n\t\t// We use a CustomExecution task when state needs to be shared accross runs of the task or when\n\t\t// the task requires use of some VS Code API to run.\n\t\t// If you don't need to share state between runs and if you don't need to execute VS Code API in your task,\n\t\t// then a simple ShellExecution or ProcessExecution should be enough.\n\t\t// Since our build has this shared state, the CustomExecution is used below.\n\t\tprivate sharedState: string | undefined;\n\n\t\tconstructor(private workspaceRoot: string) { }\n\n\t\tasync provideTasks(): Promise {\n\t\t\treturn this.getTasks();\n\t\t}\n\n\t\tresolveTask(_task: vscode.Task): vscode.Task | undefined {\n\t\t\tconst flavor: string = _task.definition.flavor;\n\t\t\tif (flavor) {\n\t\t\t\tconst definition: CustomBuildTaskDefinition = _task.definition;\n\t\t\t\treturn this.getTask(definition.flavor, definition.flags ? definition.flags : [], definition);\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\n\t\tprivate getTasks(): vscode.Task[] {\n\t\t\tif (this.tasks !== undefined) {\n\t\t\t\treturn this.tasks;\n\t\t\t}\n\t\t\t// In our fictional build, we have two build flavors\n\t\t\tconst flavors: string[] = ['32', '64'];\n\t\t\t// Each flavor can have some options.\n\t\t\tconst flags: string[][] = [['watch', 'incremental'], ['incremental'], []];\n\n\t\t\tthis.tasks = [];\n\t\t\tflavors.forEach(flavor => {\n\t\t\t\tflags.forEach(flagGroup => {\n\t\t\t\t\tthis.tasks!.push(this.getTask(flavor, flagGroup));\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn this.tasks;\n\t\t}\n\n\t\tprivate getTask(flavor: string, flags: string[], definition?: CustomBuildTaskDefinition): vscode.Task {\n\t\t\tif (definition === undefined) {\n\t\t\t\tdefinition = {\n\t\t\t\t\ttype: CustomBuildTaskProvider.CustomBuildScriptType,\n\t\t\t\t\tflavor,\n\t\t\t\t\tflags\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn new vscode.Task(definition, vscode.TaskScope.Workspace, `${flavor} ${flags.join(' ')}`,\n\t\t\t\tCustomBuildTaskProvider.CustomBuildScriptType, new vscode.CustomExecution(async (): Promise => {\n\t\t\t\t\t// When the task is executed, this callback will run. Here, we setup for running the task.\n\t\t\t\t\treturn new CustomBuildTaskTerminal(this.workspaceRoot, flavor, flags, () => this.sharedState, (state: string) => this.sharedState = state);\n\t\t\t\t}));\n\t\t}\n\t}\n\n\tclass CustomBuildTaskTerminal implements vscode.Pseudoterminal {\n\t\tprivate writeEmitter = new vscode.EventEmitter();\n\t\tonDidWrite: vscode.Event = this.writeEmitter.event;\n\t\tprivate closeEmitter = new vscode.EventEmitter();\n\t\tonDidClose?: vscode.Event = this.closeEmitter.event;\n\n\t\tprivate fileWatcher: vscode.FileSystemWatcher | undefined;\n\n\t\tconstructor(private workspaceRoot: string, _flavor: string, private flags: string[], private getSharedState: () => string | undefined, private setSharedState: (state: string) => void) {\n\t\t}\n\n\t\topen(_initialDimensions: vscode.TerminalDimensions | undefined): void {\n\t\t\t// At this point we can start using the terminal.\n\t\t\tif (this.flags.indexOf('watch') > -1) {\n\t\t\t\tlet pattern = this.workspaceRoot + '/customBuildFile';\n\t\t\t\tthis.fileWatcher = vscode.workspace.createFileSystemWatcher(pattern);\n\t\t\t\tthis.fileWatcher.onDidChange(() => this.doBuild());\n\t\t\t\tthis.fileWatcher.onDidCreate(() => this.doBuild());\n\t\t\t\tthis.fileWatcher.onDidDelete(() => this.doBuild());\n\t\t\t}\n\t\t\tthis.doBuild();\n\t\t}\n\n\t\tclose(): void {\n\t\t\t// The terminal has been closed. Shutdown the build.\n\t\t\tif (this.fileWatcher) {\n\t\t\t\tthis.fileWatcher.dispose();\n\t\t\t}\n\t\t}\n\n\t\tprivate async doBuild(): Promise {\n\t\t\treturn new Promise((resolve) => {\n\t\t\t\tthis.writeEmitter.fire('Starting build...\\r\\n');\n\t\t\t\tlet isIncremental = this.flags.indexOf('incremental') > -1;\n\t\t\t\tif (isIncremental) {\n\t\t\t\t\tif (this.getSharedState()) {\n\t\t\t\t\t\tthis.writeEmitter.fire('Using last build results: ' + this.getSharedState() + '\\r\\n');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisIncremental = false;\n\t\t\t\t\t\tthis.writeEmitter.fire('No result from last build. Doing full build.\\r\\n');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Since we don't actually build anything in this example set a timeout instead.\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tconst date = new Date();\n\t\t\t\t\tthis.setSharedState(date.toTimeString() + ' ' + date.toDateString());\n\t\t\t\t\tthis.writeEmitter.fire('Build complete.\\r\\n\\r\\n');\n\t\t\t\t\tif (this.flags.indexOf('watch') === -1) {\n\t\t\t\t\t\tthis.closeEmitter.fire();\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t}\n\t\t\t\t}, isIncremental ? 1000 : 4000);\n\t\t\t});\n\t\t}\n\t}\n\n\tvscode.tasks.registerTaskProvider(CustomBuildTaskProvider.CustomBuildScriptType, new CustomBuildTaskProvider(vscode.workspace.rootPath!));\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport {\n\tCancellationToken,\n\tDisposable,\n\tEvent,\n\tEventEmitter,\n\tFileChangeEvent,\n\tFileChangeType,\n\tFileSearchOptions,\n\tFileSearchProvider,\n\tFileSearchQuery,\n\tFileStat,\n\tFileSystemError,\n\tFileSystemProvider,\n\tFileType,\n\tPosition,\n\tProgress,\n\tProviderResult,\n\tRange,\n\tTextSearchComplete,\n\tTextSearchOptions,\n\tTextSearchQuery,\n\tTextSearchProvider,\n\tTextSearchResult,\n\tUri,\n\tworkspace,\n} from 'vscode';\nimport { largeTSFile, getImageFile, debuggableFile, windows1251File, gbkFile } from './exampleFiles';\n\nexport class File implements FileStat {\n\n\ttype: FileType;\n\tctime: number;\n\tmtime: number;\n\tsize: number;\n\n\tname: string;\n\tdata?: Uint8Array;\n\n\tconstructor(public uri: Uri, name: string) {\n\t\tthis.type = FileType.File;\n\t\tthis.ctime = Date.now();\n\t\tthis.mtime = Date.now();\n\t\tthis.size = 0;\n\t\tthis.name = name;\n\t}\n}\n\nexport class Directory implements FileStat {\n\n\ttype: FileType;\n\tctime: number;\n\tmtime: number;\n\tsize: number;\n\n\tname: string;\n\tentries: Map;\n\n\tconstructor(public uri: Uri, name: string) {\n\t\tthis.type = FileType.Directory;\n\t\tthis.ctime = Date.now();\n\t\tthis.mtime = Date.now();\n\t\tthis.size = 0;\n\t\tthis.name = name;\n\t\tthis.entries = new Map();\n\t}\n}\n\nexport type Entry = File | Directory;\n\nconst textEncoder = new TextEncoder();\n\nexport class MemFS implements FileSystemProvider, FileSearchProvider, TextSearchProvider, Disposable {\n\tstatic scheme = 'memfs';\n\n\tprivate readonly disposable: Disposable;\n\n\tconstructor() {\n\t\tthis.disposable = Disposable.from(\n\t\t\tworkspace.registerFileSystemProvider(MemFS.scheme, this, { isCaseSensitive: true }),\n\t\t\tworkspace.registerFileSearchProvider(MemFS.scheme, this),\n\t\t\tworkspace.registerTextSearchProvider(MemFS.scheme, this)\n\t\t);\n\t}\n\n\tdispose() {\n\t\tthis.disposable?.dispose();\n\t}\n\n\tseed() {\n\t\tthis.createDirectory(Uri.parse(`memfs:/sample-folder/`));\n\n\t\t// most common files types\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/large.ts`), textEncoder.encode(largeTSFile), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.txt`), textEncoder.encode('foo'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.html`), textEncoder.encode('

Hello

'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.js`), textEncoder.encode('console.log(\"JavaScript\")'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.json`), textEncoder.encode('{ \"json\": true }'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.ts`), textEncoder.encode('console.log(\"TypeScript\")'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.css`), textEncoder.encode('* { color: green; }'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.md`), textEncoder.encode(debuggableFile), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.xml`), textEncoder.encode(''), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.py`), textEncoder.encode('import base64, sys; base64.decode(open(sys.argv[1], \"rb\"), open(sys.argv[2], \"wb\"))'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.yaml`), textEncoder.encode('- just: write something'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.jpg`), getImageFile(), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/file.php`), textEncoder.encode(''), { create: true, overwrite: true });\n\n\t\t// some more files & folders\n\t\tthis.createDirectory(Uri.parse(`memfs:/sample-folder/folder/`));\n\t\tthis.createDirectory(Uri.parse(`memfs:/sample-folder/workspaces/`));\n\t\tthis.createDirectory(Uri.parse(`memfs:/sample-folder/large/`));\n\t\tthis.createDirectory(Uri.parse(`memfs:/sample-folder/xyz/`));\n\t\tthis.createDirectory(Uri.parse(`memfs:/sample-folder/xyz/abc`));\n\t\tthis.createDirectory(Uri.parse(`memfs:/sample-folder/xyz/def`));\n\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/folder/empty.txt`), new Uint8Array(0), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/folder/empty.foo`), new Uint8Array(0), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/folder/file.ts`), textEncoder.encode('let a:number = true; console.log(a);'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/large/rnd.foo`), randomData(50000), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/xyz/UPPER.txt`), textEncoder.encode('UPPER'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/xyz/upper.txt`), textEncoder.encode('upper'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/xyz/def/foo.md`), textEncoder.encode('*MemFS*'), { create: true, overwrite: true });\n\t\tthis.writeFile(Uri.parse(`memfs:/sample-folder/workspaces/mem.code-workspace`), textEncoder.encode(JSON.stringify({\n\t\t\t\"folders\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"sample-folder-large\",\n\t\t\t\t\t\"uri\": \"memfs:/sample-folder/large\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"sample-folder-xyz\",\n\t\t\t\t\t\"uri\": \"memfs:/sample-folder/xyz\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"sample-folder-folder\",\n\t\t\t\t\t\"uri\": \"memfs:/sample-folder/folder\"\n\t\t\t\t}\n\t\t\t]\n\t\t}, undefined, '\\t')), { create: true, overwrite: true });\n\n\t\t// some files in different encodings\n\t\tthis.createDirectory(Uri.parse(`memfs:/sample-folder/encodings/`));\n\t\tthis.writeFile(\n\t\t\tUri.parse(`memfs:/sample-folder/encodings/windows1251.txt`),\n\t\t\twindows1251File,\n\t\t\t{ create: true, overwrite: true }\n\t\t);\n\t\tthis.writeFile(\n\t\t\tUri.parse(`memfs:/sample-folder/encodings/gbk.txt`),\n\t\t\tgbkFile,\n\t\t\t{ create: true, overwrite: true }\n\t\t);\n\t}\n\n\troot = new Directory(Uri.parse('memfs:/'), '');\n\n\t// --- manage file metadata\n\n\tstat(uri: Uri): FileStat {\n\t\treturn this._lookup(uri, false);\n\t}\n\n\treadDirectory(uri: Uri): [string, FileType][] {\n\t\tconst entry = this._lookupAsDirectory(uri, false);\n\t\tlet result: [string, FileType][] = [];\n\t\tfor (const [name, child] of entry.entries) {\n\t\t\tresult.push([name, child.type]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t// --- manage file contents\n\n\treadFile(uri: Uri): Uint8Array {\n\t\tconst data = this._lookupAsFile(uri, false).data;\n\t\tif (data) {\n\t\t\treturn data;\n\t\t}\n\t\tthrow FileSystemError.FileNotFound();\n\t}\n\n\twriteFile(uri: Uri, content: Uint8Array, options: { create: boolean, overwrite: boolean }): void {\n\t\tlet basename = this._basename(uri.path);\n\t\tlet parent = this._lookupParentDirectory(uri);\n\t\tlet entry = parent.entries.get(basename);\n\t\tif (entry instanceof Directory) {\n\t\t\tthrow FileSystemError.FileIsADirectory(uri);\n\t\t}\n\t\tif (!entry && !options.create) {\n\t\t\tthrow FileSystemError.FileNotFound(uri);\n\t\t}\n\t\tif (entry && options.create && !options.overwrite) {\n\t\t\tthrow FileSystemError.FileExists(uri);\n\t\t}\n\t\tif (!entry) {\n\t\t\tentry = new File(uri, basename);\n\t\t\tparent.entries.set(basename, entry);\n\t\t\tthis._fireSoon({ type: FileChangeType.Created, uri });\n\t\t}\n\t\tentry.mtime = Date.now();\n\t\tentry.size = content.byteLength;\n\t\tentry.data = content;\n\n\t\tthis._fireSoon({ type: FileChangeType.Changed, uri });\n\t}\n\n\t// --- manage files/folders\n\n\trename(oldUri: Uri, newUri: Uri, options: { overwrite: boolean }): void {\n\t\tif (!options.overwrite && this._lookup(newUri, true)) {\n\t\t\tthrow FileSystemError.FileExists(newUri);\n\t\t}\n\n\t\tlet entry = this._lookup(oldUri, false);\n\t\tlet oldParent = this._lookupParentDirectory(oldUri);\n\n\t\tlet newParent = this._lookupParentDirectory(newUri);\n\t\tlet newName = this._basename(newUri.path);\n\n\t\toldParent.entries.delete(entry.name);\n\t\tentry.name = newName;\n\t\tnewParent.entries.set(newName, entry);\n\n\t\tthis._fireSoon(\n\t\t\t{ type: FileChangeType.Deleted, uri: oldUri },\n\t\t\t{ type: FileChangeType.Created, uri: newUri }\n\t\t);\n\t}\n\n\tdelete(uri: Uri): void {\n\t\tlet dirname = uri.with({ path: this._dirname(uri.path) });\n\t\tlet basename = this._basename(uri.path);\n\t\tlet parent = this._lookupAsDirectory(dirname, false);\n\t\tif (!parent.entries.has(basename)) {\n\t\t\tthrow FileSystemError.FileNotFound(uri);\n\t\t}\n\t\tparent.entries.delete(basename);\n\t\tparent.mtime = Date.now();\n\t\tparent.size -= 1;\n\t\tthis._fireSoon({ type: FileChangeType.Changed, uri: dirname }, { uri, type: FileChangeType.Deleted });\n\t}\n\n\tcreateDirectory(uri: Uri): void {\n\t\tlet basename = this._basename(uri.path);\n\t\tlet dirname = uri.with({ path: this._dirname(uri.path) });\n\t\tlet parent = this._lookupAsDirectory(dirname, false);\n\n\t\tlet entry = new Directory(uri, basename);\n\t\tparent.entries.set(entry.name, entry);\n\t\tparent.mtime = Date.now();\n\t\tparent.size += 1;\n\t\tthis._fireSoon({ type: FileChangeType.Changed, uri: dirname }, { type: FileChangeType.Created, uri });\n\t}\n\n\t// --- lookup\n\n\tprivate _lookup(uri: Uri, silent: false): Entry;\n\tprivate _lookup(uri: Uri, silent: boolean): Entry | undefined;\n\tprivate _lookup(uri: Uri, silent: boolean): Entry | undefined {\n\t\tlet parts = uri.path.split('/');\n\t\tlet entry: Entry = this.root;\n\t\tfor (const part of parts) {\n\t\t\tif (!part) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet child: Entry | undefined;\n\t\t\tif (entry instanceof Directory) {\n\t\t\t\tchild = entry.entries.get(part);\n\t\t\t}\n\t\t\tif (!child) {\n\t\t\t\tif (!silent) {\n\t\t\t\t\tthrow FileSystemError.FileNotFound(uri);\n\t\t\t\t} else {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t\tentry = child;\n\t\t}\n\t\treturn entry;\n\t}\n\n\tprivate _lookupAsDirectory(uri: Uri, silent: boolean): Directory {\n\t\tlet entry = this._lookup(uri, silent);\n\t\tif (entry instanceof Directory) {\n\t\t\treturn entry;\n\t\t}\n\t\tthrow FileSystemError.FileNotADirectory(uri);\n\t}\n\n\tprivate _lookupAsFile(uri: Uri, silent: boolean): File {\n\t\tlet entry = this._lookup(uri, silent);\n\t\tif (entry instanceof File) {\n\t\t\treturn entry;\n\t\t}\n\t\tthrow FileSystemError.FileIsADirectory(uri);\n\t}\n\n\tprivate _lookupParentDirectory(uri: Uri): Directory {\n\t\tconst dirname = uri.with({ path: this._dirname(uri.path) });\n\t\treturn this._lookupAsDirectory(dirname, false);\n\t}\n\n\t// --- manage file events\n\n\tprivate _emitter = new EventEmitter();\n\tprivate _bufferedEvents: FileChangeEvent[] = [];\n\tprivate _fireSoonHandle?: any;\n\n\treadonly onDidChangeFile: Event = this._emitter.event;\n\n\twatch(_resource: Uri): Disposable {\n\t\t// ignore, fires for all changes...\n\t\treturn new Disposable(() => { });\n\t}\n\n\tprivate _fireSoon(...events: FileChangeEvent[]): void {\n\t\tthis._bufferedEvents.push(...events);\n\n\t\tif (this._fireSoonHandle) {\n\t\t\tclearTimeout(this._fireSoonHandle);\n\t\t}\n\n\t\tthis._fireSoonHandle = setTimeout(() => {\n\t\t\tthis._emitter.fire(this._bufferedEvents);\n\t\t\tthis._bufferedEvents.length = 0;\n\t\t}, 5);\n\t}\n\n\t// --- path utils\n\n\tprivate _basename(path: string): string {\n\t\tpath = this._rtrim(path, '/');\n\t\tif (!path) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn path.substr(path.lastIndexOf('/') + 1);\n\t}\n\n\tprivate _dirname(path: string): string {\n\t\tpath = this._rtrim(path, '/');\n\t\tif (!path) {\n\t\t\treturn '/';\n\t\t}\n\n\t\treturn path.substr(0, path.lastIndexOf('/'));\n\t}\n\n\tprivate _rtrim(haystack: string, needle: string): string {\n\t\tif (!haystack || !needle) {\n\t\t\treturn haystack;\n\t\t}\n\n\t\tconst needleLen = needle.length,\n\t\t\thaystackLen = haystack.length;\n\n\t\tif (needleLen === 0 || haystackLen === 0) {\n\t\t\treturn haystack;\n\t\t}\n\n\t\tlet offset = haystackLen,\n\t\t\tidx = -1;\n\n\t\twhile (true) {\n\t\t\tidx = haystack.lastIndexOf(needle, offset - 1);\n\t\t\tif (idx === -1 || idx + needleLen !== offset) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (idx === 0) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\toffset = idx;\n\t\t}\n\n\t\treturn haystack.substring(0, offset);\n\t}\n\n\tprivate _getFiles(): Set {\n\t\tconst files = new Set();\n\n\t\tthis._doGetFiles(this.root, files);\n\n\t\treturn files;\n\t}\n\n\tprivate _doGetFiles(dir: Directory, files: Set): void {\n\t\tdir.entries.forEach(entry => {\n\t\t\tif (entry instanceof File) {\n\t\t\t\tfiles.add(entry);\n\t\t\t} else {\n\t\t\t\tthis._doGetFiles(entry, files);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _convertSimple2RegExpPattern(pattern: string): string {\n\t\treturn pattern.replace(/[\\-\\\\\\{\\}\\+\\?\\|\\^\\$\\.\\,\\[\\]\\(\\)\\#\\s]/g, '\\\\$&').replace(/[\\*]/g, '.*');\n\t}\n\n\t// --- search provider\n\n\tprovideFileSearchResults(query: FileSearchQuery, _options: FileSearchOptions, _token: CancellationToken): ProviderResult {\n\t\treturn this._findFiles(query.pattern);\n\t}\n\n\tprivate _findFiles(query: string | undefined): Uri[] {\n\t\tconst files = this._getFiles();\n\t\tconst result: Uri[] = [];\n\n\t\tconst pattern = query ? new RegExp(this._convertSimple2RegExpPattern(query)) : null;\n\n\t\tfor (const file of files) {\n\t\t\tif (!pattern || pattern.exec(file.name)) {\n\t\t\t\tresult.push(file.uri);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _textDecoder = new TextDecoder();\n\n\tprovideTextSearchResults(query: TextSearchQuery, options: TextSearchOptions, progress: Progress, _token: CancellationToken) {\n\t\tconst result: TextSearchComplete = { limitHit: false };\n\n\t\tconst files = this._findFiles(options.includes[0]);\n\t\tif (files) {\n\t\t\tfor (const file of files) {\n\t\t\t\tconst content = this._textDecoder.decode(this.readFile(file));\n\n\t\t\t\tconst lines = content.split('\\n');\n\t\t\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\t\t\tconst line = lines[i];\n\t\t\t\t\tconst index = line.indexOf(query.pattern);\n\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\tprogress.report({\n\t\t\t\t\t\t\turi: file,\n\t\t\t\t\t\t\tranges: new Range(new Position(i, index), new Position(i, index + query.pattern.length)),\n\t\t\t\t\t\t\tpreview: {\n\t\t\t\t\t\t\t\ttext: line,\n\t\t\t\t\t\t\t\tmatches: new Range(new Position(0, index), new Position(0, index + query.pattern.length))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\nfunction randomData(lineCnt: number, lineLen = 155): Uint8Array {\n\tlet lines: string[] = [];\n\tfor (let i = 0; i < lineCnt; i++) {\n\t\tlet line = '';\n\t\twhile (line.length < lineLen) {\n\t\t\tline += Math.random().toString(2 + (i % 34)).substr(2);\n\t\t}\n\t\tlines.push(line.substr(0, lineLen));\n\t}\n\treturn textEncoder.encode(lines.join('\\n'));\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nexport const largeTSFile = `/// \n/// \n\nmodule Mankala {\nexport var storeHouses = [6,13];\nexport var svgNS = 'http://www.w3.org/2000/svg';\n\nfunction createSVGRect(r:Rectangle) {\n\tvar rect = document.createElementNS(svgNS,'rect');\n\trect.setAttribute('x', r.x.toString());\n\trect.setAttribute('y', r.y.toString());\n\trect.setAttribute('width', r.width.toString());\n\trect.setAttribute('height', r.height.toString());\n\treturn rect;\n}\n\nfunction createSVGEllipse(r:Rectangle) {\n\tvar ell = document.createElementNS(svgNS,'ellipse');\n\tell.setAttribute('rx',(r.width/2).toString());\n\tell.setAttribute('ry',(r.height/2).toString());\n\tell.setAttribute('cx',(r.x+r.width/2).toString());\n\tell.setAttribute('cy',(r.y+r.height/2).toString());\n\treturn ell;\n}\n\nfunction createSVGEllipsePolar(angle:number,radius:number,tx:number,ty:number,cxo:number,cyo:number) {\n\tvar ell = document.createElementNS(svgNS,'ellipse');\n\tell.setAttribute('rx',radius.toString());\n\tell.setAttribute('ry',(radius/3).toString());\n\tell.setAttribute('cx',cxo.toString());\n\tell.setAttribute('cy',cyo.toString());\n\tvar dangle = angle*(180/Math.PI);\n\tell.setAttribute('transform','rotate('+dangle+','+cxo+','+cyo+') translate('+tx+','+ty+')');\n\treturn ell;\n}\n\nfunction createSVGInscribedCircle(sq:Square) {\n\tvar circle = document.createElementNS(svgNS,'circle');\n\tcircle.setAttribute('r',(sq.length/2).toString());\n\tcircle.setAttribute('cx',(sq.x+(sq.length/2)).toString());\n\tcircle.setAttribute('cy',(sq.y+(sq.length/2)).toString());\n\treturn circle;\n}\n\nexport class Position {\n\n\tseedCounts:number[];\n\tstartMove:number;\n\tturn:number;\n\n\tconstructor(seedCounts:number[],startMove:number,turn:number) {\n\t\tthis.seedCounts = seedCounts;\n\t\tthis.startMove = startMove;\n\t\tthis.turn = turn;\n\t}\n\n\tscore() {\n\t\tvar baseScore = this.seedCounts[storeHouses[1-this.turn]]-this.seedCounts[storeHouses[this.turn]];\n\t\tvar otherSpaces = homeSpaces[this.turn];\n\t\tvar sum = 0;\n\t\tfor (var k = 0,len = otherSpaces.length;k0) {\n\t\t\tfeatures.clear();\n\t\t\tvar len = this.seedCounts.length;\n\t\t\tfor (var i = 0;i0) {\n\t\t\t\tif (nextSpace==storeHouses[this.turn]) {\n\t\t\t\t\tfeatures.seedStoredCount++;\n\t\t\t\t}\n\t\t\t\tif ((nextSpace!=storeHouses[1-this.turn])) {\n\t\t\t\t\tnextSeedCounts[nextSpace]++;\n\t\t\t\t\tseedCount--;\n\t\t\t\t}\n\t\t\t\tif (seedCount==0) {\n\t\t\t\t\tif (nextSpace==storeHouses[this.turn]) {\n\t\t\t\t\t\tfeatures.turnContinues = true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ((nextSeedCounts[nextSpace]==1)&&\n\t\t\t\t\t\t\t(nextSpace>=firstHomeSpace[this.turn])&&\n\t\t\t\t\t\t\t(nextSpace<=lastHomeSpace[this.turn])) {\n\t\t\t\t\t\t\t// capture\n\t\t\t\t\t\t\tvar capturedSpace = capturedSpaces[nextSpace];\n\t\t\t\t\t\t\tif (capturedSpace>=0) {\n\t\t\t\t\t\t\t\tfeatures.spaceCaptured = capturedSpace;\n\t\t\t\t\t\t\t\tfeatures.capturedCount = nextSeedCounts[capturedSpace];\n\t\t\t\t\t\t\t\tnextSeedCounts[capturedSpace] = 0;\n\t\t\t\t\t\t\t\tnextSeedCounts[storeHouses[this.turn]] += features.capturedCount;\n\t\t\t\t\t\t\t\tfeatures.seedStoredCount += nextSeedCounts[capturedSpace];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextSpace = (nextSpace+1)%14;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\nexport class SeedCoords {\n\ttx:number;\n\tty:number;\n\tangle:number;\n\n\tconstructor(tx:number, ty:number, angle:number) {\n\t\tthis.tx = tx;\n\t\tthis.ty = ty;\n\t\tthis.angle = angle;\n\t}\n}\n\nexport class DisplayPosition extends Position {\n\n\tconfig:SeedCoords[][];\n\n\tconstructor(seedCounts:number[],startMove:number,turn:number) {\n\t\tsuper(seedCounts,startMove,turn);\n\n\t\tthis.config = [];\n\n\t\tfor (var i = 0;i();\n\t\t}\n\t}\n\n\n\tseedCircleRect(rect:Rectangle,seedCount:number,board:Element,seed:number) {\n\t\tvar coords = this.config[seed];\n\t\tvar sq = rect.inner(0.95).square();\n\t\tvar cxo = (sq.width/2)+sq.x;\n\t\tvar cyo = (sq.height/2)+sq.y;\n\t\tvar seedNumbers = [5,7,9,11];\n\t\tvar ringIndex = 0;\n\t\tvar ringRem = seedNumbers[ringIndex];\n\t\tvar angleDelta = (2*Math.PI)/ringRem;\n\t\tvar angle = angleDelta;\n\t\tvar seedLength = sq.width/(seedNumbers.length<<1);\n\t\tvar crMax = sq.width/2-(seedLength/2);\n\t\tvar pit = createSVGInscribedCircle(sq);\n\t\tif (seed<7) {\n\t\t\tpit.setAttribute('fill','brown');\n\t\t}\n\t\telse {\n\t\t\tpit.setAttribute('fill','saddlebrown');\n\t\t}\n\t\tboard.appendChild(pit);\n\t\tvar seedsSeen = 0;\n\t\twhile (seedCount > 0) {\n\t\t\tif (ringRem == 0) {\n\t\t\t\tringIndex++;\n\t\t\t\tringRem = seedNumbers[ringIndex];\n\t\t\t\tangleDelta = (2*Math.PI)/ringRem;\n\t\t\t\tangle = angleDelta;\n\t\t\t}\n\t\t\tvar tx:number;\n\t\t\tvar ty:number;\n\t\t\tvar tangle = angle;\n\t\t\tif (coords.length>seedsSeen) {\n\t\t\t\ttx = coords[seedsSeen].tx;\n\t\t\t\tty = coords[seedsSeen].ty;\n\t\t\t\ttangle = coords[seedsSeen].angle;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttx = (Math.random()*crMax)-(crMax/3);\n\t\t\t\tty = (Math.random()*crMax)-(crMax/3);\n\t\t\t\tcoords[seedsSeen] = new SeedCoords(tx,ty,angle);\n\t\t\t}\n\t\t\tvar ell = createSVGEllipsePolar(tangle,seedLength,tx,ty,cxo,cyo);\n\t\t\tboard.appendChild(ell);\n\t\t\tangle += angleDelta;\n\t\t\tringRem--;\n\t\t\tseedCount--;\n\t\t\tseedsSeen++;\n\t\t}\n\t}\n\n\ttoCircleSVG() {\n\t\tvar seedDivisions = 14;\n\t\tvar board = document.createElementNS(svgNS,'svg');\n\t\tvar boardRect = new Rectangle(0,0,1800,800);\n\t\tboard.setAttribute('width','1800');\n\t\tboard.setAttribute('height','800');\n\t\tvar whole = createSVGRect(boardRect);\n\t\twhole.setAttribute('fill','tan');\n\t\tboard.appendChild(whole);\n\t\tvar labPlayLab = boardRect.proportionalSplitVert(20,760,20);\n\t\tvar playSurface = labPlayLab[1];\n\t\tvar storeMainStore = playSurface.proportionalSplitHoriz(8,48,8);\n\t\tvar mainPair = storeMainStore[1].subDivideVert(2);\n\t\tvar playerRects = [mainPair[0].subDivideHoriz(6), mainPair[1].subDivideHoriz(6)];\n\t\t// reverse top layer because storehouse on left\n\t\tfor (var k = 0;k<3;k++) {\n\t\t\tvar temp = playerRects[0][k];\n\t\t\tplayerRects[0][k] = playerRects[0][5-k];\n\t\t\tplayerRects[0][5-k] = temp;\n\t\t}\n\t\tvar storehouses = [storeMainStore[0],storeMainStore[2]];\n\t\tvar playerSeeds = this.seedCounts.length>>1;\n\t\tfor (var i = 0;i<2;i++) {\n\t\t\tvar player = playerRects[i];\n\t\t\tvar storehouse = storehouses[i];\n\t\t\tvar r:Rectangle;\n\t\t\tfor (var j = 0;j();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn board;\n\t}\n}\n}\n`;\n\nexport const debuggableFile = `# VS Code Mock Debug\n\nThis is a starter sample for developing VS Code debug adapters.\n\n**Mock Debug** simulates a debug adapter for Visual Studio Code.\nIt supports *step*, *continue*, *breakpoints*, *exceptions*, and\n*variable access* but it is not connected to any real debugger.\n\nThe sample is meant as an educational piece showing how to implement a debug\nadapter for VS Code. It can be used as a starting point for developing a real adapter.\n\nMore information about how to develop a new debug adapter can be found\n[here](https://code.visualstudio.com/docs/extensions/example-debuggers).\nOr discuss debug adapters on Gitter:\n[![Gitter Chat](https://img.shields.io/badge/chat-online-brightgreen.svg)](https://gitter.im/Microsoft/vscode)\n\n## Using Mock Debug\n\n* Install the **Mock Debug** extension in VS Code.\n* Create a new 'program' file 'readme.md' and enter several lines of arbitrary text.\n* Switch to the debug viewlet and press the gear dropdown.\n* Select the debug environment \"Mock Debug\".\n* Press the green 'play' button to start debugging.\n\nYou can now 'step through' the 'readme.md' file, set and hit breakpoints, and run into exceptions (if the word exception appears in a line).\n\n![Mock Debug](file.jpg)\n\n## Build and Run\n\n[![build status](https://travis-ci.org/Microsoft/vscode-mock-debug.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-mock-debug)\n[![build status](https://ci.appveyor.com/api/projects/status/empmw5q1tk6h1fly/branch/master?svg=true)](https://ci.appveyor.com/project/weinand/vscode-mock-debug)\n\n\n* Clone the project [https://github.com/Microsoft/vscode-mock-debug.git](https://github.com/Microsoft/vscode-mock-debug.git)\n* Open the project folder in VS Code.\n* Press 'F5' to build and launch Mock Debug in another VS Code window. In that window:\n* Open a new workspace, create a new 'program' file 'readme.md' and enter several lines of arbitrary text.\n* Switch to the debug viewlet and press the gear dropdown.\n* Select the debug environment \"Mock Debug\".\n* Press 'F5' to start debugging.`;\n\nexport function getImageFile(): Uint8Array {\n\tconst data = atob(`/9j/4AAQSkZJRgABAQAASABIAAD/2wCEAA4ODg4ODhcODhchFxcXIS0hISEhLTktLS0tLTlFOTk5OTk5RUVFRUVFRUVSUlJSUlJgYGBgYGxsbGxsbGxsbGwBERISGxkbLxkZL3FMP0xxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcf/AABEIAFYAZAMBIgACEQEDEQH/xAB1AAACAwEBAQAAAAAAAAAAAAAABAMFBgIBBxAAAgIBAwMCBQQCAwAAAAAAAQIAAxEEBSESMUFRcRMiIzJhFIGRoQbBQlKxAQEBAQEAAAAAAAAAAAAAAAABAgADEQEBAQADAQEAAAAAAAAAAAAAARESITECQf/aAAwDAQACEQMRAD8A2LEZkLc/bKxbdYEHWoyfEze56zXpqRTTYUyPHiVrY2TVZyMzhFZMg8iYE6jcVXAusY98KMnj2lhRu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xx0V4wQeZgynxrUXoUnIif629GJY595cptr1N9XJYjOfEi1G3LYMLgH1m04qxelrAtnj/qZYIvUPpMcHwYtTT8FzVaMN6+sslqVF6gcQ1sRivPccwjS314+bGYRBnqzws6FhUfL7CQ8gdI7+TDIHHgcSVGBYRznMXfUL2J5ngPUOYCpfM2tiq1tnUpVRnMe0DGtAKyQIw+mU4GJCKmrPy+I6V0lxYYIzxOCtdjZyVIMRqtPsYx8RT37+sdRhsFlHzcyC0J0kmcfqFX5cxC7VAk4OPUQtM+UVtYf7vH8iKP8SnKg5U9xHQwsGV7jxF9QnWACMEcgwlUjT4ZUE+YRRLGRehwciEpLRMAAT6SALlIQkF4kl7HEIQLwuQfac9RPeEJi5H3TruvvmEJo1QOcgGQuvVg+sITM8rDKeDHVItXkQhKgqM6esnJEIQlJf//Z`);\n\treturn Uint8Array.from([...data].map(x => x.charCodeAt(0)));\n}\n\n// encoded from 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя'\nexport const windows1251File = Uint8Array.from([192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255]);\n\n// encoded from '中国abc'\nexport const gbkFile = Uint8Array.from([214, 208, 185, 250, 97, 98, 99]);\n"],"sourceRoot":""} --------------------------------------------------------------------------------