{"_id":"vscode-textbuffer","_rev":"246116","name":"vscode-textbuffer","description":"The underling text buffer used in VS Code/Monaco","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"rebornix","email":"penn.lv@gmail.com"}],"time":{"modified":"2021-06-03T16:03:48.000Z","created":"2019-06-03T18:36:38.350Z","1.0.0":"2019-06-03T18:36:38.350Z"},"users":{},"author":{"name":"rebornix"},"repository":{"type":"git","url":"git+https://github.com/microsoft/vscode-textbuffer.git"},"versions":{"1.0.0":{"name":"vscode-textbuffer","version":"1.0.0","description":"The underling text buffer used in VS Code/Monaco","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"start":"npm run build && npm run watch","build":"tsc","watch":"tsc -w","pretest":"npm run build","test":"jest --forceExit","fasttest":"jest --forceExit"},"repository":{"type":"git","url":"git+https://github.com/microsoft/vscode-textbuffer.git"},"author":{"name":"rebornix"},"license":"MIT","bugs":{"url":"https://github.com/microsoft/vscode-textbuffer/issues"},"homepage":"httpshttps://github.com/microsoft/vscode-textbuffer#readme","devDependencies":{"@types/jest":"^24.0.13","jest":"^24.8.0","ts-jest":"^24.0.2","typescript":"^3.4.2"},"gitHead":"7bdc47d2ebaa66a1c4fab2c916e8c32ccabb8e3a","_id":"vscode-textbuffer@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"rebornix","email":"penn.lv@gmail.com"},"dist":{"shasum":"1faee638c8e0e4131c8d5c353993a1874acda086","size":42124,"noattachment":false,"key":"/vscode-textbuffer/-/vscode-textbuffer-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/vscode-textbuffer/download/vscode-textbuffer-1.0.0.tgz"},"maintainers":[{"name":"rebornix","email":"penn.lv@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vscode-textbuffer_1.0.0_1559586998155_0.6500788174895837"},"_hasShrinkwrap":false,"publish_time":1559586998350,"_cnpm_publish_time":1559586998350}},"readme":"# vscode-textbuffer\r\n\r\nThe underling text buffer used in VS Code/Monaco. For detailed architecture behind it, please read [Text Buffer Reimplementation](https://code.visualstudio.com/blogs/2018/03/23/text-buffer-reimplementation).\r\n\r\n```shell\r\nnpm install vscode-textbuffer\r\n```\r\n\r\n## API\r\n\r\n```typescript\r\nconst pieceTreeTextBufferBuilder = new PieceTreeTextBufferBuilder();\r\npieceTreeTextBufferBuilder.acceptChunk('abc\\n');\r\npieceTreeTextBufferBuilder.acceptChunk('def');\r\nconst pieceTreeFactory = pieceTreeTextBufferBuilder.finish(true);\r\nconst pieceTree = pieceTreeFactory.create(DefaultEndOfLine.LF);\r\n\r\npieceTree.getLineCount(); // 2\r\npieceTree.getLineContent(1); // 'abc'\r\npieceTree.getLineContent(2); // 'def'\r\n\r\npieceTree.insert(1, '+');\r\npieceTree.getLineCount(); // 2\r\npieceTree.getLineContent(1); // 'a+bc'\r\npieceTree.getLineContent(2); // 'def'\r\n```\r\n\r\n# Contributing\r\n\r\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\r\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\r\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\r\n\r\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\r\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\r\nprovided by the bot. You will only need to do this once across all repos using our CLA.\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\r\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n","_attachments":{},"homepage":"httpshttps://github.com/microsoft/vscode-textbuffer#readme","bugs":{"url":"https://github.com/microsoft/vscode-textbuffer/issues"},"license":"MIT"}