removed .vscode directory
24
.vscode/argv.json
vendored
|
|
@ -1,24 +0,0 @@
|
|||
// This configuration file allows you to pass permanent command line arguments to VS Code.
|
||||
// Only a subset of arguments is currently supported to reduce the likelihood of breaking
|
||||
// the installation.
|
||||
//
|
||||
// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT
|
||||
//
|
||||
// NOTE: Changing this file requires a restart of VS Code.
|
||||
{
|
||||
// Use software rendering instead of hardware accelerated rendering.
|
||||
// This can help in cases where you see rendering issues in VS Code.
|
||||
// "disable-hardware-acceleration": true,
|
||||
|
||||
// Enabled by default by VS Code to resolve color issues in the renderer
|
||||
// See https://github.com/microsoft/vscode/issues/51791 for details
|
||||
"disable-color-correct-rendering": true,
|
||||
|
||||
// Allows to disable crash reporting.
|
||||
// Should restart the app if the value is changed.
|
||||
"enable-crash-reporter": true,
|
||||
|
||||
// Unique id used for correlating crash reports sent from this instance.
|
||||
// Do not edit this value.
|
||||
"crash-reporter-id": "259d1e94-1ea1-4dcf-8193-0be07efab62d"
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
_
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2017-present Arctic Ice Studio <development@arcticicestudio.com>
|
||||
# Copyright (C) 2017-present Sven Greb <development@svengreb.de>
|
||||
#
|
||||
# Project: Nord Visual Studio Code
|
||||
# Repository: https://github.com/arcticicestudio/nord-visual-studio-code
|
||||
# License: MIT
|
||||
|
||||
# Git "pre-commit" hook for husky.
|
||||
#
|
||||
# References:
|
||||
# 1. https://github.com/typicode/husky
|
||||
# 2. https://git-scm.com/docs/githooks#_pre_commit
|
||||
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npm exec lint-staged
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||
<Metadata>
|
||||
<Identity Language="en-US" Id="nord-visual-studio-code" Version="0.19.0" Publisher="arcticicestudio" />
|
||||
<DisplayName>Nord</DisplayName>
|
||||
<Description xml:space="preserve">An arctic, north-bluish clean and elegant Visual Studio Code theme.</Description>
|
||||
<Tags>arctic,north,bluish,clean,elegant,theme,color-theme,__web_extension</Tags>
|
||||
<Categories>Themes</Categories>
|
||||
<GalleryFlags>Public</GalleryFlags>
|
||||
<Badges><Badge Link="https://marketplace.visualstudio.com/items/arcticicestudio.nord-visual-studio-code" ImgUri="https://vsmarketplacebadge.apphb.com/version/arcticicestudio.nord-visual-studio-code.svg" Description="Extension version" /><Badge Link="https://marketplace.visualstudio.com/items/arcticicestudio.nord-visual-studio-code" ImgUri="https://vsmarketplacebadge.apphb.com/installs/arcticicestudio.nord-visual-studio-code.svg" Description="Extension installs" /><Badge Link="https://marketplace.visualstudio.com/items/arcticicestudio.nord-visual-studio-code" ImgUri="https://vsmarketplacebadge.apphb.com/rating/arcticicestudio.nord-visual-studio-code.svg" Description="Extension Rating" /></Badges>
|
||||
<Properties>
|
||||
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.12.0" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="ui,workspace,web" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/arcticicestudio/nord-visual-studio-code.git" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/arcticicestudio/nord-visual-studio-code.git" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/arcticicestudio/nord-visual-studio-code.git" />
|
||||
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Support" Value="https://github.com/arcticicestudio/nord-visual-studio-code/issues" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Learn" Value="https://github.com/arcticicestudio/nord-visual-studio-code" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Branding.Color" Value="#2E3440" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Branding.Theme" Value="dark" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" />
|
||||
|
||||
|
||||
|
||||
</Properties>
|
||||
<License>extension/LICENSE.txt</License>
|
||||
<Icon>extension/assets/extension-marketplace-icon.png</Icon>
|
||||
</Metadata>
|
||||
<Installation>
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
|
||||
</Installation>
|
||||
<Dependencies/>
|
||||
<Assets>
|
||||
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
|
||||
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.Changelog" Path="extension/CHANGELOG.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.License" Path="extension/LICENSE.txt" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Icons.Default" Path="extension/assets/extension-marketplace-icon.png" Addressable="true" />
|
||||
</Assets>
|
||||
</PackageManifest>
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
MIT License (MIT)
|
||||
|
||||
Copyright (C) 2017-present Arctic Ice Studio <development@arcticicestudio.com> (https://www.arcticicestudio.com)
|
||||
Copyright (C) 2017-present Sven Greb <development@svengreb.de> (https://www.svengreb.de)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
<p align="center"><a href="https://www.nordtheme.com/ports/visual-studio-code" target="_blank"><img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/develop/assets/images/ports/visual-studio-code/repository-hero.png" srcset="https://raw.githubusercontent.com/arcticicestudio/nord-docs/develop/assets/images/ports/visual-studio-code/repository-hero-2x.png 2x"/></a></p>
|
||||
|
||||
<p align="center"><a href="https://github.com/arcticicestudio/nord-visual-studio-code/releases/latest" target="_blank"><img src="https://img.shields.io/github/release/arcticicestudio/nord-visual-studio-code.svg?style=flat-square&label=Release&logo=github&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/></a> <a href="https://www.nordtheme.com/docs/ports/visual-studio-code" target="_blank"><img src="https://img.shields.io/github/release/arcticicestudio/nord-visual-studio-code.svg?style=flat-square&label=Docs&colorA=4c566a&colorB=88c0d0&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI%2BCiAgICA8cGF0aCBmaWxsPSIjZDhkZWU5IiBkPSJNMTMuNzQ2IDIuODEzYS42Ny42NyAwIDAgMC0uNTU5LS4xMzNMOCAzLjg0OGwtNS4xODgtMS4xOGEuNjY5LjY2OSAwIDAgMC0uNTcuMTMzLjY3Ny42NzcgMCAwIDAtLjI0Mi41MzF2OC4xMzNjLS4wMDguMzIuMjEuNTk4LjUyLjY2OGw1LjMzMiAxLjE5OWguMjk2bDUuMzMyLTEuMmEuNjY4LjY2OCAwIDAgMCAuNTItLjY2N1YzLjMzMmEuNjU5LjY1OSAwIDAgMC0uMjU0LS41MnpNMy4zMzIgNC4xNjhsNCAuODk4djYuNzY2bC00LS44OTh6bTkuMzM2IDYuNzY2bC00IC44OThWNS4wNjZsNC0uODk4em0wIDAiLz4KPC9zdmc%2BCg%3D%3D"/></a> <a href="https://github.com/arcticicestudio/nord-visual-studio-code/blob/develop/CHANGELOG.md" target="_blank"><img src="https://img.shields.io/github/release/arcticicestudio/nord-visual-studio-code.svg?style=flat-square&label=Changelog&logo=github&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/></a></p>
|
||||
|
||||
<p align="center"><a href="https://marketplace.visualstudio.com/items/arcticicestudio.nord-visual-studio-code" target="_blank"><img src="https://vsmarketplacebadge.apphb.com/version/arcticicestudio.nord-visual-studio-code.svg?style=flat-square&label=Extension%20Marketplace&logo=visual-studio-code&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/></a> <a href="https://marketplace.visualstudio.com/items/arcticicestudio.nord-visual-studio-code" target="_blank"><img src="https://vsmarketplacebadge.apphb.com/installs/arcticicestudio.nord-visual-studio-code.svg?style=flat-square&label=Installations&logo=visual-studio-code&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/></a> <a href="https://marketplace.visualstudio.com/items/arcticicestudio.nord-visual-studio-code" target="_blank"><img src="https://vsmarketplacebadge.apphb.com/rating-short/arcticicestudio.nord-visual-studio-code.svg?style=flat-square&label=Rating&logo=visual-studio-code&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/></a></p>
|
||||
|
||||
<p align="center"><a href="https://circleci.com/gh/arcticicestudio/nord-visual-studio-code" target="_blank"><img src="https://img.shields.io/circleci/project/github/arcticicestudio/nord-visual-studio-code/develop.svg?style=flat-square&label=Build&logo=circleci&logoColor=eceff4&colorA=4c566a"/></a> <a href="https://code.visualstudio.com/updates/v1_12" target="_blank"><img src="https://img.shields.io/static/v1.svg?style=flat-square&label=Compatibility&message=%3E%3D1.12.0&logo=visual-studio-code&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/></a></p>
|
||||
|
||||
<p align="center"><a href="https://github.com/arcticicestudio/styleguide-javascript/releases/latest" target="_blank"><img src="https://img.shields.io/github/release/arcticicestudio/styleguide-javascript.svg?style=flat-square&label=JavaScript%20Style%20Guide&logoColor=eceff4&colorA=4c566a&colorB=88c0d0&logo=javascript"/></a> <a href="https://github.com/arcticicestudio/styleguide-markdown/releases/latest" target="_blank"><img src="https://img.shields.io/github/release/arcticicestudio/styleguide-markdown.svg?style=flat-square&label=Markdown%20Style%20Guide&colorA=4c566a&colorB=88c0d0&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzOSIgaGVpZ2h0PSIzOSIgdmlld0JveD0iMCAwIDM5IDM5Ij48cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNEOERFRTkiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMS41IDEuNWgzNnYzNmgtMzZ6Ii8%2BPHBhdGggZmlsbD0iI0Q4REVFOSIgZD0iTTIwLjY4MyAyNS42NTVsNS44NzItMTMuNDhoLjU2Nmw1Ljg3MyAxMy40OGgtMS45OTZsLTQuMTU5LTEwLjA1Ni00LjE2MSAxMC4wNTZoLTEuOTk1em0tMi42OTYgMGwtMTMuNDgtNS44NzJ2LS41NjZsMTMuNDgtNS44NzJ2MS45OTVMNy45MzEgMTkuNWwxMC4wNTYgNC4xNnoiLz48L3N2Zz4%3D"/></a> <a href="https://github.com/arcticicestudio/styleguide-git/releases/latest" target="_blank"><img src="https://img.shields.io/github/release/arcticicestudio/styleguide-git.svg?style=flat-square&label=Git%20Style%20Guide&logoColor=eceff4&colorA=4c566a&colorB=88c0d0&logo=git"/></a></p>
|
||||
|
||||
<p align="center">An arctic, north-bluish clean and elegant <a href="https://code.visualstudio.com" target="_blank">Visual Studio Code</a> theme.</p>
|
||||
|
||||
<p align="center">Designed for a fluent and clear workflow based on the <a href="https://www.nordtheme.com" target="_blank">Nord</a> color palette.</p>
|
||||
|
||||
<p align="center"><a href="https://www.nordtheme.com/ports/visual-studio-code" target="_blank"><img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/develop/assets/images/ports/visual-studio-code/ui-overview-jsx.png"/></a></p>
|
||||
|
||||
## Getting Started
|
||||
|
||||
Visit the [official website][nord-home] to learn all about the [syntax highlighting][nord-home#syntax] features, details and elements of the [UI and editor elements][nord-home#editor-details] and the [one-click setup][nord-home#setup].
|
||||
|
||||
Learn about the [installation and activation][nord-docs-home-install], how to [customize][nord-docs-home-custom] and [develop][nord-docs-home-develop] the theme from the [official documentations][nord-docs-home].
|
||||
|
||||
### Quick Start
|
||||
|
||||
Thanks to the official [VS Code Extension Marketplace][vscode-extmarket-home], _Nord Visual Studio Code_ can be installed with one click.
|
||||
|
||||
Open the [extension marketplace][vscode-docs-extmarket] by clicking on the _Extensions_ icon in the [_Activity Bar_][vscode-docs-ui-actbar]. Search for `Nord` and click on the <kbd>Install</kbd> button.
|
||||
|
||||
<p align="center"><img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/develop/assets/images/ports/visual-studio-code/ui-extension-marketplace.png"/></p>
|
||||
|
||||
See Nord Visual Studio Code's documentation for details about more installation options like a [manual import through a local VSIX extension file][nord-docs-home-install#local].
|
||||
|
||||
#### Activation
|
||||
|
||||
To activate the theme click on the gear icon in the _Activity Bar_ and select _Color Theme_. Search for `Nord` and confirm the color theme change with <kbd>Enter</kbd>.
|
||||
|
||||
<p align="center"><img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/develop/assets/images/ports/visual-studio-code/ui-color-theme-select.png"/></p>
|
||||
|
||||
See Nord Visual Studio Code's documentation for details about [more activation options][nord-docs-home-install#activation].
|
||||
|
||||
## Features
|
||||
|
||||
<div align="center"><p><strong>Your IDE. Your style.</strong></p><p>A unified UI and editor syntax element design provides a clutter-free and fluidly merging appearance.</p></div>
|
||||
|
||||
<p align="center"><img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/develop/assets/images/ports/visual-studio-code/ui-overview-go.png"/></p>
|
||||
|
||||
<div align="center"><p><strong>Beautiful code to keep focused.</strong></p><p>The editor color scheme supports a wide range of programming languages — From bundled definitions up to many popular third-party syntax extensions.</p></div>
|
||||
|
||||
<p align="center"><img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/develop/assets/images/ports/visual-studio-code/editor-syntax-go.png"/></p>
|
||||
|
||||
<div align="center"><p><strong>Small details with unobtrusive styles.</strong></p><p>Popular and common code editor features like search result marker and brace matching are designed to get out of your way with a visually attractive appearance.</p></div>
|
||||
|
||||
<p align="center"><img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/develop/assets/images/ports/visual-studio-code/editor-syntax-go-comments.png"/></p>
|
||||
|
||||
## Contributing
|
||||
|
||||
Nord is an open source project and we love to receive contributions from the [community][nord-comm]!
|
||||
|
||||
There are many ways to contribute, from [writing- and improving documentation and tutorials][nord-contrib-guide-docs], [reporting bugs][nord-contrib-guide-bugs], [submitting enhancement suggestions][nord-contrib-guide-enhance] that can be added to Nord by [submitting pull requests][nord-contrib-guide-pr].
|
||||
|
||||
Please take a moment to read Nord's full [contributing guide][nord-contrib-guide] to learn about the development process, the project's used [styleguides][nord-contrib-guide-styles], [branch organization][nord-contrib-guide-branching] and [versioning][nord-contrib-guide-versioning] model.
|
||||
|
||||
The guide also includes information about [minimal, complete, and verifiable examples][nord-contrib-guide-mcve] and other ways to contribute to the project like [improving existing issues][nord-contrib-guide-impr-issues] and [giving feedback on issues and pull requests][nord-contrib-guide-feedback].
|
||||
|
||||
<p align="center"><img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/develop/assets/images/nord/repository-footer-separator.png" srcset="https://raw.githubusercontent.com/arcticicestudio/nord-docs/develop/assets/images/nord/repository-footer-separator-2x.png 2x" /></p>
|
||||
|
||||
<p align="center">Copyright © 2017-present <a href="https://www.arcticicestudio.com" target="_blank">Arctic Ice Studio</a> and <a href="https://www.svengreb.de" target="_blank">Sven Greb</a></p>
|
||||
|
||||
<p align="center"><a href="https://github.com/arcticicestudio/nord-visual-studio-code/blob/develop/LICENSE"><img src="https://img.shields.io/static/v1.svg?style=flat-square&label=License&message=MIT&logoColor=eceff4&logo=github&colorA=4c566a&colorB=88c0d0"/></a></p>
|
||||
|
||||
[nord-comm]: https://www.nordtheme.com/community
|
||||
[nord-contrib-guide-branching]: https://github.com/arcticicestudio/nord/blob/develop/CONTRIBUTING.md#branch-organization
|
||||
[nord-contrib-guide-bugs]: https://github.com/arcticicestudio/nord/blob/develop/CONTRIBUTING.md#bug-reports
|
||||
[nord-contrib-guide-docs]: https://github.com/arcticicestudio/nord/blob/develop/CONTRIBUTING.md#documentations
|
||||
[nord-contrib-guide-enhance]: https://github.com/arcticicestudio/nord/blob/develop/CONTRIBUTING.md#enhancement-suggestions
|
||||
[nord-contrib-guide-feedback]: https://github.com/arcticicestudio/nord/blob/develop/CONTRIBUTING.md#give-feedback-on-issues-and-pull-requests
|
||||
[nord-contrib-guide-impr-issues]: https://github.com/arcticicestudio/nord/blob/develop/CONTRIBUTING.md#improve-issues
|
||||
[nord-contrib-guide-mcve]: https://github.com/arcticicestudio/nord/blob/develop/CONTRIBUTING.md#mcve
|
||||
[nord-contrib-guide-pr]: https://github.com/arcticicestudio/nord/blob/develop/CONTRIBUTING.md#pull-requests
|
||||
[nord-contrib-guide-styles]: https://github.com/arcticicestudio/nord/blob/develop/CONTRIBUTING.md#styleguides
|
||||
[nord-contrib-guide-versioning]: https://github.com/arcticicestudio/nord/blob/develop/CONTRIBUTING.md#versioning
|
||||
[nord-contrib-guide]: https://github.com/arcticicestudio/nord/blob/develop/CONTRIBUTING.md
|
||||
[nord-docs-home-custom]: https://www.nordtheme.com/docs/ports/visual-studio-code/customization
|
||||
[nord-docs-home-develop]: https://www.nordtheme.com/docs/ports/visual-studio-code/development
|
||||
[nord-docs-home-install]: https://www.nordtheme.com/docs/ports/visual-studio-code/installation
|
||||
[nord-docs-home-install#activation]: https://www.nordtheme.com/docs/ports/visual-studio-code/installation#activation
|
||||
[nord-docs-home-install#local]: https://www.nordtheme.com/docs/ports/visual-studio-code/installation#local-installation
|
||||
[nord-docs-home]: https://www.nordtheme.com/docs/ports/visual-studio-code
|
||||
[nord-home]: https://www.nordtheme.com/ports/visual-studio-code
|
||||
[nord-home#editor-details]: https://www.nordtheme.com/ports/visual-studio-code#editor-details
|
||||
[nord-home#setup]: https://www.nordtheme.com/ports/visual-studio-code#setup
|
||||
[nord-home#syntax]: https://www.nordtheme.com/ports/visual-studio-code#syntax
|
||||
[vscode-docs-extmarket]: https://code.visualstudio.com/docs/editor/extension-gallery
|
||||
[vscode-docs-ui-actbar]: https://code.visualstudio.com/docs/getstarted/userinterface#_activity-bar
|
||||
[vscode-extmarket-home]: https://marketplace.visualstudio.com/items?itemName=arcticicestudio.nord-visual-studio-code
|
||||
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
|
@ -1,107 +0,0 @@
|
|||
{
|
||||
"name": "nord-visual-studio-code",
|
||||
"displayName": "Nord",
|
||||
"description": "An arctic, north-bluish clean and elegant Visual Studio Code theme.",
|
||||
"version": "0.19.0",
|
||||
"publisher": "arcticicestudio",
|
||||
"author": {
|
||||
"name": "Arctic Ice Studio",
|
||||
"email": "development@arcticicestudio.com",
|
||||
"url": "https://www.arcticicestudio.com"
|
||||
},
|
||||
"homepage": "https://github.com/arcticicestudio/nord-visual-studio-code",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/arcticicestudio/nord-visual-studio-code"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/arcticicestudio/nord-visual-studio-code/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=15.13",
|
||||
"npm": ">=7.7",
|
||||
"vscode": "^1.12.0"
|
||||
},
|
||||
"galleryBanner": {
|
||||
"color": "#2E3440",
|
||||
"theme": "dark"
|
||||
},
|
||||
"icon": "assets/extension-marketplace-icon.png",
|
||||
"markdown": "github",
|
||||
"categories": [
|
||||
"Themes"
|
||||
],
|
||||
"keywords": [
|
||||
"arctic",
|
||||
"north",
|
||||
"bluish",
|
||||
"clean",
|
||||
"elegant"
|
||||
],
|
||||
"badges": [
|
||||
{
|
||||
"url": "https://vsmarketplacebadge.apphb.com/version/arcticicestudio.nord-visual-studio-code.svg",
|
||||
"href": "https://marketplace.visualstudio.com/items/arcticicestudio.nord-visual-studio-code",
|
||||
"description": "Extension version"
|
||||
},
|
||||
{
|
||||
"url": "https://vsmarketplacebadge.apphb.com/installs/arcticicestudio.nord-visual-studio-code.svg",
|
||||
"href": "https://marketplace.visualstudio.com/items/arcticicestudio.nord-visual-studio-code",
|
||||
"description": "Extension installs"
|
||||
},
|
||||
{
|
||||
"url": "https://vsmarketplacebadge.apphb.com/rating/arcticicestudio.nord-visual-studio-code.svg",
|
||||
"href": "https://marketplace.visualstudio.com/items/arcticicestudio.nord-visual-studio-code",
|
||||
"description": "Extension Rating"
|
||||
}
|
||||
],
|
||||
"contributes": {
|
||||
"themes": [
|
||||
{
|
||||
"label": "Nord",
|
||||
"uiTheme": "vs-dark",
|
||||
"path": "./themes/nord-color-theme.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"build": "run-s clean package",
|
||||
"clean": "del *.vsix",
|
||||
"format": "run-s format:pretty format:fix",
|
||||
"format:fix": "eslint --fix --ext .js,.json .",
|
||||
"format:pretty": "prettier --write .",
|
||||
"lint": "run-s lint:*",
|
||||
"lint:ci:pretty": "prettier --loglevel silent --check .",
|
||||
"lint:js": "eslint --ext .",
|
||||
"lint:json": "eslint --ext .json .",
|
||||
"lint:md": "remark --no-stdout . \".github/**/*.md\"",
|
||||
"package": "vsce package",
|
||||
"vsce:publish": "vsce publish",
|
||||
"prepare:husky": "husky install",
|
||||
"prepare": "run-s prepare:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@arcticicestudio/eslint-config-base": ">=0.11.0 <1.0.0",
|
||||
"@arcticicestudio/remark-preset-lint": ">=0.4.0 <1.0.0",
|
||||
"@babel/eslint-parser": "^7.15.7",
|
||||
"del-cli": "^4.0.1",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"eslint-plugin-jsonc": "^1.7.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"husky": "^7.0.2",
|
||||
"lint-staged": "^11.1.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.4.1",
|
||||
"remark-cli": "^9.0.0",
|
||||
"vsce": "^1.100.0"
|
||||
},
|
||||
"__metadata": {
|
||||
"id": "6f35c257-7fd5-4bc2-9cd1-01976589c17a",
|
||||
"publisherId": "d6e09771-ef61-4944-9f28-44e338818618",
|
||||
"publisherDisplayName": "arcticicestudio",
|
||||
"installedTimestamp": 1632763322301
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
github: [asvetliakov, theol0403]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
name: Code Check & Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build & Test
|
||||
strategy:
|
||||
matrix:
|
||||
# os: [macos-latest, ubuntu-latest, windows-latest]
|
||||
# CI windows have some issues, i'm not sure why
|
||||
os: [macos-latest, ubuntu-20.04]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "12"
|
||||
- name: Install Neovim
|
||||
uses: rhysd/action-setup-vim@v1
|
||||
id: vim
|
||||
with:
|
||||
neovim: true
|
||||
version: nightly
|
||||
- name: Yarn install
|
||||
run: yarn --silent --frozen-lockfile
|
||||
- name: Build
|
||||
run: yarn run test-compile
|
||||
- name: Webpack
|
||||
run: yarn run webpack
|
||||
- name: Lint
|
||||
run: yarn run lint
|
||||
- name: Test
|
||||
uses: GabrielBB/xvfb-action@v1.4
|
||||
env:
|
||||
NEOVIM_PATH: ${{ steps.vim.outputs.executable }}
|
||||
NEOVIM_DEBUG: 1
|
||||
NEOVIM_DEBUG_HOST: 127.0.0.1
|
||||
NEOVIM_DEBUG_PORT: 4000
|
||||
with:
|
||||
run: yarn run test
|
||||
create:
|
||||
name: Create extension
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "12"
|
||||
- name: Yarn install
|
||||
run: yarn --silent --frozen-lockfile
|
||||
- name: Install VSCE
|
||||
run: yarn add vsce
|
||||
- name: Create extension
|
||||
run: yarn run vsce package -o vscode-neovim-${{github.sha}}.vsix
|
||||
- name: Upload extension
|
||||
if: runner.os == 'Linux'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: vscode-neovim
|
||||
path: vscode-neovim-${{github.sha}}.vsix
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
module.exports = {
|
||||
semi: true,
|
||||
trailingComma: "all",
|
||||
singleQuote: true,
|
||||
printWidth: 120,
|
||||
tabWidth: 4,
|
||||
singleQuote: false,
|
||||
proseWrap: "always"
|
||||
};
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||
<Metadata>
|
||||
<Identity Language="en-US" Id="vscode-neovim" Version="0.0.82" Publisher="asvetliakov"/>
|
||||
<DisplayName>VSCode Neovim</DisplayName>
|
||||
<Description xml:space="preserve">VSCode Neovim Integration</Description>
|
||||
<Tags>keybindings,vi,vim,neovim</Tags>
|
||||
<Categories>Other,Keymaps</Categories>
|
||||
<GalleryFlags>Public</GalleryFlags>
|
||||
<Badges></Badges>
|
||||
<Properties>
|
||||
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.54.0" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="ui" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/asvetliakov/vscode-neovim" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/asvetliakov/vscode-neovim" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/asvetliakov/vscode-neovim" />
|
||||
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Support" Value="https://github.com/asvetliakov/vscode-neovim/issues" />
|
||||
|
||||
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" />
|
||||
|
||||
|
||||
|
||||
</Properties>
|
||||
<License>extension/LICENSE.txt</License>
|
||||
<Icon>extension/images/icon.png</Icon>
|
||||
</Metadata>
|
||||
<Installation>
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
|
||||
</Installation>
|
||||
<Dependencies/>
|
||||
<Assets>
|
||||
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
|
||||
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.Changelog" Path="extension/CHANGELOG.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.License" Path="extension/LICENSE.txt" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Icons.Default" Path="extension/images/icon.png" Addressable="true" />
|
||||
</Assets>
|
||||
</PackageManifest>
|
||||
|
|
@ -1,278 +0,0 @@
|
|||
# Change Log
|
||||
|
||||
## [0.0.82]
|
||||
|
||||
- Big updates to keybindings ! ( [#513](https://github.com/asvetliakov/vscode-neovim/issues/513) , [#654](https://github.com/asvetliakov/vscode-neovim/issues/654) , [#557](https://github.com/asvetliakov/vscode-neovim/issues/557) , [#585](https://github.com/asvetliakov/vscode-neovim/issues/585) , [#655](https://github.com/asvetliakov/vscode-neovim/issues/655) )
|
||||
|
||||
## [0.0.81]
|
||||
|
||||
- Revert ( [#649](https://github.com/asvetliakov/vscode-neovim/issues/649) )
|
||||
|
||||
## [0.0.80]
|
||||
|
||||
- Improve cursor position behaviour ( [#649](https://github.com/asvetliakov/vscode-neovim/issues/649) )
|
||||
|
||||
## [0.0.79]
|
||||
|
||||
- Fix infinity file opened loop on recent neovim versions ( [#632](https://github.com/asvetliakov/vscode-neovim/issues/632) )
|
||||
|
||||
## [0.0.78]
|
||||
|
||||
- Fix init error with no workspace folders open ( [#526](https://github.com/asvetliakov/vscode-neovim/issues/526) )
|
||||
- Update README.md ( [#527](https://github.com/asvetliakov/vscode-neovim/issues/527) )
|
||||
|
||||
## [0.0.77]
|
||||
|
||||
- Fix cursor with tab indentation ( [#516](https://github.com/asvetliakov/vscode-neovim/issues/516) , [#515](https://github.com/asvetliakov/vscode-neovim/issues/515) )
|
||||
- Handle correctly WSL path with spaces ( [#509](https://github.com/asvetliakov/vscode-neovim/issues/509) )
|
||||
|
||||
## [0.0.76]
|
||||
|
||||
- Fix mutli-column character handling ( [#503](https://github.com/asvetliakov/vscode-neovim/issues/503) )
|
||||
|
||||
## [0.0.75]
|
||||
|
||||
- Improvements to cursor logic ( [#501](https://github.com/asvetliakov/vscode-neovim/issues/501) )
|
||||
- Cancel current mode when switching editor ( [#156](https://github.com/asvetliakov/vscode-neovim/issues/156) )
|
||||
|
||||
## [0.0.74]
|
||||
|
||||
- Fix cursor logic ( [#467](https://github.com/asvetliakov/vscode-neovim/issues/467) , [#488](https://github.com/asvetliakov/vscode-neovim/issues/488) )
|
||||
- Trigger matching word highlight after movement ( [#159](https://github.com/asvetliakov/vscode-neovim/issues/159) )
|
||||
- VIM highlight adjustments ( [#482](https://github.com/asvetliakov/vscode-neovim/issues/482) )
|
||||
|
||||
## [0.0.73]
|
||||
|
||||
- Improve cursor reveailing logic ( [#479](https://github.com/asvetliakov/vscode-neovim/issues/479) )
|
||||
- Hook g0 / g\$ ( [#455](https://github.com/asvetliakov/vscode-neovim/issues/455) )
|
||||
|
||||
## [0.0.72]
|
||||
|
||||
- Fix undo regression introduced in `0.0.70`
|
||||
|
||||
## [0.0.71]
|
||||
|
||||
- Fix `Unable to determine neovim windows id` error spam ( [#418](https://github.com/asvetliakov/vscode-neovim/issues/418) )
|
||||
|
||||
## [0.0.70]
|
||||
|
||||
- Use vscode jumplist actions instead of neovim
|
||||
- Fix uppercase marks ( [#228](https://github.com/asvetliakov/vscode-neovim/issues/228) )
|
||||
- Various cursor & buffer management fixes ( [#404](https://github.com/asvetliakov/vscode-neovim/issues/404) , [#392](https://github.com/asvetliakov/vscode-neovim/issues/392) , [#386](https://github.com/asvetliakov/vscode-neovim/issues/386) )
|
||||
- Implement manageEditorHeight and manageEditorWidth ( [#444](https://github.com/asvetliakov/vscode-neovim/issues/444) )
|
||||
- Fix `<C-a>` in insert mode ( [#283](https://github.com/asvetliakov/vscode-neovim/issues/283) )
|
||||
- Set vim cwd as vscode workspace ( [#429](https://github.com/asvetliakov/vscode-neovim/issues/429) )
|
||||
- Fix shell-agnostic WSL integration ( [#147](https://github.com/asvetliakov/vscode-neovim/issues/147) )
|
||||
- Map :x to Wq ( [#396](https://github.com/asvetliakov/vscode-neovim/issues/396) )
|
||||
- Various docs contributions
|
||||
- Improve build ( [#378](https://github.com/asvetliakov/vscode-neovim/issues/378) )
|
||||
|
||||
## [0.0.63]
|
||||
|
||||
- Allow to put text decorations (usually EasyMotion ones) at top setting (`vscode-neovim.textDecorationsAtTop`) ( [#358](https://github.com/asvetliakov/vscode-neovim/issues/358) ), contributed by @jhgarner
|
||||
- Fix incorrect `<C-w><C-w>/<C-w>w` mappings ( [#359](https://github.com/asvetliakov/vscode-neovim/issues/359) ), contributed by @tschaei
|
||||
- Replace/modernize neovim vscode command line interop mappings by `<Cmd>call` ( [#362](https://github.com/asvetliakov/vscode-neovim/issues/362) ), contributed by @theol0403
|
||||
- Fix incorrect `<C-w>gf` mapping ( [#365](https://github.com/asvetliakov/vscode-neovim/issues/365) ), contributed by @Yuuki77
|
||||
- Fix applying vim HL (such as `MatchParen`) at end of a line ( [#371](https://github.com/asvetliakov/vscode-neovim/issues/371) )
|
||||
- Fix incorrect cursor position when selecting next/prev search result ( [#366](https://github.com/asvetliakov/vscode-neovim/issues/366) )
|
||||
- Fix/improve behavior of auto-accepting vim return prompt `Press enter to continue`. In some cases it was excess ( [#372](https://github.com/asvetliakov/vscode-neovim/issues/372) )
|
||||
- Bundle extension by webpack ( [#377](https://github.com/asvetliakov/vscode-neovim/issues/377) )
|
||||
|
||||
## [0.0.62]
|
||||
|
||||
- Fix jumplist ( [#350](https://github.com/asvetliakov/vscode-neovim/issues/350) )
|
||||
- Add `K` and `gO` mappings (mapped to `showHover` and `goToSymbol`) ( [#108](https://github.com/asvetliakov/vscode-neovim/issues/108) ) (@Shatur95)
|
||||
- Fix images/icon (@Shatur95)
|
||||
|
||||
## [0.0.60/61]
|
||||
|
||||
Started from this version `neovim 0.5` nightly version is required
|
||||
Many things have been refactored/changed internally in this release. So if you see any regression - please fill an issue
|
||||
|
||||
- Turn on VIM smartindenting/autoindenting and remove custom vscode bindings to `o`/`O` (so it uses VIM ones)
|
||||
- New buffer,window and cursor management. This makes the extension finally work with git diff view, peek views, search editor views and even in output channels! ( [#53](https://github.com/asvetliakov/vscode-neovim/issues/53) , [#187](https://github.com/asvetliakov/vscode-neovim/issues/187) , [#220](https://github.com/asvetliakov/vscode-neovim/issues/220) , [#223](https://github.com/asvetliakov/vscode-neovim/issues/223), [#226](https://github.com/asvetliakov/vscode-neovim/issues/226))
|
||||
- Implement multi-line messages pager. Things like `:registers`, `:changes`, `:jumps`, `:messages` are working correctly now ( [#202](https://github.com/asvetliakov/vscode-neovim/issues/202) , [#78](https://github.com/asvetliakov/vscode-neovim/issues/78) , [#296](https://github.com/asvetliakov/vscode-neovim/issues/296) )
|
||||
- Fix tab indent problems and sync vscode tab settings with neovim ( [#275](https://github.com/asvetliakov/vscode-neovim/issues/275) , [#239](https://github.com/asvetliakov/vscode-neovim/issues/239) , [#264](https://github.com/asvetliakov/vscode-neovim/issues/264) , [#167](https://github.com/asvetliakov/vscode-neovim/issues/167) , [#100](https://github.com/asvetliakov/vscode-neovim/issues/100) , [#152](https://github.com/asvetliakov/vscode-neovim/issues/152) , [#289](https://github.com/asvetliakov/vscode-neovim/issues/289) )
|
||||
- Fix few macro recording problems ( [#207](https://github.com/asvetliakov/vscode-neovim/issues/207) )
|
||||
- Fix ghost keys after exiting insert mode ( [#324](https://github.com/asvetliakov/vscode-neovim/issues/324) ). For `jj` / `jk` users there are still few problems ( [#330](https://github.com/asvetliakov/vscode-neovim/issues/330) ) but they will be sorted in next releases
|
||||
- Fix few command line problems ( [#155](https://github.com/asvetliakov/vscode-neovim/issues/155) , [#288](https://github.com/asvetliakov/vscode-neovim/issues/288) )
|
||||
- Fix some buffer desync issues ( [#312](https://github.com/asvetliakov/vscode-neovim/issues/312) )
|
||||
- Fix `<C-w>v/<C-w>s` split shortcuts ( [#331](https://github.com/asvetliakov/vscode-neovim/issues/331) )
|
||||
- Fix brackets for substitute command ( [#300](https://github.com/asvetliakov/vscode-neovim/issues/300) )
|
||||
- Add logger and log-related configuration to options
|
||||
- Change some default code-actions mappings ( [#339](https://github.com/asvetliakov/vscode-neovim/issues/339) )
|
||||
- Add extension icon. Many thanks to https://github.com/ngscheurich
|
||||
|
||||
## [0.0.52]
|
||||
|
||||
- Implement dot repeat (`.`) command ( [#209](https://github.com/asvetliakov/vscode-neovim/issues/209) , [#173](https://github.com/asvetliakov/vscode-neovim/issues/173) ). Also fixes `<count>` insert comamnds, like [#255](https://github.com/asvetliakov/vscode-neovim/issues/255) , [#249](https://github.com/asvetliakov/vscode-neovim/issues/249)
|
||||
- Removed file name from statusbar ( [#291](https://github.com/asvetliakov/vscode-neovim/issues/291) , [#230](https://github.com/asvetliakov/vscode-neovim/issues/230) ), thanks @Shatur95
|
||||
- Fix visual selection conversion ( [#233](https://github.com/asvetliakov/vscode-neovim/issues/233) ), thanks @Shatur95
|
||||
- Fix wrong string comparsions ( [#308](https://github.com/asvetliakov/vscode-neovim/issues/308) ), thanks @Shatur95
|
||||
- Make espace keys work only when editor has focus ( [#290](https://github.com/asvetliakov/vscode-neovim/issues/290) ) , thanks @David-Else
|
||||
- Added some file name completion in commandline ( [#192](https://github.com/asvetliakov/vscode-neovim/issues/192) ), thanks @ppwwyyxx
|
||||
- Fix missing `<C-w>c` mapping ( [#180](https://github.com/asvetliakov/vscode-neovim/issues/180) ), thanks @trkoch
|
||||
- Add operating system dependent path settings ( [#137](https://github.com/asvetliakov/vscode-neovim/issues/137) ), thanks @3nuc
|
||||
- bind gh to mousehover ( [#107](https://github.com/asvetliakov/vscode-neovim/issues/107) ), thanks @kwonoj
|
||||
|
||||
## [0.0.50]
|
||||
|
||||
- Fix cursor & extension hang for some cases ( [#153](https://github.com/asvetliakov/vscode-neovim/issues/153) )
|
||||
|
||||
## [0.0.49]
|
||||
|
||||
- Use command line completion only for command line originated via `:` command ( [#146](https://github.com/asvetliakov/vscode-neovim/issues/146) )
|
||||
|
||||
## [0.0.48]
|
||||
|
||||
- Fix incorrect cursor for multibyte single column width characters ( [#142](https://github.com/asvetliakov/vscode-neovim/issues/142) )
|
||||
- Fix vim-easymotion decorators drifting when text has multi-byte characters ( [#144](https://github.com/asvetliakov/vscode-neovim/issues/144) )
|
||||
- Disabled vim modeline processing
|
||||
- Force vim folds to be always opened to prevent problems
|
||||
- Fix vim-easymotion decorators drifting to the end of line ( [#60](https://github.com/asvetliakov/vscode-neovim/issues/60) )
|
||||
- Fix incorrect cursor positions after commands/mappings such as `>gv` ( [#141](https://github.com/asvetliakov/vscode-neovim/issues/141) )
|
||||
- Fix double command prompt ( [#120](https://github.com/asvetliakov/vscode-neovim/issues/120) )
|
||||
|
||||
## [0.0.47]
|
||||
|
||||
- Fix the problem when cursor/extension stucks for second+ editor columns ( [#126](https://github.com/asvetliakov/vscode-neovim/issues/126) )
|
||||
|
||||
## [0.0.46]
|
||||
|
||||
- Update `neovim-client` to latest version. This should eliminate delay between operations and generally improve the performance. Kudos to @kwonoj for impressive work here
|
||||
- Fix cursor movement for 2-byte chars ( [#127](https://github.com/asvetliakov/vscode-neovim/issues/127) )
|
||||
|
||||
## [0.0.45]
|
||||
|
||||
- Fix VIM filetype detection ( [#115](https://github.com/asvetliakov/vscode-neovim/issues/115) ). This means `FileType` autocmd should work correctly now. Also fixes `vim-matchup` plugin. This may introduce some side effects from previously disabled filetype plugins - just fill an issue if something doesn't work
|
||||
- Fix broken cursor position in insert mode for special keys (such as `del`/`backspace`/etc) if you had recorded a macro in insert mode previously
|
||||
|
||||
## [0.0.44]
|
||||
|
||||
- Hotfix broken `VSCodeCallRange` (commenting/formatting didn't work because of this)
|
||||
|
||||
## [0.0.43]
|
||||
|
||||
- Visual modes DON'T produce vscode selections right now. These were implemented through various workarounds, gave really small value and were constant origin of headache. Also this fixes few issues related to visual modes ( [#105](https://github.com/asvetliakov/vscode-neovim/issues/105), [#118](https://github.com/asvetliakov/vscode-neovim/issues/118) ). To round the corners, invoking vscode's command palette (by using default vscode hotkeys) from visual mode will convert neovim visual selection to vscode visual selection, this should cover most use cases. Also, there are `VScodeNotifyRange`/`VSCodeCallRange`/`VSCodeNotifyRangePos`/`VSCodeCallRangePos` vim functions if you need to call vscode command with selection. See [this for example](https://github.com/asvetliakov/vscode-neovim/blob/e61832119988bb1e73b81df72956878819426ce2/vim/vscode-code-actions.vim#L42-L54) and [mapping](https://github.com/asvetliakov/vscode-neovim/blob/e61832119988bb1e73b81df72956878819426ce2/vim/vscode-code-actions.vim#L98) if you're doing custom mappings and assuming there is some vscode selection exist. Use `VSCodeNotifyRange` when you don't need a column pos (e.g. for visual line mode) and `VSCodeNotifyRangePos` when you need them (e.g for visual mode).
|
||||
- Refactored vscode<->neovim cursor syncrhonization
|
||||
- Fix `ma`/`mi` not working when selecting lines upward ( [#117](https://github.com/asvetliakov/vscode-neovim/issues/117) )
|
||||
- Changed `ma`/`mi` to skip empty lines. Added `mA`/`mI` for the previous behavior
|
||||
- Macro recording fixes
|
||||
- Refactored & optimized HL provider (highlight should be faster now)
|
||||
- Override default keybindings only when neovim was initialized succesfully ( [#112](https://github.com/asvetliakov/vscode-neovim/issues/112) )
|
||||
- Don't preselect `'<,'>` marks when invoking cmdline from visual line ( [#111](https://github.com/asvetliakov/vscode-neovim/issues/111) )
|
||||
- Implemented commandline history ( [#88](https://github.com/asvetliakov/vscode-neovim/issues/88) )
|
||||
- Add the option to start the visual mode with mouse selection ( [#94](https://github.com/asvetliakov/vscode-neovim/issues/94) )
|
||||
|
||||
## [0.0.42]
|
||||
|
||||
- Disabled jj/jk escape keys by default
|
||||
|
||||
## [0.0.40]
|
||||
|
||||
- Fix cursor/highlight not working with multi-byte width characters (Russian, Chinese, Japanese, etc...), i.e the extension should work normally with them (#68, [#91](https://github.com/asvetliakov/vscode-neovim/issues/91))
|
||||
- Fix incorrect vim highlight when using tab indentation (#81)
|
||||
- Removed multiple cursors by default from visual line/block modes (visual block mode still spawns cursors but they are pruly visual) (#59, [#61](https://github.com/asvetliakov/vscode-neovim/issues/61)). Previous behavior is still accessible by `mi` or `ma` keybindings while in visual line/block modes
|
||||
- Allow to override keys/mappings set by extension (previously they have been set after user config loaded)
|
||||
- Allow to identify if neovim is running through vscode extension by checking `if exists('g:vscode')` (#83)
|
||||
- Added `<C-[>` and `Escape` as escape keys (#74)
|
||||
- Added `<C-n>` and `<C-p>` to select next autocomplete suggestion/show next/prev parameter hint
|
||||
- Added `jj` and `jk` as escape keys from the insert mode (#75)
|
||||
- Pass `<C-/>` to neovim and call VSCodeCommentary (still recommended to bind it to own keys) (#89)
|
||||
- Pass `<S-Tab>` to neovim
|
||||
- Allow to pass additional ctrl keys to neovim (see Readme)
|
||||
- Added workaround for `gk`/`gj` motions
|
||||
- Corrected `gf`/`gF` keybindings. Add `<C-]>` as go-to-def (works in help too) (#77). Add `gd`/`gD` as secondary mappings to go-to-def/peek-def. Add `<C-w>gd` to reveal definition aside
|
||||
|
||||
## [0.0.39]
|
||||
|
||||
- Fix bug with incorrect buffer edits
|
||||
- Fix cursor jumping after pressing something like `cw` and fast typing text in large file
|
||||
|
||||
## [0.0.38]
|
||||
|
||||
- Fix cursor position after deleting a line and possibly other operations
|
||||
|
||||
## [0.0.37]
|
||||
|
||||
- Fix performance of o/O. If you're using custom bindings for them, you might need to rebind them to call new action. See vscode-insert.vim
|
||||
|
||||
## [0.0.36]
|
||||
|
||||
- Fix macros with insert mode
|
||||
- Big performance improvements, fix undo & macros performance
|
||||
- Allow to use neovim installed in WSL. Tick useWSL conf checkbox and specify linux path to neovim
|
||||
|
||||
## [0.0.35]
|
||||
|
||||
- Use VIM jumplist for `<C-o>`/`<C-i>`/`<Tab>`
|
||||
|
||||
## [0.0.33-0.0.34]
|
||||
|
||||
- Fix extension for linux/macos users
|
||||
- Fix buffer-vscode desynchornization after redo
|
||||
|
||||
## [0.0.32]
|
||||
|
||||
- Cmdline fixes/improvements (#50, [#51](https://github.com/asvetliakov/vscode-neovim/issues/51))
|
||||
|
||||
## [0.0.31]
|
||||
|
||||
- Fix crazy cursor jumping when having opened multiple editors panes
|
||||
|
||||
## [0.0.30]
|
||||
|
||||
- Implemented nvim's ext_multigrid support. This solves almost all problems with vim highlighting and potentially enables easymotion's overwin motions (they still don't work however). Window management still should be performed by vscode
|
||||
- Removed vim-style cursor following on editor scrolling. This totally screwed vscode jumplist, so better to have working jumplist than such minor feature.
|
||||
- Cursor position fixes
|
||||
- `:e [filepath]` works again
|
||||
|
||||
## [0.0.29]
|
||||
|
||||
- Fix selection is being reset in visual mode after typing `vk$` (#48)
|
||||
- Fix not cleaning incsearch highlight after canceling the incsearch (#46)
|
||||
- Fix incorrect cursor after switching the editor to the same document but in different editor column (#49)
|
||||
|
||||
## [0.0.28]
|
||||
|
||||
- Use non-blocking rpc requests when communicatings with vscode for file management operations (closing, opening, etc...). Should eliminate the issue when vim is 'stuck' and doesn't respond anymore
|
||||
- Fix incorrect cursor positions after opening `:help something` (#44)
|
||||
- Fix visual block selection for single column in multiple rows (#42)
|
||||
- Enable VIM syntax highlighting for help files and external buffers like `:PlugStatus`. It's slow and sometimes buggy but better than nothing in meantime
|
||||
|
||||
## [0.0.27]
|
||||
|
||||
- Fix incsearch and allow to use `<C-t>`/`<C-g>` with it
|
||||
- Reworked/Refactored command line. Now with wildmenu completion support. Also keys like `<C-w>` or `<C-u>` are working fine now in cmdline now
|
||||
|
||||
## [0.0.26]
|
||||
|
||||
- Partially revert [#41](https://github.com/asvetliakov/vscode-neovim/issues/41)
|
||||
|
||||
## [0.0.25]
|
||||
|
||||
- Tab management commands & keys, like `gt` or `tabo[nly]`
|
||||
- Window management commands & keys like `sp[lit]`/`vs[plit]` and `<C-w> j/k/l/h` keys
|
||||
- Bind scroll commands in neovim instead of vscode extension ([#41](https://github.com/asvetliakov/vscode-neovim/issues/41))
|
||||
|
||||
## [0.0.24]
|
||||
|
||||
- File management commands, like `:w` or `:q` (bound to vscode actions)
|
||||
- Fix [#40](https://github.com/asvetliakov/vscode-neovim/issues/40)
|
||||
|
||||
## [0.0.1-0.0.23]
|
||||
|
||||
- A bunch of development versions. 0.0.23 has the following features
|
||||
- Correct editing and the cursor management
|
||||
- Control keys in the insert & normal/visual modes
|
||||
- Visual mode produces vscode selections
|
||||
- Working VIM highlighting (most of a default VIM HL groups are ignored since they don't make sense in VSCode, but non standard groups are processed, so things like vim-easymotion or vim-highlight are working fine)
|
||||
- Scrolling commands (scrolling is done by vscode so things are slighly different here)
|
||||
- Special vim-easymotion fork to use vscode text decorators instead of replacing text (as original vim-easymotion does)
|
||||
- Analogue of vim-commentary (original vim-commentary works fine too)
|
||||
- Working external vim buffers, like `:help` or `:PlugStatus`
|
||||
- Multiple cursors for visual line/visual block modes
|
||||
|
||||
## [0.0.1]
|
||||
|
||||
- Initial release
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2019 Alexey Svetliakov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
@ -1,593 +0,0 @@
|
|||
<h2 align="center"><img src="https://github.com/asvetliakov/vscode-neovim/raw/HEAD/./images/icon.png" height="128"><br>VSCode Neovim</h2>
|
||||
<p align="center"><strong>VSCode Neovim Integration</strong></p>
|
||||
|
||||
<p align=center>
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim"><img src="https://vsmarketplacebadge.apphb.com/version/asvetliakov.vscode-neovim.svg"></a>
|
||||
<a href="https://github.com/asvetliakov/vscode-neovim/actions/workflows/build_test.yml"><img src="https://github.com/asvetliakov/vscode-neovim/workflows/Code%20Check%20&%20Test/badge.svg"></a>
|
||||
<a href="https://gitter.im/vscode-neovim/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"><img src="https://badges.gitter.im/vscode-neovim/community.svg"></a>
|
||||
</p>
|
||||
|
||||
[Neovim](https://neovim.io/) is a fork of VIM to allow greater extensibility and integration. This extension uses a full
|
||||
embedded Neovim instance, no more half-complete VIM emulation! VSCode's native functionality is used for insert mode and
|
||||
editor commands, making the best use of both editors.
|
||||
|
||||
- 🎉 Almost fully feature-complete VIM integration by utilizing neovim as a backend.
|
||||
- 🔧 Supports custom `init.vim` and many vim plugins.
|
||||
- 🥇 First-class and lag-free insert mode, letting VSCode do what it does best.
|
||||
- 🤝 Complete integration with VSCode features (lsp/autocompletion/snippets/multi-cursor/etc).
|
||||
|
||||
<details>
|
||||
<summary><strong>Table of Contents</strong> (click to expand)</summary>
|
||||
|
||||
- [🧰 Installation](#-installation)
|
||||
- [💡 Tips and Features](#-tips-and-features)
|
||||
- [Important](#important)
|
||||
- [VSCode specific differences](#vscode-specific-differences)
|
||||
- [Performance problems](#performance-problems)
|
||||
- [Conditional init.vim](#conditional-initvim)
|
||||
- [Custom escape keys](#custom-escape-keys)
|
||||
- [Jumplist](#jumplist)
|
||||
- [Wildmenu completion](#wildmenu-completion)
|
||||
- [Multiple cursors](#multiple-cursors)
|
||||
- [Keyboard Quickfix](#keyboard-quickfix)
|
||||
- [Invoking VSCode actions from neovim](#invoking-vscode-actions-from-neovim)
|
||||
- [Examples](#examples)
|
||||
- [⌨️ Bindings](#️-bindings)
|
||||
- [File management](#file-management)
|
||||
- [Tab management](#tab-management)
|
||||
- [Buffer/window management](#bufferwindow-management)
|
||||
- [Insert mode special keys](#insert-mode-special-keys)
|
||||
- [Normal mode control keys](#normal-mode-control-keys)
|
||||
- [Cmdline special keys](#cmdline-special-keys)
|
||||
- [VSCode specific bindings](#vscode-specific-bindings)
|
||||
- [Editor command](#editor-command)
|
||||
- [Explorer/list navigation](#explorerlist-navigation)
|
||||
- [Explorer file manipulation](#explorer-file-manipulation)
|
||||
- [Custom keybindings](#custom-keybindings)
|
||||
- [🤝 Vim Plugins](#-vim-plugins)
|
||||
- [vim-easymotion](#vim-easymotion)
|
||||
- [vim-commentary](#vim-commentary)
|
||||
- [quick-scope](#quick-scope)
|
||||
- [📑 How it works](#-how-it-works)
|
||||
- [❤️ Credits & External Resources](#️-credits--external-resources)
|
||||
|
||||
</details>
|
||||
|
||||
## 🧰 Installation
|
||||
|
||||
- Install the [vscode-neovim](https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim)
|
||||
extension.
|
||||
- Install [Neovim](https://github.com/neovim/neovim/wiki/Installing-Neovim) **0.5.0 nightly** or greater.
|
||||
- Set the neovim path in the extension settings. You must specify full path to neovim, like
|
||||
"`C:\Neovim\bin\nvim.exe"` or "`/usr/local/bin/nvim`".
|
||||
- The setting id is "`vscode-neovim.neovimExecutablePaths.win32/linux/darwin`", respective to your system.
|
||||
- If you want to use neovim from WSL, set the `useWSL` configuration toggle and specify linux path to nvim binary.
|
||||
`wsl.exe` windows binary and `wslpath` linux binary are required for this. `wslpath` must be available through
|
||||
`$PATH` linux env setting. Use `wsl --list` to check for the correct default linux distribution.
|
||||
|
||||
> ❗ **Neovim 0.5.0 nightly** or greater is **required**. Any version lower than that won't work. Many linux
|
||||
> distributions have an **old** version of neovim in their package repo - always check what version are you installing.
|
||||
> You can install neovim separately, outside your system's package manager installation, for example using the appimage
|
||||
> from the neovim releases page.
|
||||
|
||||
> 🐛 See the [issues section](https://github.com/asvetliakov/vscode-neovim/issues) for known issues.
|
||||
|
||||
## 💡 Tips and Features
|
||||
|
||||
### Important
|
||||
|
||||
- If you get "Unable to init vscode-neovim: command 'type' already exists" message, uninstall other VSCode extensions
|
||||
that register the `type` command (like
|
||||
[VSCodeVim](https://marketplace.visualstudio.com/items?itemName=vscodevim.vim) or
|
||||
[Overtype](https://marketplace.visualstudio.com/items?itemName=adammaras.overtype)).
|
||||
- If you already have a big `init.vim` it is recommended to wrap existing settings & plugins with
|
||||
[`if !exists('g:vscode')`](#conditional-initvim) to prevent potential conflicts. If you have any problems, try with
|
||||
empty `init.vim` first.
|
||||
- On a Mac, the <kbd>h</kbd>, <kbd>j</kbd>, <kbd>k</kbd> and <kbd>l</kbd> movement keys may not repeat when held, to
|
||||
fix this open Terminal and execute the following command:
|
||||
`defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false`.
|
||||
- The extension works best if `editor.scrollBeyondLastLine` is disabled.
|
||||
|
||||
### VSCode specific differences
|
||||
|
||||
- File and editor management commands such as `:e`/`:w`/`:q`/`:vsplit`/`:tabnext`/etc are mapped to corresponding
|
||||
vscode commands and behavior may be different ([see below](#️-bindings)). **Do not** use vim commands like `:w` in
|
||||
scripts/keybindings, they won't work. If you're using them in some custom commands/mappings, you might need to
|
||||
rebind them to call vscode commands from neovim with `VSCodeCall/VSCodeNotify`
|
||||
([see below](#invoking-vscode-actions-from-neovim)).
|
||||
- Visual modes don't produce vscode selections, so any vscode commands expecting selection won't work. To round the
|
||||
corners, invoking the VSCode command picker from visual mode through the default hotkeys
|
||||
(<kbd>f1</kbd>/<kbd>ctrl/cmd+shift+p</kbd>) converts vim selection to real vscode selection. This conversion is also
|
||||
done automatically for some commands like commenting and formatting. If you're using some custom mapping for calling
|
||||
vscode commands that depends on real vscode selection, you can use `VSCodeNotifyRange`/`VSCodeNotifyRangePos` (the
|
||||
first one linewise, the latter characterwise) which will convert vim visual mode selection to vscode selection
|
||||
before calling the command ([see below](#invoking-vscode-actions-from-neovim)).
|
||||
- When you type some commands they may be substituted for the another, like `:write` will be replaced by `:Write`.
|
||||
This is normal.
|
||||
- Scrolling is done by VSCode. <kbd>C-d</kbd>/<kbd>C-u</kbd>/etc are slightly different.
|
||||
- Editor customization (relative line number, scrolloff, etc) is handled by VSCode.
|
||||
- Dot-repeat (<kbd>.</kbd>) is slightly different - moving the cursor within a change range won't break the repeat
|
||||
sequence. In neovim, if you type `abc<cursor>` in insert mode, then move cursor to `a<cursor>bc` and type `1` here
|
||||
the repeat sequence would be `1`. However in vscode it would be `a1bc`. Another difference is that when you delete
|
||||
some text in insert mode, dot repeat only works from right-to-left, meaning it will treat <kbd>Del</kbd> key as
|
||||
<kbd>BS</kbd> keys when running dot repeat.
|
||||
|
||||
### Performance problems
|
||||
|
||||
If you have any performance problems (cursor jitter usually) make sure you're not using these kinds of extensions:
|
||||
|
||||
- Anything that renders decorators very often:
|
||||
- Line number extensions (VSCode has built-in support for normal/relative line numbers)
|
||||
- Indent guide extensions (VSCode has built-in indent guides)
|
||||
- Brackets highlighter extensions (VSCode has built-in feature)
|
||||
- VSCode extensions that delay the extension host like "Bracket Pair Colorizer"
|
||||
- VIM plugins that increase latency and cause performance problems.
|
||||
- Make sure to disable unneeded plugins, as many of them don't make sense with vscode and may cause problems.
|
||||
- You don't need any code, highlighting, completion, lsp plugins as well any plugins that spawn windows/buffers
|
||||
(nerdtree and similar), fuzzy-finders, etc.
|
||||
- Many navigation/textobject/editing plugins should be fine.
|
||||
|
||||
If you're not sure, disable all other extensions, **reload vscode window**, and see if the problem persists before
|
||||
reporting.
|
||||
|
||||
### Conditional init.vim
|
||||
|
||||
To determine if neovim is running in vscode, add to your init.vim:
|
||||
|
||||
```vim
|
||||
if exists('g:vscode')
|
||||
" VSCode extension
|
||||
else
|
||||
" ordinary neovim
|
||||
endif
|
||||
```
|
||||
|
||||
To conditionally activate plugins, `vim-plug` has a
|
||||
[few solutions](https://github.com/junegunn/vim-plug/wiki/tips#conditional-activation). For example, using the `Cond`
|
||||
helper, you can conditionally activate installed plugins
|
||||
([source](https://github.com/asvetliakov/vscode-neovim/issues/415#issuecomment-715533865)):
|
||||
|
||||
```vim
|
||||
" inside plug#begin:
|
||||
" use normal easymotion when in vim mode
|
||||
Plug 'easymotion/vim-easymotion', Cond(!exists('g:vscode'))
|
||||
" use vscode easymotion when in vscode mode
|
||||
Plug 'asvetliakov/vim-easymotion', Cond(exists('g:vscode'), { 'as': 'vsc-easymotion' })
|
||||
```
|
||||
|
||||
### Custom escape keys
|
||||
|
||||
Since VSCode is responsible for insert mode, custom insert-mode vim mappings don't work. To map composite escape keys,
|
||||
put into your keybindings.json:
|
||||
|
||||
for <kbd>jj</kbd>
|
||||
|
||||
```json
|
||||
{
|
||||
"command": "vscode-neovim.compositeEscape1",
|
||||
"key": "j",
|
||||
"when": "neovim.mode == insert && editorTextFocus",
|
||||
"args": "j"
|
||||
}
|
||||
```
|
||||
|
||||
to enable <kbd>jk</kbd> add also:
|
||||
|
||||
```json
|
||||
{
|
||||
"command": "vscode-neovim.compositeEscape2",
|
||||
"key": "k",
|
||||
"when": "neovim.mode == insert && editorTextFocus",
|
||||
"args": "k"
|
||||
}
|
||||
```
|
||||
|
||||
Currently, there is no way to map both `jk` and `kj`, or to map `jk` without also mapping `jj`.
|
||||
|
||||
### Jumplist
|
||||
|
||||
VSCode's jumplist is used instead of Neovim's. This is to make VSCode native navigation (mouse click, jump to
|
||||
definition, ect) navigable through the jumplist.
|
||||
|
||||
Make sure to bind to `workbench.action.navigateBack` / `workbench.action.navigateForward` if you're using custom
|
||||
mappings. Marks (both upper & lowercased) should work fine.
|
||||
|
||||
### Wildmenu completion
|
||||
|
||||
Command menu has the wildmenu completion on type. The completion options appear after 1.5s (to not bother you when you
|
||||
write `:w` or `:noh`). <kbd>Up</kbd>/<kbd>Down</kbd> selects the option and <kbd>Tab</kbd> accepts it. See the gif:
|
||||
|
||||

|
||||
|
||||
### Multiple cursors
|
||||
|
||||
Multiple cursors work in:
|
||||
|
||||
1. Insert mode
|
||||
2. Visual line mode
|
||||
3. Visual block mode
|
||||
|
||||
To spawn multiple cursors from visual line/block modes type <kbd>ma</kbd>/<kbd>mA</kbd> or <kbd>mi</kbd>/<kbd>mI</kbd>
|
||||
(by default). The effect differs:
|
||||
|
||||
- For visual line mode, <kbd>mi</kbd> will start insert mode on each selected line on the first non whitespace
|
||||
character and <kbd>ma</kbd> will on the end of line.
|
||||
- For visual block mode, <kbd>mi</kbd> will start insert on each selected line before the cursor block and
|
||||
<kbd>ma</kbd> after.
|
||||
- <kbd>mA</kbd>/<kbd>mI</kbd> versions accounts for empty lines (only for visual line mode, for visual block mode
|
||||
they're same as <kbd>ma</kbd>/<kbd>mi</kbd>).
|
||||
|
||||
See gif in action:
|
||||
|
||||

|
||||
|
||||
### Keyboard Quickfix
|
||||
|
||||
By default, the quickfix menu can be opened using <kbd>z=</kbd> or <kbd>C-.</kbd>. However, it is currently
|
||||
[not possible](https://github.com/microsoft/vscode/issues/55111) to add mappings to the quickfix menu, so it can only be
|
||||
navigated with arrow keys. A
|
||||
[workaround vscode extension](https://marketplace.visualstudio.com/items?itemName=pascalsenn.keyboard-quickfix) has been
|
||||
made to use the quick open menu, which can be navigated with custom bindings.
|
||||
|
||||
To use, install the
|
||||
[keyboard-quickfix](https://marketplace.visualstudio.com/items?itemName=pascalsenn.keyboard-quickfix) extension, and add
|
||||
to your keybindings.json:
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"key": "ctrl+.",
|
||||
"command": "keyboard-quickfix.openQuickFix",
|
||||
"when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly"
|
||||
},
|
||||
```
|
||||
|
||||
and add to your init.vim:
|
||||
|
||||
```vim
|
||||
nnoremap z= <Cmd>call VSCodeNotify('keyboard-quickfix.openQuickFix')<CR>
|
||||
```
|
||||
|
||||
### Invoking VSCode actions from neovim
|
||||
|
||||
There are a
|
||||
[few helper functions](https://github.com/asvetliakov/vscode-neovim/blob/master/vim/vscode-neovim.vim#L17-L39) that
|
||||
could be used to invoke any vscode commands:
|
||||
|
||||
| Command | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `VSCodeNotify(command, ...)` <br/> `VSCodeCall(command, ...)` | Invoke vscode command with optional arguments. |
|
||||
| `VSCodeNotifyRange(command, line1, line2, leaveSelection ,...)` <br/> `VSCodeCallRange(command, line1, line2, leaveSelection, ...)` | Produce real linewise vscode selection from `line1` to `line2` and invoke vscode command. Put 1 for the `leaveSelection` argument to leave vscode selection after invoking the command. |
|
||||
| `VSCodeNotifyRangePos(command, line1, line2, pos1, pos2, leaveSelection ,...)` <br/> `VSCodeCallRangePos(command, line1, line2, pos1, pos2, leaveSelection, ...)` | Produce real characterwise vscode selection from `line1.pos1` to `line2.pos2` and invoke vscode command. |
|
||||
|
||||
> 💡 Functions with `Notify` in their name are non-blocking, the ones with `Call` are blocking. Generally **use Notify**
|
||||
> unless you really need a blocking call.
|
||||
|
||||
#### Examples
|
||||
|
||||
Produce linewise/characterwise selection and show vscode commands (default binding):
|
||||
|
||||
```vim
|
||||
function! s:openVSCodeCommandsInVisualMode()
|
||||
let mode = mode()
|
||||
if mode ==# 'V'
|
||||
let startLine = line('v')
|
||||
let endLine = line('.')
|
||||
call VSCodeNotifyRange('workbench.action.showCommands', startLine, endLine, 1)
|
||||
else
|
||||
let startPos = getpos('v')
|
||||
let endPos = getpos('.')
|
||||
call VSCodeNotifyRangePos('workbench.action.showCommands', startPos[1], endPos[1], startPos[2], endPos[2] + 1, 1)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
xnoremap <C-P> <Cmd>call <SID>openVSCodeCommandsInVisualMode()<CR>
|
||||
```
|
||||
|
||||
Open definition aside (default binding):
|
||||
|
||||
```vim
|
||||
nnoremap <C-w>gd <Cmd>call VSCodeNotify('editor.action.revealDefinitionAside')<CR>
|
||||
```
|
||||
|
||||
Run Find in files for word under cursor in vscode:
|
||||
|
||||
```vim
|
||||
nnoremap ? <Cmd>call VSCodeNotify('workbench.action.findInFiles', { 'query': expand('<cword>')})<CR>
|
||||
```
|
||||
|
||||
## ⌨️ Bindings
|
||||
|
||||
**Custom keymaps for scrolling/window/tab/etc management**
|
||||
|
||||
- See [vscode-scrolling.vim](https://github.com/asvetliakov/vscode-neovim/blob/HEAD/vim/vscode-scrolling.vim) for scrolling commands reference
|
||||
- See [vscode-file-commands.vim](https://github.com/asvetliakov/vscode-neovim/blob/HEAD/vim/vscode-file-commands.vim) for file commands reference
|
||||
- See [vscode-tab-commands.vim](https://github.com/asvetliakov/vscode-neovim/blob/HEAD/vim/vscode-tab-commands.vim) for tab commands reference
|
||||
- See [vscode-window-commands.vim](https://github.com/asvetliakov/vscode-neovim/blob/HEAD/vim/vscode-window-commands.vim) for window commands reference
|
||||
|
||||
> 💡 "With bang" refers to adding a "!" to the end of a command.
|
||||
|
||||
### File management
|
||||
|
||||
| Command | Description |
|
||||
| ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `e[dit]` / `ex` | Open quickopen. <br/> With filename, e.g. `:e $MYVIMRC`: open the file in new tab. The file must exist. <br/> With bang: revert file to last saved version. <br/> With filename and bang e.g. `:e! $MYVIMRC`: close current file (discard any changes) and open the file. The file must exist. |
|
||||
| `ene[w]` | Create new untitled document in vscode. <br/> With bang: close current file (discard any changes) and create new document. |
|
||||
| `fin[d]` | Open vscode's quick open window. Arguments and count are not supported. |
|
||||
| `w[rite]` | Save current file. With bang: open 'save as' dialog. |
|
||||
| `sav[eas]` | Open 'save as' dialog. |
|
||||
| `wa[ll]` | Save all files. |
|
||||
| `q[uit]` / <kbd>C-w</kbd> <kbd>q</kbd> / <kbd>C-w</kbd> <kbd>c</kbd> / <kbd>ZQ</kbd> | Close the active editor. With bang: revert changes and close the active editor. |
|
||||
| `wq` / <kbd>ZZ</kbd> | Save and close the active editor. |
|
||||
| `qa[ll]` | Close all editors, but don't quit vscode. Acts like `qall!`, so beware for nonsaved changes. |
|
||||
| `wqa[ll]` / `xa[ll]` | Save all editors & close. |
|
||||
|
||||
### Tab management
|
||||
|
||||
| Command | Description |
|
||||
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `tabe[dit]` | Similar to `e[dit]`. Open quickopen. <br/> With argument: open the file in new tab. |
|
||||
| `tabnew` | Open new untitled file. |
|
||||
| `tabf[ind]` | Open quickopen window. |
|
||||
| `tab`/`tabs` | Not supported. Doesn't make sense with vscode. |
|
||||
| `tabc[lose]` | Close active editor (tab). |
|
||||
| `tabo[nly]` | Close other tabs in vscode **group** (pane). This differs from vim where a `tab` is a like a new window, but doesn't make sense in vscode. |
|
||||
| `tabn[ext]` / <kbd>gt</kbd> | Switch to next (or `count` tabs if argument is given) in the active vscode **group** (pane). |
|
||||
| `tabp[revious]` / <kbd>gT</kbd> | Switch to previous (or `count` tabs if argument is given) in the active vscode **group** (pane). |
|
||||
| `tabfir[st]` | Switch to the first tab in the active editor group. |
|
||||
| `tabl[ast]` | Switch to the last tab in the active editor group. |
|
||||
| `tabm[ove]` | Not supported yet. |
|
||||
|
||||
### Buffer/window management
|
||||
|
||||
| Command | Key | Description |
|
||||
| ---------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `sp[lit]` | <kbd>C-w</kbd> <kbd>s</kbd> | Split editor horizontally. <br/> With argument: open the specified file, e.g `:sp $MYVIMRC`. File must exist. |
|
||||
| `vs[plit]` | <kbd>C-w</kbd> <kbd>v</kbd> | Split editor vertically. <br/> With argument: open the specified file. File must exist. |
|
||||
| `new` | <kbd>C-w</kbd> <kbd>n</kbd> | Like `sp[lit]` but create new untitled file if no argument given. |
|
||||
| `vne[w]` | | Like `vs[plit]` but create new untitled file if no argument given. |
|
||||
| | <kbd>C-w</kbd> <kbd>=</kbd> | Align all editors to have the same width. |
|
||||
| | <kbd>C-w</kbd> <kbd>\_</kbd> | Toggle maximized editor size. Pressing again will restore the size. |
|
||||
| | <kbd>[count]</kbd> <kbd>C-w</kbd> <kbd>+</kbd> | Increase editor height by (optional) count. |
|
||||
| | <kbd>[count]</kbd> <kbd>C-w</kbd> <kbd>-</kbd> | Decrease editor height by (optional) count. |
|
||||
| | <kbd>[count]</kbd> <kbd>C-w</kbd> <kbd>></kbd> | Increase editor width by (optional) count. |
|
||||
| | <kbd>[count]</kbd> <kbd>C-w</kbd> <kbd>\<</kbd> | Decrease editor width by (optional) count. |
|
||||
| `on[ly]` | <kbd>C-w</kbd> <kbd>o</kbd> | Without bang: merge all editor groups into the one. Don't close editors. <br/> With bang: close all editors from all groups except current one. |
|
||||
| | <kbd>C-w</kbd> <kbd>j/k/h/l</kbd> | Focus group below/above/left/right. |
|
||||
| | <kbd>C-w</kbd> <kbd>C-j/i/h/l</kbd> | Move editor to group below/above/left/right. <br/> **Note**: <kbd>C-w</kbd> <kbd>C-i</kbd> moves editor up. Ideally it should be <kbd>C-w</kbd> <kbd>C-k</kbd> but vscode has many commands mapped to <kbd>C-k</kbd> <kbd>[key]</kbd> and doesn't allow to use <kbd>C-w</kbd> <kbd>C-k</kbd> without unbinding them first. |
|
||||
| | <kbd>C-w</kbd> <kbd>J/K/H/L</kbd> | Move whole editor group below/above/left/right. |
|
||||
| | <kbd>C-w</kbd> <kbd>w</kbd> or <kbd>C-w</kbd> <kbd>C-w</kbd> | Focus next group. The behavior may differ than in vim. |
|
||||
| | <kbd>C-w</kbd> <kbd>W</kbd> or <kbd>C-w</kbd> <kbd>p</kbd> | Focus previous group. The behavior may differ than in vim. <kbd>C-w</kbd> <kbd>p</kbd> is completely different than in vim. |
|
||||
| | <kbd>C-w</kbd> <kbd>b</kbd> | Focus last editor group (most bottom-right). |
|
||||
| | <kbd>C-w</kbd> <kbd>r/R/x</kbd> | Not supported, use <kbd>C-w</kbd> <kbd>C-j</kbd> and similar to move editors. |
|
||||
|
||||
> 💡 Split size distribution is controlled by `workbench.editor.splitSizing` setting. By default, it's `distribute`,
|
||||
> which is equal to vim's `equalalways` and `eadirection = 'both'` (default).
|
||||
|
||||
To use VSCode command 'Increase/decrease current view size' instead of separate bindings for width and height:
|
||||
|
||||
- `workbench.action.increaseViewSize`
|
||||
- `workbench.action.decreaseViewSize`
|
||||
|
||||
<details>
|
||||
<summary>Copy this into init.vim</summary>
|
||||
|
||||
function! s:manageEditorSize(...)
|
||||
let count = a:1
|
||||
let to = a:2
|
||||
for i in range(1, count ? count : 1)
|
||||
call VSCodeNotify(to ==# 'increase' ? 'workbench.action.increaseViewSize' : 'workbench.action.decreaseViewSize')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Sample keybindings. Note these override default keybindings mentioned above.
|
||||
nnoremap <C-w>> <Cmd>call <SID>manageEditorSize(v:count, 'increase')<CR>
|
||||
xnoremap <C-w>> <Cmd>call <SID>manageEditorSize(v:count, 'increase')<CR>
|
||||
nnoremap <C-w>+ <Cmd>call <SID>manageEditorSize(v:count, 'increase')<CR>
|
||||
xnoremap <C-w>+ <Cmd>call <SID>manageEditorSize(v:count, 'increase')<CR>
|
||||
nnoremap <C-w>< <Cmd>call <SID>manageEditorSize(v:count, 'decrease')<CR>
|
||||
xnoremap <C-w>< <Cmd>call <SID>manageEditorSize(v:count, 'decrease')<CR>
|
||||
nnoremap <C-w>- <Cmd>call <SID>manageEditorSize(v:count, 'decrease')<CR>
|
||||
xnoremap <C-w>- <Cmd>call <SID>manageEditorSize(v:count, 'decrease')<CR>
|
||||
|
||||
</details>
|
||||
|
||||
### Insert mode special keys
|
||||
|
||||
Enabled by `useCtrlKeysForInsertMode` (default true).
|
||||
|
||||
| Key | Description | Status |
|
||||
| ------------------------------------------- | ----------------------------------------------------------------- | --------------------------------- |
|
||||
| <kbd>C-r</kbd> <kbd>[0-9a-z"%#*+:.-=]</kbd> | Paste from register. | Works |
|
||||
| <kbd>C-a</kbd> | Paste previous inserted content. | Works |
|
||||
| <kbd>C-o</kbd> | Switch to normal mode for a single command, then back. | Works |
|
||||
| <kbd>C-u</kbd> | Delete all text till beginning of line. If empty, delete newline. | Bound to VSCode key |
|
||||
| <kbd>C-w</kbd> | Delete word left. | Bound to VSCode key |
|
||||
| <kbd>C-h</kbd> | Delete character left. | Bound to VSCode key |
|
||||
| <kbd>C-t</kbd> | Indent lines right. | Bound to VSCode indent line |
|
||||
| <kbd>C-d</kbd> | Indent lines left. | Bound to VSCode outindent line |
|
||||
| <kbd>C-j</kbd> | Insert line. | Bound to VSCode insert line after |
|
||||
| <kbd>C-c</kbd> | Escape. | Works |
|
||||
|
||||
Other keys are not supported in insert mode.
|
||||
|
||||
### Normal mode control keys
|
||||
|
||||
Enabled by `useCtrlKeysForNormalMode` (default true).
|
||||
|
||||
Refer to vim manual for their use.
|
||||
|
||||
- <kbd>C-a</kbd>
|
||||
- <kbd>C-b</kbd>
|
||||
- <kbd>C-c</kbd>
|
||||
- <kbd>C-d</kbd>
|
||||
- <kbd>C-e</kbd>
|
||||
- <kbd>C-f</kbd>
|
||||
- <kbd>C-i</kbd>
|
||||
- <kbd>C-o</kbd> (to enable, see
|
||||
[this issue](https://github.com/asvetliakov/vscode-neovim/issues/181#issuecomment-585264621))
|
||||
- <kbd>C-r</kbd>
|
||||
- <kbd>C-u</kbd>
|
||||
- <kbd>C-v</kbd>
|
||||
- <kbd>C-w</kbd>
|
||||
- <kbd>C-x</kbd>
|
||||
- <kbd>C-y</kbd>
|
||||
- <kbd>C-]</kbd>
|
||||
- <kbd>C-j</kbd>
|
||||
- <kbd>C-k</kbd>
|
||||
- <kbd>C-l</kbd>
|
||||
- <kbd>C-h</kbd>
|
||||
- <kbd>C-/</kbd>
|
||||
|
||||
### Cmdline special keys
|
||||
|
||||
Always enabled.
|
||||
|
||||
| Key | Desription |
|
||||
| ------------------------------- | --------------------------------------------------------- |
|
||||
| <kbd>C-h</kbd> | Delete one character left. |
|
||||
| <kbd>C-w</kbd> | Delete word left. |
|
||||
| <kbd>C-u</kbd> | Clear line. |
|
||||
| <kbd>C-g</kbd> / <kbd>C-t</kbd> | In incsearch mode moves to next/previous result. |
|
||||
| <kbd>C-l</kbd> | Add next character under the cursor to incsearch. |
|
||||
| <kbd>C-n</kbd> / <kbd>C-p</kbd> | Go down/up history. |
|
||||
| <kbd>Up</kbd> / <kbd>Down</kbd> | Select next/prev suggestion (cannot be used for history). |
|
||||
| <kbd>Tab</kbd> | Select suggestion. |
|
||||
|
||||
### VSCode specific bindings
|
||||
|
||||
#### Editor command
|
||||
|
||||
| Key | VSCode Command |
|
||||
| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| <kbd>=</kbd> / <kbd>==</kbd> | `editor.action.formatSelection` |
|
||||
| <kbd>gh</kbd> / <kbd>K</kbd> | `editor.action.showHover` |
|
||||
| <kbd>gd</kbd> / <kbd>C-]</kbd> | `editor.action.revealDefinition` <br/> Also works in vim help. |
|
||||
| <kbd>gf</kbd> | `editor.action.revealDeclaration` |
|
||||
| <kbd>gH</kbd> | `editor.action.referenceSearch.trigger` |
|
||||
| <kbd>gO</kbd> | `workbench.action.gotoSymbol` |
|
||||
| <kbd>C-w</kbd> <kbd>gd</kbd> / <kbd>C-w</kbd> <kbd>gf</kbd> | `editor.action.revealDefinitionAside` |
|
||||
| <kbd>gD</kbd> | `editor.action.peekDefinition` |
|
||||
| <kbd>gF</kbd> | `editor.action.peekDeclaration` |
|
||||
| <kbd>Tab</kbd> | `togglePeekWidgetFocus` <br/> Switch between peek editor and reference list. |
|
||||
| <kbd>C-n</kbd> / <kbd>C-p</kbd> | Navigate lists, parameter hints, suggestions, quick-open, cmdline history, peek reference list |
|
||||
|
||||
> 💡 To specify the default peek mode, modify `editor.peekWidgetDefaultFocus` in your settings.
|
||||
|
||||
#### Explorer/list navigation
|
||||
|
||||
| Key | VSCode Command |
|
||||
| ---------------------------------- | ------------------------------- |
|
||||
| <kbd>j</kbd> / <kbd>k</kbd> | `list.focusDown/Up` |
|
||||
| <kbd>h</kbd> / <kbd>l</kbd> | `list.collapse/select` |
|
||||
| <kbd>Enter</kbd> | `list.select` |
|
||||
| <kbd>gg</kbd> | `list.focusFirst` |
|
||||
| <kbd>G</kbd> | `list.focusLast` |
|
||||
| <kbd>o</kbd> | `list.toggleExpand` |
|
||||
| <kbd>C-u</kbd> / <kbd>C-d</kbd> | `list.focusPageUp/Down` |
|
||||
| <kbd> / </kbd> / <kbd>Escape</kbd> | `list.toggleKeyboardNavigation` |
|
||||
|
||||
> 💡 To enable explorer list navigation, add `"workbench.list.automaticKeyboardNavigation": false` to your
|
||||
> `settings.json`.
|
||||
|
||||
#### Explorer file manipulation
|
||||
|
||||
| Key | VSCode Command |
|
||||
| ------------ | --------------------- |
|
||||
| <kbd>r</kbd> | `renameFile` |
|
||||
| <kbd>d</kbd> | `deleteFile` |
|
||||
| <kbd>y</kbd> | `filesExplorer.copy` |
|
||||
| <kbd>x</kbd> | `filesExplorer.cut` |
|
||||
| <kbd>p</kbd> | `filesExplorer.paste` |
|
||||
| <kbd>v</kbd> | `explorer.openToSide` |
|
||||
| <kbd>a</kbd> | `explorer.newFile` |
|
||||
| <kbd>A</kbd> | `explorer.newFolder` |
|
||||
|
||||
### Custom keybindings
|
||||
|
||||
Control keys which are not in the above tables are not sent to neovim by default. To pass additional ctrl keys to
|
||||
neovim, for example <kbd>C-Tab</kbd>, add to your keybindings.json:
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"command": "vscode-neovim.send",
|
||||
// the key sequence to activate the binding
|
||||
"key": "ctrl+tab",
|
||||
// don't activate during insert mode
|
||||
"when": "editorTextFocus && neovim.mode != insert",
|
||||
// the input to send to neovim
|
||||
"args": "<C-Tab>"
|
||||
}
|
||||
```
|
||||
|
||||
To disable existing an ctrl key sequence, for example <kbd>C-A</kbd> add to your keybindings.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"command": "-vscode-neovim.send",
|
||||
"key": "ctrl+a"
|
||||
}
|
||||
```
|
||||
|
||||
## 🤝 Vim Plugins
|
||||
|
||||
Most vim plugins will work out of the box, but certain plugins may require some fixes to work properly.
|
||||
|
||||
### vim-easymotion
|
||||
|
||||
While the original [vim-easymotion](https://github.com/easymotion/vim-easymotion) functions as expected, it works by
|
||||
replacing your text with markers then restoring back, which leads to broken text and many errors reported in VSCode.
|
||||
|
||||
For this reason I created the special [vim-easymotion fork](https://github.com/asvetliakov/vim-easymotion) which doesn't
|
||||
touch your text and instead use vscode text decorations. Just add my fork to your `vim-plug` block or by using your
|
||||
favorite vim plugin installer and delete original vim-easymotion. Also overwin motions won't work (obviously) so don't
|
||||
use them.
|
||||
|
||||
By default, text decorations will appear behind of the associated text as shown in the screenshot. To show the
|
||||
decorations on top of the text, set `vscode-neovim.textDecorationsAtTop` to true.
|
||||
|
||||
Happy jumping!
|
||||
|
||||

|
||||
|
||||
### vim-commentary
|
||||
|
||||
You can use [vim-commentary](https://github.com/tpope/vim-commentary) if you like it. But vscode already has such
|
||||
functionality so why don't use it? Add to your init.vim/init.nvim:
|
||||
|
||||
```vim
|
||||
xmap gc <Plug>VSCodeCommentary
|
||||
nmap gc <Plug>VSCodeCommentary
|
||||
omap gc <Plug>VSCodeCommentary
|
||||
nmap gcc <Plug>VSCodeCommentaryLine
|
||||
```
|
||||
|
||||
Similar to vim-commentary, gcc is comment line (accept count), use gc with motion/in visual mode. `VSCodeCommentary` is
|
||||
just a simple function which calls `editor.action.commentLine`.
|
||||
|
||||
### quick-scope
|
||||
|
||||
[quick-scope](https://github.com/unblevable/quick-scope) plugin uses default vim HL groups by default but they are
|
||||
normally ignored. To fix, add
|
||||
|
||||
```vim
|
||||
highlight QuickScopePrimary guifg='#afff5f' gui=underline ctermfg=155 cterm=underline
|
||||
highlight QuickScopeSecondary guifg='#5fffff' gui=underline ctermfg=81 cterm=underline
|
||||
```
|
||||
|
||||
to your init.vim. The underline color can be changed by the `guisp` tag.
|
||||
|
||||
## 📑 How it works
|
||||
|
||||
- VScode connects to neovim instance
|
||||
- When opening a some file, a scratch buffer is created in nvim and being init with text content from vscode
|
||||
- Normal/visual mode commands are being sent directly to neovim. The extension listens for buffer events and applies
|
||||
edits from neovim
|
||||
- When entering the insert mode, the extensions stops listen for keystroke events and delegates typing mode to vscode
|
||||
(no neovim communication is being performed here)
|
||||
- After pressing escape key from the insert mode, extension sends changes obtained from the insert mode to neovim
|
||||
|
||||
## ❤️ Credits & External Resources
|
||||
|
||||
- [vim-altercmd](https://github.com/kana/vim-altercmd) - Used for rebinding default commands to call vscode command
|
||||
- [neovim nodejs client](https://github.com/neovim/node-client) - NodeJS library for communicating with Neovim
|
||||
- [VSCodeVim](https://github.com/VSCodeVim/Vim) - Used for various inspiration
|
||||
|
|
@ -1 +0,0 @@
|
|||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 199 KiB |
|
Before Width: | Height: | Size: 574 KiB |
|
|
@ -1,200 +0,0 @@
|
|||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
|
|
@ -1,200 +0,0 @@
|
|||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
|
|
@ -1,200 +0,0 @@
|
|||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is lineThis is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
This is line
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
.vim-flavor
|
||||
Gemfile.lock
|
||||
VimFlavor.lock
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
language: ruby
|
||||
rvm:
|
||||
- 2.1.5
|
||||
script: rake ci
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
gem 'vim-flavor', '~> 2.0'
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
#!/usr/bin/env rake
|
||||
|
||||
task :ci => [:dump, :test]
|
||||
|
||||
task :dump do
|
||||
sh 'vim --version'
|
||||
end
|
||||
|
||||
task :test do
|
||||
sh 'bundle exec vim-flavor test'
|
||||
end
|
||||
|
|
@ -1 +0,0 @@
|
|||
# No dependencies.
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
" altercmd - Alter built-in Ex commands by your own ones
|
||||
" Version: 0.0.1
|
||||
" Copyright (C) 2009-2015 Kana Natsuno <http://whileimautomaton.net/>
|
||||
" License: MIT license {{{
|
||||
" Permission is hereby granted, free of charge, to any person obtaining
|
||||
" a copy of this software and associated documentation files (the
|
||||
" "Software"), to deal in the Software without restriction, including
|
||||
" without limitation the rights to use, copy, modify, merge, publish,
|
||||
" distribute, sublicense, and/or sell copies of the Software, and to
|
||||
" permit persons to whom the Software is furnished to do so, subject to
|
||||
" the following conditions:
|
||||
"
|
||||
" The above copyright notice and this permission notice shall be included
|
||||
" in all copies or substantial portions of the Software.
|
||||
"
|
||||
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
" }}}
|
||||
" Interface "{{{1
|
||||
function! altercmd#define(...) "{{{2
|
||||
let [buffer, original_name, alternate_name]
|
||||
\ = (a:000[0] ==? '<buffer>' ? [] : ['']) + a:000
|
||||
|
||||
if original_name =~ '\['
|
||||
let [original_name_head, original_name_tail] = split(original_name, '[')
|
||||
let original_name_tail = substitute(original_name_tail, '\]', '', '')
|
||||
else
|
||||
let original_name_head = original_name
|
||||
let original_name_tail = ''
|
||||
endif
|
||||
|
||||
let original_name_tail = ' ' . original_name_tail
|
||||
for i in range(len(original_name_tail))
|
||||
let lhs = original_name_head . original_name_tail[1:i]
|
||||
execute 'cnoreabbrev <expr>' buffer lhs
|
||||
\ '(getcmdtype() == ":" && getcmdline() ==# "' . lhs . '")'
|
||||
\ '?' ('"' . alternate_name . '"')
|
||||
\ ':' ('"' . lhs . '"')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
|
||||
|
||||
|
||||
function! altercmd#load() "{{{2
|
||||
runtime plugin/altercmd.vim
|
||||
endfunction
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
" __END__ "{{{1
|
||||
" vim: foldmethod=marker
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
*altercmd.txt* Alter built-in Ex commands by your own ones
|
||||
|
||||
Version 0.0.1
|
||||
Script ID: 2675
|
||||
Copyright (C) 2009-2015 Kana Natsuno <http://whileimautomaton.net/>
|
||||
License: MIT license {{{
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
}}}
|
||||
|
||||
CONTENTS *altercmd-contents*
|
||||
|
||||
Introduction |altercmd-introduction|
|
||||
Interface |altercmd-interface|
|
||||
Commands |altercmd-commands|
|
||||
Functions |altercmd-functions|
|
||||
Bugs |altercmd-bugs|
|
||||
Changelog |altercmd-changelog|
|
||||
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *altercmd-introduction*
|
||||
|
||||
*altercmd* is a Vim plugin to provide an easy way to alternate built-in Ex
|
||||
commands by user-defined Ex commands. This plugin provides |:AlterCommand|
|
||||
for this purpose. For example, if you define :CD, a custom version of |:cd|,
|
||||
add the following in your vimrc.
|
||||
>
|
||||
AlterCommand cd CD
|
||||
<
|
||||
With the above setting, you can use :cd as if it is :CD. It means that :CD
|
||||
will be automatically inserted if you type :cd as an Ex command, so you don't
|
||||
have to type :CD to use :cd and you'll never encounter mistyping :cd and :CD.
|
||||
|
||||
:AlterCommand also supports partial command names. For example, |:help| can
|
||||
be invoked with :h, :he, :hel or :help.
|
||||
>
|
||||
AlterCommand h[elp] HELP
|
||||
<
|
||||
With the above setting, you can use :h, :he, :hel and :help as if they are
|
||||
:HELP, your own version of :help.
|
||||
|
||||
|
||||
Requirements:
|
||||
- Vim 7.2 or later
|
||||
|
||||
Latest version:
|
||||
https://github.com/kana/vim-altercmd
|
||||
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
INTERFACE *altercmd-interface*
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
COMMANDS *altercmd-commands*
|
||||
|
||||
*:AlterCommand*
|
||||
:AlterCommand [<buffer>] {original} {alternative}
|
||||
Declare to use {alternative} Ex command instead of
|
||||
{original} Ex command.
|
||||
|
||||
If <buffer> is given, this declaration is only
|
||||
available for the current buffer. Otherwise, this
|
||||
declaration is available globally.
|
||||
|
||||
See also |altercmd-introduction| for examples.
|
||||
|
||||
Technically, this Ex command does just define some
|
||||
|abbreviations| in Command-line mode.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
FUNCTIONS *altercmd-functions*
|
||||
|
||||
altercmd#define({original}, {alternative}) *altercmd#define()*
|
||||
altercmd#define('<buffer>', {original}, {alternative})
|
||||
Function version of |:AlterCommand|.
|
||||
|
||||
altercmd#load() *altercmd#load()*
|
||||
Load this plugin. You have to call this in your vimrc
|
||||
if you want to use |:AlterCommand| in your vimrc.
|
||||
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
BUGS *altercmd-bugs*
|
||||
|
||||
- Not all cases are supported. For example:
|
||||
|
||||
- [range] is not supported yet. If [range] is given, altercmd doesn't work.
|
||||
|
||||
- If any argument is not given to an Ex command which has an alternative Ex
|
||||
command, altercmd doesn't work.
|
||||
|
||||
- And there may be more cases where altercmd doesn't work well.
|
||||
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
CHANGELOG *altercmd-changelog*
|
||||
|
||||
0.0.1 2015-01-31T23:52:24+09:00
|
||||
- Fix a bug that buffer-local |:AlterCommand| could not be defined.
|
||||
|
||||
0.0.0 2009-06-14T03:47:25+09:00
|
||||
- Initial version.
|
||||
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:fen:fdl=0:fdm=marker:
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
" altercmd - Alter built-in Ex commands by your own ones
|
||||
" Version: 0.0.1
|
||||
" Copyright (C) 2009-2015 Kana Natsuno <http://whileimautomaton.net/>
|
||||
" License: MIT license {{{
|
||||
" Permission is hereby granted, free of charge, to any person obtaining
|
||||
" a copy of this software and associated documentation files (the
|
||||
" "Software"), to deal in the Software without restriction, including
|
||||
" without limitation the rights to use, copy, modify, merge, publish,
|
||||
" distribute, sublicense, and/or sell copies of the Software, and to
|
||||
" permit persons to whom the Software is furnished to do so, subject to
|
||||
" the following conditions:
|
||||
"
|
||||
" The above copyright notice and this permission notice shall be included
|
||||
" in all copies or substantial portions of the Software.
|
||||
"
|
||||
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
" }}}
|
||||
|
||||
if exists('g:loaded_altercmd')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
|
||||
|
||||
command! -bar -complete=command -nargs=* AlterCommand
|
||||
\ call altercmd#define(<f-args>)
|
||||
|
||||
|
||||
|
||||
|
||||
let g:loaded_altercmd = 1
|
||||
|
||||
" __END__
|
||||
" vim: foldmethod=marker
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
call altercmd#define('full', 'F-U-L-L')
|
||||
call altercmd#define('ab[br]', 'A-B-B-R')
|
||||
|
||||
function! RecordTheCurrentCommandLine()
|
||||
let g:cmdline = getcmdline()
|
||||
return ''
|
||||
endfunction
|
||||
cnoremap <expr> {X} RecordTheCurrentCommandLine()
|
||||
|
||||
function! Test(lhs, rhs)
|
||||
let g:cmdline = ''
|
||||
silent execute 'normal' ":".a:lhs."\<C-]>{X}\<C-c>"
|
||||
Expect g:cmdline ==# a:rhs
|
||||
endfunction
|
||||
|
||||
describe 'altercmd#define'
|
||||
it 'replaces a built-in command'
|
||||
call Test('full', 'F-U-L-L')
|
||||
end
|
||||
|
||||
it 'replaces all abbreviated names of a built-in command'
|
||||
call Test('ab', 'A-B-B-R')
|
||||
call Test('abb', 'A-B-B-R')
|
||||
call Test('abbr', 'A-B-B-R')
|
||||
end
|
||||
|
||||
it 'supports <buffer>'
|
||||
silent edit 'test-A'
|
||||
call altercmd#define('<buffer>', 'ctx', 'Axe')
|
||||
silent edit 'test-B'
|
||||
call altercmd#define('<buffer>', 'ctx', 'Bow')
|
||||
silent edit 'test-C'
|
||||
call altercmd#define('<buffer>', 'ctx', 'Club')
|
||||
|
||||
silent edit 'test-A'
|
||||
call Test('full', 'F-U-L-L')
|
||||
call Test('ctx', 'Axe')
|
||||
silent edit 'test-B'
|
||||
call Test('full', 'F-U-L-L')
|
||||
call Test('ctx', 'Bow')
|
||||
silent edit 'test-C'
|
||||
call Test('full', 'F-U-L-L')
|
||||
call Test('ctx', 'Club')
|
||||
end
|
||||
end
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
function! s:vscodeFormat(...) abort
|
||||
if !a:0
|
||||
let &operatorfunc = matchstr(expand('<sfile>'), '[^. ]*$')
|
||||
return 'g@'
|
||||
elseif a:0 > 1
|
||||
let [line1, line2] = [a:1, a:2]
|
||||
else
|
||||
let [line1, line2] = [line("'["), line("']")]
|
||||
endif
|
||||
|
||||
call VSCodeCallRange('editor.action.formatSelection', line1, line2, 0)
|
||||
endfunction
|
||||
|
||||
function! s:vscodeCommentary(...) abort
|
||||
if !a:0
|
||||
let &operatorfunc = matchstr(expand('<sfile>'), '[^. ]*$')
|
||||
return 'g@'
|
||||
elseif a:0 > 1
|
||||
let [line1, line2] = [a:1, a:2]
|
||||
else
|
||||
let [line1, line2] = [line("'["), line("']")]
|
||||
endif
|
||||
|
||||
call VSCodeCallRange('editor.action.commentLine', line1, line2, 0)
|
||||
endfunction
|
||||
|
||||
function! s:vscodeGoToDefinition(str)
|
||||
if exists('b:vscode_controlled') && b:vscode_controlled
|
||||
call VSCodeNotify('editor.action.reveal' . a:str)
|
||||
else
|
||||
" Allow to funcionar in help files
|
||||
exe "normal! \<C-]>"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:openVSCodeCommandsInVisualMode()
|
||||
let mode = mode()
|
||||
if mode ==# 'V'
|
||||
let startLine = line('v')
|
||||
let endLine = line('.')
|
||||
call VSCodeNotifyRange('workbench.action.showCommands', startLine, endLine, 1)
|
||||
else
|
||||
let startPos = getpos('v')
|
||||
let endPos = getpos('.')
|
||||
call VSCodeNotifyRangePos('workbench.action.showCommands', startPos[1], endPos[1], startPos[2], endPos[2] + 1, 1)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
command! -range -bar VSCodeCommentary call s:vscodeCommentary(<line1>, <line2>)
|
||||
|
||||
xnoremap <expr> <Plug>VSCodeCommentary <SID>vscodeCommentary()
|
||||
nnoremap <expr> <Plug>VSCodeCommentary <SID>vscodeCommentary()
|
||||
nnoremap <expr> <Plug>VSCodeCommentaryLine <SID>vscodeCommentary() . '_'
|
||||
|
||||
" Bind format to vscode format selection
|
||||
xnoremap <expr> = <SID>vscodeFormat()
|
||||
nnoremap <expr> = <SID>vscodeFormat()
|
||||
nnoremap <expr> == <SID>vscodeFormat() . '_'
|
||||
|
||||
" gf/gF . Map to go to definition for now
|
||||
nnoremap K <Cmd>call VSCodeNotify('editor.action.showHover')<CR>
|
||||
nnoremap gh <Cmd>call VSCodeNotify('editor.action.showHover')<CR>
|
||||
nnoremap gf <Cmd>call <SID>vscodeGoToDefinition("Declaration")<CR>
|
||||
nnoremap gd <Cmd>call <SID>vscodeGoToDefinition("Definition")<CR>
|
||||
nnoremap <C-]> <Cmd>call <SID>vscodeGoToDefinition("Definition")<CR>
|
||||
nnoremap gO <Cmd>call VSCodeNotify('workbench.action.gotoSymbol')<CR>
|
||||
nnoremap gF <Cmd>call VSCodeNotify('editor.action.peekDeclaration')<CR>
|
||||
nnoremap gD <Cmd>call VSCodeNotify('editor.action.peekDefinition')<CR>
|
||||
nnoremap gH <Cmd>call VSCodeNotify('editor.action.referenceSearch.trigger')<CR>
|
||||
|
||||
xnoremap K <Cmd>call VSCodeNotify('editor.action.showHover')<CR>
|
||||
xnoremap gh <Cmd>call VSCodeNotify('editor.action.showHover')<CR>
|
||||
xnoremap gf <Cmd>call <SID>vscodeGoToDefinition("Declaration")<CR>
|
||||
xnoremap gd <Cmd>call <SID>vscodeGoToDefinition("Definition")<CR>
|
||||
xnoremap <C-]> <Cmd>call <SID>vscodeGoToDefinition("Definition")<CR>
|
||||
xnoremap gO <Cmd>call VSCodeNotify('workbench.action.gotoSymbol')<CR>
|
||||
xnoremap gF <Cmd>call VSCodeNotify('editor.action.peekDeclaration')<CR>
|
||||
xnoremap gD <Cmd>call VSCodeNotify('editor.action.peekDefinition')<CR>
|
||||
xnoremap gH <Cmd>call VSCodeNotify('editor.action.referenceSearch.trigger')<CR>
|
||||
|
||||
" <C-w> gf opens definition on the side
|
||||
nnoremap <C-w>gf <Cmd>call VSCodeNotify('editor.action.revealDefinitionAside')<CR>
|
||||
nnoremap <C-w>gd <Cmd>call VSCodeNotify('editor.action.revealDefinitionAside')<CR>
|
||||
xnoremap <C-w>gf <Cmd>call VSCodeNotify('editor.action.revealDefinitionAside')<CR>
|
||||
xnoremap <C-w>gd <Cmd>call VSCodeNotify('editor.action.revealDefinitionAside')<CR>
|
||||
|
||||
" Bind C-/ to vscode commentary since calling from vscode produces double comments due to multiple cursors
|
||||
xnoremap <expr> <C-/> <SID>vscodeCommentary()
|
||||
nnoremap <expr> <C-/> <SID>vscodeCommentary() . '_'
|
||||
|
||||
" open quickfix menu for spelling corrections and refactoring
|
||||
" only keyboard arrows can be used to navigate, for a solution, see https://github.com/asvetliakov/vscode-neovim#keyboard-quickfix
|
||||
nnoremap z= <Cmd>call VSCodeNotify('editor.action.quickFix')<CR>
|
||||
|
||||
" workaround for calling command picker in visual mode
|
||||
xnoremap <C-P> <Cmd>call <SID>openVSCodeCommandsInVisualMode()<CR>
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
|
||||
function! s:editOrNew(...)
|
||||
let file = a:1
|
||||
let bang = a:2
|
||||
|
||||
if empty(file)
|
||||
if bang ==# '!'
|
||||
call VSCodeNotify('workbench.action.files.revert')
|
||||
else
|
||||
call VSCodeNotify('workbench.action.quickOpen')
|
||||
endif
|
||||
else
|
||||
" Last arg is to close previous file, e.g. e! ~/blah.txt will open blah.txt instead the current file
|
||||
call VSCodeExtensionNotify('open-file', expand(file), bang ==# '!' ? 1 : 0)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:saveAndClose() abort
|
||||
call VSCodeCall('workbench.action.files.save')
|
||||
call VSCodeNotify('workbench.action.closeActiveEditor')
|
||||
endfunction
|
||||
|
||||
function! s:saveAllAndClose() abort
|
||||
call VSCodeCall('workbench.action.files.saveAll')
|
||||
call VSCodeNotify('workbench.action.closeAllEditors')
|
||||
endfunction
|
||||
|
||||
" command! -bang -nargs=? Edit call VSCodeCall('workbench.action.quickOpen')
|
||||
command! -complete=file -bang -nargs=? Edit call <SID>editOrNew(<q-args>, <q-bang>)
|
||||
command! -bang -nargs=? Ex call <SID>editOrNew(<q-args>, <q-bang>)
|
||||
command! -bang Enew call <SID>editOrNew('__vscode_new__', <q-bang>)
|
||||
command! -bang Find call VSCodeNotify('workbench.action.quickOpen')
|
||||
|
||||
command! -complete=file -bang Write if <q-bang> ==# '!' | call VSCodeNotify('workbench.action.files.saveAs') | else | call VSCodeNotify('workbench.action.files.save') | endif
|
||||
command! -bang Saveas call VSCodeNotify('workbench.action.files.saveAs')
|
||||
|
||||
command! -bang Wall call VSCodeNotify('workbench.action.files.saveAll')
|
||||
command! -bang Quit if <q-bang> ==# '!' | call VSCodeNotify('workbench.action.revertAndCloseActiveEditor') | else | call VSCodeNotify('workbench.action.closeActiveEditor') | endif
|
||||
|
||||
command! -bang Wq call <SID>saveAndClose()
|
||||
command! -bang Xit call <SID>saveAndClose()
|
||||
|
||||
command! -bang Qall call VSCodeNotify('workbench.action.closeAllEditors')
|
||||
|
||||
command! -bang Wqall call <SID>saveAllAndClose()
|
||||
command! -bang Xall call <SID>saveAllAndClose()
|
||||
|
||||
AlterCommand e[dit] Edit
|
||||
AlterCommand ex Ex
|
||||
AlterCommand ene[w] Enew
|
||||
AlterCommand fin[d] Find
|
||||
AlterCommand w[rite] Write
|
||||
AlterCommand sav[eas] Saveas
|
||||
AlterCommand wa[ll] Wall
|
||||
AlterCommand q[uit] Quit
|
||||
AlterCommand wq Wq
|
||||
AlterCommand x[it] Xit
|
||||
AlterCommand qa[ll] Qall
|
||||
AlterCommand wqa[ll] Wqall
|
||||
AlterCommand xa[ll] Xall
|
||||
|
||||
nnoremap ZZ <Cmd>Wq<CR>
|
||||
nnoremap ZQ <Cmd>Quit!<CR>
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
|
||||
function! s:vscodePrepareMultipleCursors(append, skipEmpty)
|
||||
let m = mode()
|
||||
if m ==# 'V' || m ==# "\<C-v>"
|
||||
let b:notifyMultipleCursors = 1
|
||||
let b:multipleCursorsVisualMode = m
|
||||
let b:multipleCursorsAppend = a:append
|
||||
let b:multipleCursorsSkipEmpty = a:skipEmpty
|
||||
" We need to start insert, then spawn cursors otherwise they'll be destroyed
|
||||
" using feedkeys() here because :startinsert is being delayed
|
||||
call feedkeys("\<Esc>i", 'n')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:vscodeNotifyMultipleCursors()
|
||||
if exists('b:notifyMultipleCursors') && b:notifyMultipleCursors
|
||||
let b:notifyMultipleCursors = 0
|
||||
call VSCodeExtensionNotify('visual-edit', b:multipleCursorsAppend, b:multipleCursorsVisualMode, line("'<"), line("'>"), col("'>"), b:multipleCursorsSkipEmpty)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
augroup MultipleCursors
|
||||
autocmd!
|
||||
autocmd InsertEnter * call <SID>vscodeNotifyMultipleCursors()
|
||||
augroup END
|
||||
|
||||
" Multiple cursors support for visual line/block modes
|
||||
xnoremap ma <Cmd>call <SID>vscodePrepareMultipleCursors(1, 1)<CR>
|
||||
xnoremap mi <Cmd>call <SID>vscodePrepareMultipleCursors(0, 1)<CR>
|
||||
xnoremap mA <Cmd>call <SID>vscodePrepareMultipleCursors(1, 0)<CR>
|
||||
xnoremap mI <Cmd>call <SID>vscodePrepareMultipleCursors(0, 0)<CR>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
nnoremap <C-o> <Cmd>call VSCodeNotify("workbench.action.navigateBack")<CR>
|
||||
nnoremap <C-i> <Cmd>call VSCodeNotify("workbench.action.navigateForward")<CR>
|
||||
nnoremap <Tab> <Cmd>call VSCodeNotify("workbench.action.navigateForward")<CR>
|
||||
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
function! s:toFirstCharOfScreenLine()
|
||||
call VSCodeNotify('cursorMove', { 'to': 'wrappedLineFirstNonWhitespaceCharacter' })
|
||||
endfunction
|
||||
|
||||
function! s:toLastCharOfScreenLine()
|
||||
call VSCodeNotify('cursorMove', { 'to': 'wrappedLineLastNonWhitespaceCharacter' })
|
||||
" Offfset cursor moving to the right caused by calling VSCode command in Vim mode
|
||||
call VSCodeNotify('cursorLeft')
|
||||
endfunction
|
||||
|
||||
nnoremap g0 <Cmd>call <SID>toFirstCharOfScreenLine()<CR>
|
||||
nnoremap g$ <Cmd>call <SID>toLastCharOfScreenLine()<CR>
|
||||
|
||||
" Note: Using these in macro will break it
|
||||
nnoremap gk <Cmd>call VSCodeNotify('cursorMove', { 'to': 'up', 'by': 'wrappedLine', 'value': v:count ? v:count : 1 })<CR>
|
||||
nnoremap gj <Cmd>call VSCodeNotify('cursorMove', { 'to': 'down', 'by': 'wrappedLine', 'value': v:count ? v:count : 1 })<CR>
|
||||
|
|
@ -1,153 +0,0 @@
|
|||
" Set global flag to allow checking in custom user config
|
||||
let g:vscode = 1
|
||||
|
||||
let s:currDir = fnamemodify(resolve(expand('<sfile>:p')), ':h')
|
||||
" Adjust rtp path
|
||||
let &runtimepath = &runtimepath . ',' . s:currDir . '/vim-altercmd'
|
||||
|
||||
" Used to execute vscode command
|
||||
let s:vscodeCommandEventName = 'vscode-command'
|
||||
" Used to execute vscode command with some range (the specified range will be selected and the command will be executed on this range)
|
||||
let s:vscodeRangeCommandEventName = 'vscode-range-command'
|
||||
" Used for externsion inter-communications
|
||||
let s:vscodePluginEventName = 'vscode-neovim'
|
||||
|
||||
" RPC and global functions
|
||||
|
||||
function! VSCodeCall(cmd, ...) abort
|
||||
call rpcrequest(g:vscode_channel, s:vscodeCommandEventName, a:cmd, a:000)
|
||||
endfunction
|
||||
|
||||
function! VSCodeCallRange(cmd, line1, line2, leaveSelection, ...) abort
|
||||
call rpcrequest(g:vscode_channel, s:vscodeRangeCommandEventName, a:cmd, a:line1, a:line2, 0, 0, a:leaveSelection, a:000)
|
||||
endfunction
|
||||
|
||||
function! VSCodeCallRangePos(cmd, line1, line2, pos1, pos2, leaveSelection, ...) abort
|
||||
call rpcrequest(g:vscode_channel, s:vscodeRangeCommandEventName, a:cmd, a:line1, a:line2, a:pos1, a:pos2, a:leaveSelection, a:000)
|
||||
endfunction
|
||||
|
||||
function! VSCodeNotify(cmd, ...)
|
||||
call rpcnotify(g:vscode_channel, s:vscodeCommandEventName, a:cmd, a:000)
|
||||
endfunction
|
||||
|
||||
function! VSCodeNotifyRange(cmd, line1, line2, leaveSelection, ...)
|
||||
call rpcnotify(g:vscode_channel, s:vscodeRangeCommandEventName, a:cmd, a:line1, a:line2, 0, 0, a:leaveSelection, a:000)
|
||||
endfunction
|
||||
|
||||
function! VSCodeNotifyRangePos(cmd, line1, line2, pos1, pos2, leaveSelection, ...)
|
||||
call rpcnotify(g:vscode_channel, s:vscodeRangeCommandEventName, a:cmd, a:line1, a:line2, a:pos1, a:pos2, a:leaveSelection, a:000)
|
||||
endfunction
|
||||
|
||||
function! VSCodeExtensionCall(cmd, ...) abort
|
||||
call rpcrequest(g:vscode_channel, s:vscodePluginEventName, a:cmd, a:000)
|
||||
endfunction
|
||||
|
||||
function! VSCodeExtensionNotify(cmd, ...) abort
|
||||
call rpcnotify(g:vscode_channel, s:vscodePluginEventName, a:cmd, a:000)
|
||||
endfunction
|
||||
|
||||
" Called from extension when opening/creating new file in vscode to reset undo tree
|
||||
function! VSCodeClearUndo(bufId)
|
||||
let oldlevels = &undolevels
|
||||
call nvim_buf_set_option(a:bufId, 'undolevels', -1)
|
||||
call nvim_buf_set_lines(a:bufId, 0, 0, 0, [])
|
||||
call nvim_buf_set_option(a:bufId, 'undolevels', oldlevels)
|
||||
unlet oldlevels
|
||||
endfunction
|
||||
|
||||
" Called from extension to align screen row in neovim after scrolling
|
||||
" function! VSCodeAlignScreenRow(row)
|
||||
" let currentRow = winline()
|
||||
" let diff = abs(currentRow - a:row)
|
||||
" if diff > 0
|
||||
" if (a:row - currentRow) < 0
|
||||
" if diff > 1
|
||||
" silent! exe "normal! " . diff . "\<C-e>"
|
||||
" else
|
||||
" silent! exe "normal! \<C-e>"
|
||||
" endif
|
||||
" else
|
||||
" if diff > 1
|
||||
" silent! exe "normal! " . diff . "\<C-y>"
|
||||
" else
|
||||
" silent! exe "normal! \<C-y>"
|
||||
" endif
|
||||
" endif
|
||||
" endif
|
||||
" endfunction
|
||||
|
||||
" Set text decorations for given ranges. Used in easymotion
|
||||
function! VSCodeSetTextDecorations(hlName, rowsCols)
|
||||
call VSCodeExtensionNotify('text-decorations', a:hlName, a:rowsCols)
|
||||
endfunction
|
||||
|
||||
" Used for ctrl-a insert keybinding
|
||||
function! VSCodeGetLastInsertText()
|
||||
let [lineStart, colStart] = getpos("'[")[1:2]
|
||||
let [lineEnd, colEnd] = getpos("']")[1:2]
|
||||
if (lineStart == 0)
|
||||
return []
|
||||
endif
|
||||
let lines = getline(lineStart, lineEnd)
|
||||
let lines[0] = lines[0][colStart - 1:]
|
||||
let lines[-1] = lines[-1][:colEnd - 1]
|
||||
return lines
|
||||
endfunction
|
||||
|
||||
" Used for ctrl-r [reg] insert keybindings
|
||||
function! VSCodeGetRegister(reg)
|
||||
return getreg(a:reg)
|
||||
endfunction
|
||||
|
||||
" This is called by extension when created new buffer
|
||||
function! s:onBufEnter(name, id)
|
||||
if exists('b:vscode_temp') && b:vscode_temp
|
||||
return
|
||||
endif
|
||||
set conceallevel=0
|
||||
let tabstop = &tabstop
|
||||
let isJumping = 0
|
||||
if exists('g:isJumping')
|
||||
let isJumping = g:isJumping
|
||||
endif
|
||||
call VSCodeExtensionCall('external-buffer', a:name, a:id, 1, tabstop, isJumping)
|
||||
endfunction
|
||||
|
||||
function! s:runFileTypeDetection()
|
||||
doautocmd BufRead
|
||||
if exists('b:vscode_controlled') && b:vscode_controlled
|
||||
" make sure we disable syntax (global option seems doesn't take effect for 2nd+ windows)
|
||||
setlocal syntax=off
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:onInsertEnter()
|
||||
let reg = reg_recording()
|
||||
if !empty(reg)
|
||||
call VSCodeExtensionCall('notify-recording', reg)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
" Load altercmd first
|
||||
execute 'source ' . s:currDir . '/vim-altercmd/plugin/altercmd.vim'
|
||||
execute 'source ' . s:currDir . '/vscode-insert.vim'
|
||||
execute 'source ' . s:currDir . '/vscode-scrolling.vim'
|
||||
execute 'source ' . s:currDir . '/vscode-jumplist.vim'
|
||||
execute 'source ' . s:currDir . '/vscode-code-actions.vim'
|
||||
execute 'source ' . s:currDir . '/vscode-file-commands.vim'
|
||||
execute 'source ' . s:currDir . '/vscode-tab-commands.vim'
|
||||
execute 'source ' . s:currDir . '/vscode-window-commands.vim'
|
||||
execute 'source ' . s:currDir . '/vscode-motion.vim'
|
||||
|
||||
augroup VscodeGeneral
|
||||
autocmd!
|
||||
" autocmd BufWinEnter,WinNew,WinEnter * :only
|
||||
autocmd BufWinEnter * call <SID>onBufEnter(expand('<afile>'), expand('<abuf>'))
|
||||
" Help and other buffer types may explicitly disable line numbers - reenable them, !important - set nowrap since it may be overriden and this option is crucial for now
|
||||
" autocmd FileType * :setlocal conceallevel=0 | :setlocal number | :setlocal numberwidth=8 | :setlocal nowrap | :setlocal nofoldenable
|
||||
autocmd InsertEnter * call <SID>onInsertEnter()
|
||||
autocmd BufAdd * call <SID>runFileTypeDetection()
|
||||
" Looks like external windows are coming with "set wrap" set automatically, disable them
|
||||
" autocmd WinNew,WinEnter * :set nowrap
|
||||
augroup END
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
" This file used to force set neovim options which may break the extension. Loaded after user config
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
set shortmess=filnxtToOFI
|
||||
set nowrap
|
||||
set mouse=a
|
||||
set cmdheight=1
|
||||
set wildmode=list
|
||||
set wildchar=<C-e>
|
||||
|
||||
set nobackup
|
||||
set nowb
|
||||
set noswapfile
|
||||
set noautoread
|
||||
set scrolloff=100
|
||||
set conceallevel=0
|
||||
set nocursorline
|
||||
|
||||
" do not hide buffers
|
||||
" set nohidden
|
||||
set hidden
|
||||
set bufhidden=hide
|
||||
" do not attempt autowrite any buffers
|
||||
set noautowrite
|
||||
" Disable shada session storing
|
||||
" set shada=
|
||||
" set nonumber
|
||||
set norelativenumber
|
||||
" Render line number as "marker" of the visible top/bottom screen row
|
||||
set nonumber
|
||||
" up to 10 000 000
|
||||
" set numberwidth=8
|
||||
" Need to know tabs for HL
|
||||
set listchars=tab:❥♥
|
||||
set list
|
||||
" Allow to use vim HL for external buffers, vscode buffers explicitly disable it
|
||||
syntax on
|
||||
set signcolumn=no
|
||||
|
||||
" Disable statusline and ruler since we don't need them anyway
|
||||
set statusline=
|
||||
set laststatus=0
|
||||
set noruler
|
||||
|
||||
" Disable modeline processing. It's being used for tab related settings usually and we don't want to override ours
|
||||
set nomodeline
|
||||
set modelines=0
|
||||
|
||||
" Turn off auto-folding
|
||||
set nofoldenable
|
||||
set foldmethod=manual
|
||||
|
||||
" Turn on auto-indenting
|
||||
set autoindent
|
||||
set smartindent
|
||||
|
||||
" split/nosplit doesn't work currently, see https://github.com/asvetliakov/vscode-neovim/issues/329
|
||||
set inccommand=
|
||||
|
||||
" lazyredraw breaks the movement
|
||||
set nolazyredraw
|
||||
|
||||
function s:forceLocalOptions()
|
||||
setlocal nowrap
|
||||
setlocal conceallevel=0
|
||||
setlocal scrolloff=100
|
||||
setlocal hidden
|
||||
setlocal bufhidden=hide
|
||||
setlocal noautowrite
|
||||
setlocal nonumber
|
||||
setlocal norelativenumber
|
||||
setlocal list
|
||||
setlocal listchars=tab:❥♥
|
||||
if exists('b:vscode_controlled') && b:vscode_controlled
|
||||
setlocal syntax=off
|
||||
endif
|
||||
setlocal nofoldenable
|
||||
setlocal foldmethod=manual
|
||||
setlocal nolazyredraw
|
||||
endfunction
|
||||
|
||||
augroup VscodeForceOptions
|
||||
autocmd!
|
||||
autocmd BufEnter,FileType * call <SID>forceLocalOptions()
|
||||
augroup END
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
function s:reveal(direction, resetCursor)
|
||||
call VSCodeExtensionNotify('reveal', a:direction, a:resetCursor)
|
||||
endfunction
|
||||
|
||||
nnoremap z<CR> <Cmd>call <SID>reveal('top', 1)<CR>
|
||||
xnoremap z<CR> <Cmd>call <SID>reveal('top', 1)<CR>
|
||||
nnoremap zt <Cmd>call <SID>reveal('top', 0)<CR>
|
||||
xnoremap zt <Cmd>call <SID>reveal('top', 0)<CR>
|
||||
nnoremap z. <Cmd>call <SID>reveal('center', 1)<CR>
|
||||
xnoremap z. <Cmd>call <SID>reveal('center', 1)<CR>
|
||||
nnoremap zz <Cmd>call <SID>reveal('center', 0)<CR>
|
||||
xnoremap zz <Cmd>call <SID>reveal('center', 0)<CR>
|
||||
nnoremap z- <Cmd>call <SID>reveal('bottom', 1)<CR>
|
||||
xnoremap z- <Cmd>call <SID>reveal('bottom', 1)<CR>
|
||||
nnoremap zb <Cmd>call <SID>reveal('bottom', 0)<CR>
|
||||
xnoremap zb <Cmd>call <SID>reveal('bottom', 0)<CR>
|
||||
|
||||
|
||||
function s:moveCursor(to)
|
||||
" Native VSCode commands don't register jumplist. Fix by registering jumplist in Vim e.g. for subsequent use of <C-o>
|
||||
normal! m'
|
||||
call VSCodeExtensionNotify('move-cursor', a:to)
|
||||
endfunction
|
||||
|
||||
nnoremap H <Cmd>call <SID>moveCursor('top')<CR>
|
||||
xnoremap H <Cmd>call <SID>moveCursor('top')<CR>
|
||||
nnoremap M <Cmd>call <SID>moveCursor('middle')<CR>
|
||||
xnoremap M <Cmd>call <SID>moveCursor('middle')<CR>
|
||||
nnoremap L <Cmd>call <SID>moveCursor('bottom')<CR>
|
||||
xnoremap L <Cmd>call <SID>moveCursor('bottom')<CR>
|
||||
|
||||
" Disabled due to scroll problems (the ext binds them directly)
|
||||
" nnoremap <silent> <expr> <C-d> VSCodeExtensionCall('scroll', 'halfPage', 'down')
|
||||
" xnoremap <silent> <expr> <C-d> VSCodeExtensionCall('scroll', 'halfPage', 'down')
|
||||
" nnoremap <silent> <expr> <C-u> VSCodeExtensionCall('scroll', 'halfPage', 'up')
|
||||
" xnoremap <silent> <expr> <C-u> VSCodeExtensionCall('scroll', 'halfPage', 'up')
|
||||
|
||||
" nnoremap <silent> <expr> <C-f> VSCodeExtensionCall('scroll', 'page', 'down')
|
||||
" xnoremap <silent> <expr> <C-f> VSCodeExtensionCall('scroll', 'page', 'down')
|
||||
" nnoremap <silent> <expr> <C-b> VSCodeExtensionCall('scroll', 'page', 'up')
|
||||
" xnoremap <silent> <expr> <C-b> VSCodeExtensionCall('scroll', 'page', 'up')
|
||||
|
||||
" nnoremap <silent> <expr> <C-e> VSCodeExtensionNotify('scroll-line', 'down')
|
||||
" xnoremap <silent> <expr> <C-e> VSCodeExtensionNotify('scroll-line', 'down')
|
||||
" nnoremap <silent> <expr> <C-y> VSCodeExtensionNotify('scroll-line', 'up')
|
||||
" xnoremap <silent> <expr> <C-y> VSCodeExtensionNotify('scroll-line', 'up')
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
function! s:switchEditor(...) abort
|
||||
let count = a:1
|
||||
let direction = a:2
|
||||
for i in range(1, count ? count : 1)
|
||||
call VSCodeCall(direction ==# 'next' ? 'workbench.action.nextEditorInGroup' : 'workbench.action.previousEditorInGroup')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
command! -complete=file -nargs=? Tabedit if empty(<q-args>) | call VSCodeNotify('workbench.action.quickOpen') | else | call VSCodeExtensionNotify('open-file', expand(<q-args>), 0) | endif
|
||||
command! -complete=file Tabnew call VSCodeExtensionNotify('open-file', '__vscode_new__', 0)
|
||||
command! Tabfind call VSCodeNotify('workbench.action.quickOpen')
|
||||
command! Tab echoerr 'Not supported'
|
||||
command! Tabs echoerr 'Not supported'
|
||||
command! -bang Tabclose if <q-bang> ==# '!' | call VSCodeNotify('workbench.action.revertAndCloseActiveEditor') | else | call VSCodeNotify('workbench.action.closeActiveEditor') | endif
|
||||
command! Tabonly call VSCodeNotify('workbench.action.closeOtherEditors')
|
||||
command! -nargs=? Tabnext call <SID>switchEditor(<q-args>, 'next')
|
||||
command! -nargs=? Tabprevious call <SID>switchEditor(<q-args>, 'prev')
|
||||
command! Tabfirst call VSCodeNotify('workbench.action.firstEditorInGroup')
|
||||
command! Tablast call VSCodeNotify('workbench.action.lastEditorInGroup')
|
||||
command! Tabrewind call VSCodeNotify('workbench.action.firstEditorInGroup')
|
||||
command! -nargs=? Tabmove echoerr 'Not supported yet'
|
||||
|
||||
AlterCommand tabe[dit] Tabedit
|
||||
AlterCommand tabnew Tabnew
|
||||
AlterCommand tabf[ind] Tabfind
|
||||
AlterCommand tab Tab
|
||||
AlterCommand tabs Tabs
|
||||
AlterCommand tabc[lose] Tabclose
|
||||
AlterCommand tabo[nly] Tabonly
|
||||
AlterCommand tabn[ext] Tabnext
|
||||
AlterCommand tabp[revious] Tabprevious
|
||||
AlterCommand tabr[ewind] Tabrewind
|
||||
AlterCommand tabfir[st] Tabfirst
|
||||
AlterCommand tabl[ast] Tablast
|
||||
AlterCommand tabm[ove] Tabmove
|
||||
|
||||
nnoremap gt <Cmd>call <SID>switchEditor(v:count, 'next')<CR>
|
||||
xnoremap gt <Cmd>call <SID>switchEditor(v:count, 'next')<CR>
|
||||
nnoremap gT <Cmd>call <SID>switchEditor(v:count, 'prev')<CR>
|
||||
xnoremap gT <Cmd>call <SID>switchEditor(v:count, 'prev')<CR>
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
|
||||
function! s:split(...) abort
|
||||
let direction = a:1
|
||||
let file = exists('a:2') ? a:2 : ''
|
||||
call VSCodeCall(direction ==# 'h' ? 'workbench.action.splitEditorDown' : 'workbench.action.splitEditorRight')
|
||||
if !empty(file)
|
||||
call VSCodeExtensionNotify('open-file', expand(file), 'all')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:splitNew(...)
|
||||
let file = a:2
|
||||
call s:split(a:1, empty(file) ? '__vscode_new__' : file)
|
||||
endfunction
|
||||
|
||||
function! s:closeOtherEditors()
|
||||
call VSCodeNotify('workbench.action.closeEditorsInOtherGroups')
|
||||
call VSCodeNotify('workbench.action.closeOtherEditors')
|
||||
endfunction
|
||||
|
||||
function! s:manageEditorHeight(...)
|
||||
let count = a:1
|
||||
let to = a:2
|
||||
for i in range(1, count ? count : 1)
|
||||
call VSCodeNotify(to ==# 'increase' ? 'workbench.action.increaseViewHeight' : 'workbench.action.decreaseViewHeight')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! s:manageEditorWidth(...)
|
||||
let count = a:1
|
||||
let to = a:2
|
||||
for i in range(1, count ? count : 1)
|
||||
call VSCodeNotify(to ==# 'increase' ? 'workbench.action.increaseViewWidth' : 'workbench.action.decreaseViewWidth')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
command! -complete=file -nargs=? Split call <SID>split('h', <q-args>)
|
||||
command! -complete=file -nargs=? Vsplit call <SID>split('v', <q-args>)
|
||||
command! -complete=file -nargs=? New call <SID>split('h', '__vscode_new__')
|
||||
command! -complete=file -nargs=? Vnew call <SID>split('v', '__vscode_new__')
|
||||
command! -bang Only if <q-bang> ==# '!' | call <SID>closeOtherEditors() | else | call VSCodeNotify('workbench.action.joinAllGroups') | endif
|
||||
|
||||
AlterCommand sp[lit] Split
|
||||
AlterCommand vs[plit] Vsplit
|
||||
AlterCommand new New
|
||||
AlterCommand vne[w] Vnew
|
||||
AlterCommand on[ly] Only
|
||||
|
||||
" buffer management
|
||||
nnoremap <C-w>n <Cmd>call <SID>splitNew('h', '__vscode_new__')<CR>
|
||||
xnoremap <C-w>n <Cmd>call <SID>splitNew('h', '__vscode_new__')<CR>
|
||||
|
||||
nnoremap <C-w>q <Cmd>call VSCodeNotify('workbench.action.closeActiveEditor')<CR>
|
||||
xnoremap <C-w>q <Cmd>call VSCodeNotify('workbench.action.closeActiveEditor')<CR>
|
||||
nnoremap <C-w>c <Cmd>call VSCodeNotify('workbench.action.closeActiveEditor')<CR>
|
||||
xnoremap <C-w>c <Cmd>call VSCodeNotify('workbench.action.closeActiveEditor')<CR>
|
||||
nnoremap <C-w><C-c> <Cmd>call VSCodeNotify('workbench.action.closeActiveEditor')<CR>
|
||||
xnoremap <C-w><C-c> <Cmd>call VSCodeNotify('workbench.action.closeActiveEditor')<CR>
|
||||
|
||||
" window/splits management
|
||||
nnoremap <C-w>s <Cmd>call <SID>split('h')<CR>
|
||||
xnoremap <C-w>s <Cmd>call <SID>split('h')<CR>
|
||||
nnoremap <C-w><C-s> <Cmd>call <SID>split('h')<CR>
|
||||
xnoremap <C-w><C-s> <Cmd>call <SID>split('h')<CR>
|
||||
|
||||
nnoremap <C-w>v <Cmd>call <SID>split('v')<CR>
|
||||
xnoremap <C-w>v <Cmd>call <SID>split('v')<CR>
|
||||
nnoremap <C-w><C-v> <Cmd>call <SID>split('v')<CR>
|
||||
xnoremap <C-w><C-v> <Cmd>call <SID>split('v')<CR>
|
||||
|
||||
nnoremap <C-w>= <Cmd>call VSCodeNotify('workbench.action.evenEditorWidths')<CR>
|
||||
xnoremap <C-w>= <Cmd>call VSCodeNotify('workbench.action.evenEditorWidths')<CR>
|
||||
nnoremap <C-w>_ <Cmd>call VSCodeNotify('workbench.action.toggleEditorWidths')<CR>
|
||||
xnoremap <C-w>_ <Cmd>call VSCodeNotify('workbench.action.toggleEditorWidths')<CR>
|
||||
|
||||
nnoremap <C-w>+ <Cmd>call <SID>manageEditorHeight(v:count, 'increase')<CR>
|
||||
xnoremap <C-w>+ <Cmd>call <SID>manageEditorHeight(v:count, 'increase')<CR>
|
||||
nnoremap <C-w>- <Cmd>call <SID>manageEditorHeight(v:count, 'decrease')<CR>
|
||||
xnoremap <C-w>- <Cmd>call <SID>manageEditorHeight(v:count, 'decrease')<CR>
|
||||
nnoremap <C-w>> <Cmd>call <SID>manageEditorWidth(v:count, 'increase')<CR>
|
||||
xnoremap <C-w>> <Cmd>call <SID>manageEditorWidth(v:count, 'increase')<CR>
|
||||
nnoremap <C-w>< <Cmd>call <SID>manageEditorWidth(v:count, 'decrease')<CR>
|
||||
xnoremap <C-w>< <Cmd>call <SID>manageEditorWidth(v:count, 'decrease')<CR>
|
||||
|
||||
nnoremap <C-w>o <Cmd>call VSCodeNotify('workbench.action.joinAllGroups')<CR>
|
||||
xnoremap <C-w>o <Cmd>call VSCodeNotify('workbench.action.joinAllGroups')<CR>
|
||||
nnoremap <C-w><C-o> <Cmd>call VSCodeNotify('workbench.action.joinAllGroups')<CR>
|
||||
xnoremap <C-w><C-o> <Cmd>call VSCodeNotify('workbench.action.joinAllGroups')<CR>
|
||||
|
||||
" window navigation
|
||||
nnoremap <C-w>j <Cmd>call VSCodeNotify('workbench.action.focusBelowGroup')<CR>
|
||||
xnoremap <C-w>j <Cmd>call VSCodeNotify('workbench.action.focusBelowGroup')<CR>
|
||||
nnoremap <C-w>k <Cmd>call VSCodeNotify('workbench.action.focusAboveGroup')<CR>
|
||||
xnoremap <C-w>k <Cmd>call VSCodeNotify('workbench.action.focusAboveGroup')<CR>
|
||||
nnoremap <C-w>h <Cmd>call VSCodeNotify('workbench.action.focusLeftGroup')<CR>
|
||||
xnoremap <C-w>h <Cmd>call VSCodeNotify('workbench.action.focusLeftGroup')<CR>
|
||||
nnoremap <C-w>l <Cmd>call VSCodeNotify('workbench.action.focusRightGroup')<CR>
|
||||
xnoremap <C-w>l <Cmd>call VSCodeNotify('workbench.action.focusRightGroup')<CR>
|
||||
|
||||
nnoremap <C-w><Down> <Cmd>call VSCodeNotify('workbench.action.focusBelowGroup')<CR>
|
||||
xnoremap <C-w><Down> <Cmd>call VSCodeNotify('workbench.action.focusBelowGroup')<CR>
|
||||
nnoremap <C-w><Up> <Cmd>call VSCodeNotify('workbench.action.focusAboveGroup')<CR>
|
||||
xnoremap <C-w><Up> <Cmd>call VSCodeNotify('workbench.action.focusAboveGroup')<CR>
|
||||
nnoremap <C-w><Left> <Cmd>call VSCodeNotify('workbench.action.focusLeftGroup')<CR>
|
||||
xnoremap <C-w><Left> <Cmd>call VSCodeNotify('workbench.action.focusLeftGroup')<CR>
|
||||
nnoremap <C-w><Right> <Cmd>call VSCodeNotify('workbench.action.focusRightGroup')<CR>
|
||||
xnoremap <C-w><Right> <Cmd>call VSCodeNotify('workbench.action.focusRightGroup')<CR>
|
||||
|
||||
nnoremap <C-w><C-j> <Cmd>call VSCodeNotify('workbench.action.moveEditorToBelowGroup')<CR>
|
||||
xnoremap <C-w><C-j> <Cmd>call VSCodeNotify('workbench.action.moveEditorToBelowGroup')<CR>
|
||||
nnoremap <C-w><C-i> <Cmd>call VSCodeNotify('workbench.action.moveEditorToAboveGroup')<CR>
|
||||
xnoremap <C-w><C-i> <Cmd>call VSCodeNotify('workbench.action.moveEditorToAboveGroup')<CR>
|
||||
nnoremap <C-w><C-h> <Cmd>call VSCodeNotify('workbench.action.moveEditorToLeftGroup')<CR>
|
||||
xnoremap <C-w><C-h> <Cmd>call VSCodeNotify('workbench.action.moveEditorToLeftGroup')<CR>
|
||||
nnoremap <C-w><C-l> <Cmd>call VSCodeNotify('workbench.action.moveEditorToRightGroup')<CR>
|
||||
xnoremap <C-w><C-l> <Cmd>call VSCodeNotify('workbench.action.moveEditorToRightGroup')<CR>
|
||||
|
||||
nnoremap <C-w><C-Down> <Cmd>call VSCodeNotify('workbench.action.moveEditorToBelowGroup')<CR>
|
||||
xnoremap <C-w><C-Down> <Cmd>call VSCodeNotify('workbench.action.moveEditorToBelowGroup')<CR>
|
||||
nnoremap <C-w><C-Up> <Cmd>call VSCodeNotify('workbench.action.moveEditorToAboveGroup')<CR>
|
||||
xnoremap <C-w><C-Up> <Cmd>call VSCodeNotify('workbench.action.moveEditorToAboveGroup')<CR>
|
||||
nnoremap <C-w><C-Left> <Cmd>call VSCodeNotify('workbench.action.moveEditorToLeftGroup')<CR>
|
||||
xnoremap <C-w><C-Left> <Cmd>call VSCodeNotify('workbench.action.moveEditorToLeftGroup')<CR>
|
||||
nnoremap <C-w><C-Right> <Cmd>call VSCodeNotify('workbench.action.moveEditorToRightGroup')<CR>
|
||||
xnoremap <C-w><C-Right> <Cmd>call VSCodeNotify('workbench.action.moveEditorToRightGroup')<CR>
|
||||
|
||||
nnoremap <C-w><S-j> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupDown')<CR>
|
||||
xnoremap <C-w><S-j> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupDown')<CR>
|
||||
nnoremap <C-w><S-k> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupUp')<CR>
|
||||
xnoremap <C-w><S-k> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupUp')<CR>
|
||||
nnoremap <C-w><S-h> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupLeft')<CR>
|
||||
xnoremap <C-w><S-h> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupLeft')<CR>
|
||||
nnoremap <C-w><S-l> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupRight')<CR>
|
||||
xnoremap <C-w><S-l> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupRight')<CR>
|
||||
|
||||
nnoremap <C-w><S-Down> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupDown')<CR>
|
||||
xnoremap <C-w><S-Down> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupDown')<CR>
|
||||
nnoremap <C-w><S-Up> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupUp')<CR>
|
||||
xnoremap <C-w><S-Up> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupUp')<CR>
|
||||
nnoremap <C-w><S-Left> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupLeft')<CR>
|
||||
xnoremap <C-w><S-Left> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupLeft')<CR>
|
||||
nnoremap <C-w><S-Right> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupRight')<CR>
|
||||
xnoremap <C-w><S-Right> <Cmd>call VSCodeNotify('workbench.action.moveActiveEditorGroupRight')<CR>
|
||||
|
||||
nnoremap <C-w>w <Cmd>call VSCodeNotify('workbench.action.focusNextGroup')<CR>
|
||||
xnoremap <C-w>w <Cmd>call VSCodeNotify('workbench.action.focusNextGroup')<CR>
|
||||
nnoremap <C-w><C-w> <Cmd>call VSCodeNotify('workbench.action.focusNextGroup')<CR>
|
||||
xnoremap <C-w><C-w> <Cmd>call VSCodeNotify('workbench.action.focusNextGroup')<CR>
|
||||
nnoremap <C-w>W <Cmd>call VSCodeNotify('workbench.action.focusPreviousGroup')<CR>
|
||||
xnoremap <C-w>W <Cmd>call VSCodeNotify('workbench.action.focusPreviousGroup')<CR>
|
||||
nnoremap <C-w>p <Cmd>call VSCodeNotify('workbench.action.focusPreviousGroup')<CR>
|
||||
xnoremap <C-w>p <Cmd>call VSCodeNotify('workbench.action.focusPreviousGroup')<CR>
|
||||
|
||||
nnoremap <C-w>t <Cmd>call VSCodeNotify('workbench.action.focusFirstEditorGroup')<CR>
|
||||
xnoremap <C-w>t <Cmd>call VSCodeNotify('workbench.action.focusFirstEditorGroup')<CR>
|
||||
nnoremap <C-w>b <Cmd>call VSCodeNotify('workbench.action.focusLastEditorGroup')<CR>
|
||||
xnoremap <C-w>b <Cmd>call VSCodeNotify('workbench.action.focusLastEditorGroup')<CR>
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||
<Metadata>
|
||||
<Identity Language="en-US" Id="bracket-pair-colorizer-2" Version="0.2.1" Publisher="CoenraadS"/>
|
||||
<DisplayName>Bracket Pair Colorizer 2</DisplayName>
|
||||
<Description xml:space="preserve">A customizable extension for colorizing matching brackets</Description>
|
||||
<Tags>bracket,brackets,pair,color,colour,multi-root ready</Tags>
|
||||
<Categories>Other</Categories>
|
||||
<GalleryFlags>Public</GalleryFlags>
|
||||
<Badges></Badges>
|
||||
<Properties>
|
||||
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.45.0" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="ui,workspace" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/CoenraadS/Bracket-Pair-Colorizer-2" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/CoenraadS/Bracket-Pair-Colorizer-2" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/CoenraadS/Bracket-Pair-Colorizer-2" />
|
||||
|
||||
|
||||
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Branding.Color" Value="#1E1E1E" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Branding.Theme" Value="dark" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" />
|
||||
|
||||
|
||||
|
||||
</Properties>
|
||||
<License>extension/LICENSE.md</License>
|
||||
<Icon>extension/images/icon.png</Icon>
|
||||
</Metadata>
|
||||
<Installation>
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
|
||||
</Installation>
|
||||
<Dependencies/>
|
||||
<Assets>
|
||||
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
|
||||
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.Changelog" Path="extension/CHANGELOG.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.License" Path="extension/LICENSE.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Icons.Default" Path="extension/images/icon.png" Addressable="true" />
|
||||
</Assets>
|
||||
</PackageManifest>
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
|
||||
---
|
||||
|
||||
Note:
|
||||
This extension is unmaintained, check out these similar alternatives:
|
||||
- [Highlight Matching Tag](https://marketplace.visualstudio.com/items?itemName=vincaslt.highlight-matching-tag)
|
||||
- [Blockman](https://marketplace.visualstudio.com/items?itemName=leodevbro.blockman)
|
||||
|
||||
---
|
||||
|
||||
## Release Notes
|
||||
|
||||
### 0.2.1
|
||||
Change activation event to `onStartupFinished` for better performance
|
||||
|
||||
### 0.1.5
|
||||
|
||||
Remove logging
|
||||
|
||||
### 0.1.3
|
||||
|
||||
Work with VSCode v1.45.0
|
||||
|
||||
### 0.0.29
|
||||
|
||||
Allow extension to work with remove development
|
||||
|
||||
### 0.0.28
|
||||
|
||||
Fix background opacity
|
||||
|
||||
### 0.0.27
|
||||
|
||||
Support VSCode Theme Colors (except in gutters)
|
||||
|
||||
e.g.
|
||||
|
||||
```
|
||||
"bracket-pair-colorizer-2.scopeLineCSS": [
|
||||
"borderStyle : dotted",
|
||||
"borderWidth : 1px",
|
||||
"borderColor : activityBarBadge.background",
|
||||
]
|
||||
```
|
||||
|
||||
### 0.0.26
|
||||
|
||||
Support new extensions being installed without reload
|
||||
|
||||
### 0.0.25
|
||||
|
||||
Fix regex to search for longest match first
|
||||
|
||||
### 0.0.24
|
||||
|
||||
Fix extension creating a regex that matches everything if no brackets were defined
|
||||
|
||||
### 0.0.23
|
||||
|
||||
Remove matching `<>` for all languages because too many false positives
|
||||
|
||||
### 0.0.22
|
||||
|
||||
Ensure that an extension that contributes brackets also contributes a grammar
|
||||
|
||||
### 0.0.21
|
||||
|
||||
Add unmatched bracket coloring
|
||||
Restore option to use independent color groups
|
||||
|
||||
### 0.0.20
|
||||
|
||||
Support reading language configuration json files with comments
|
||||
|
||||
### 0.0.19
|
||||
|
||||
Restore only matching bracket scopes when inside of the scope
|
||||
|
||||
### 0.0.18
|
||||
|
||||
Be more aggresive with recoloring to prevent mismatches
|
||||
|
||||
### 0.0.17
|
||||
|
||||
Fix coloring offset being wrong following a string/comment/regex
|
||||
|
||||
### 0.0.16
|
||||
|
||||
Fix nested coloring being broken
|
||||
|
||||
### 0.0.13
|
||||
|
||||
Leverage VSCode for automagical bracket support
|
||||
|
||||
### 0.0.12
|
||||
|
||||
Fix colors sometimes being incorrect after text replacement [#3](https://github.com/CoenraadS/Bracket-Pair-Colorizer-2/issues/3)
|
||||
|
||||
### 0.0.11
|
||||
|
||||
Fix colors sometimes being incorrect after text replacement [#2](https://github.com/CoenraadS/Bracket-Pair-Colorizer-2/issues/2)
|
||||
|
||||
### 0.0.10
|
||||
|
||||
JSON with comments support
|
||||
Go support
|
||||
Fix colors sometimes being incorrect after text replacement
|
||||
|
||||
### 0.0.9
|
||||
|
||||
C# support hotfix
|
||||
|
||||
### 0.0.8
|
||||
|
||||
Fix gutter icons showing only closing brackets
|
||||
|
||||
### 0.0.7
|
||||
|
||||
Clojure support hotfix
|
||||
|
||||
### 0.0.6
|
||||
|
||||
Clojure support
|
||||
|
||||
### 0.0.5
|
||||
|
||||
PHP support
|
||||
Fix switch statements breaking Typescript brackets
|
||||
|
||||
### 0.0.4
|
||||
|
||||
PowerShell support
|
||||
|
||||
### 0.0.3
|
||||
|
||||
Fix loading languages where file extension differs from language id
|
||||
|
||||
### 0.0.1
|
||||
|
||||
Initial release
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2016
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
|
||||
---
|
||||
|
||||
Note:
|
||||
This extension is unmaintained, check out these similar alternatives:
|
||||
- [Highlight Matching Tag](https://marketplace.visualstudio.com/items?itemName=vincaslt.highlight-matching-tag)
|
||||
- [Blockman](https://marketplace.visualstudio.com/items?itemName=leodevbro.blockman)
|
||||
|
||||
---
|
||||
|
||||
# Bracket Pair Colorizer 2
|
||||
|
||||
This extension allows matching brackets to be identified with colours. The user can define which tokens to match, and which colours to use.
|
||||
|
||||
Screenshot:
|
||||

|
||||
|
||||
---
|
||||
|
||||
### F.A.Q.
|
||||
|
||||
- Differences between v1 and v2?
|
||||
- v2 Uses the same bracket parsing engine as VSCode, greatly increasing speed and accuracy. A new version was released because settings were cleaned up, breaking backwards compatibility.
|
||||
|
||||
---
|
||||
|
||||
### [Release Notes](https://github.com/CoenraadS/Bracket-Pair-Colorizer-2/blob/HEAD/CHANGELOG.md)
|
||||
|
||||
---
|
||||
|
||||
## Settings
|
||||
|
||||
> `"bracket-pair-colorizer-2.colors"`
|
||||
Define the colors used to colorize brackets. Accepts valid color names, hex codes, and `rgba()` values.
|
||||
```json
|
||||
"bracket-pair-colorizer-2.colors": [
|
||||
"Gold",
|
||||
"Orchid",
|
||||
"LightSkyBlue"
|
||||
]
|
||||
```
|
||||
|
||||
> `"bracket-pair-colorizer-2.forceUniqueOpeningColor"`
|
||||

|
||||

|
||||
|
||||
> `"bracket-pair-colorizer-2.forceIterationColorCycle"`
|
||||

|
||||
|
||||
>`"bracket-pair-colorizer-2.colorMode"`
|
||||
Consecutive brackets share a color pool for all bracket types
|
||||
Independent brackets allow each bracket type to use its own color pool
|
||||

|
||||

|
||||
|
||||
> `"bracket-pair-colorizer-2.highlightActiveScope"`
|
||||
Should the currently scoped brackets always be highlighted?
|
||||
|
||||
> `"bracket-pair-colorizer-2.activeScopeCSS"`
|
||||
Choose a border style to highlight the active scope. Use `{color}` to match the existing bracket color
|
||||
It is recommended to disable the inbuilt `editor.matchBrackets` setting if using this feature
|
||||

|
||||
|
||||
```json
|
||||
"bracket-pair-colorizer-2.activeScopeCSS": [
|
||||
"borderStyle : solid",
|
||||
"borderWidth : 1px",
|
||||
"borderColor : {color}",
|
||||
"opacity: 0.5"
|
||||
]
|
||||
```
|
||||
|
||||
> `"bracket-pair-colorizer-2.showBracketsInGutter"`
|
||||
> Show active scope brackets in the gutter
|
||||

|
||||
|
||||
> `"bracket-pair-colorizer-2.showBracketsInRuler"`
|
||||
> Show active scope brackets in the ruler
|
||||
|
||||
> `"bracket-pair-colorizer-2.rulerPosition"`
|
||||
> Decoration position in the ruler
|
||||
|
||||
>`"bracket-pair-colorizer-2.showVerticalScopeLine"`
|
||||
Show a vertical line between the brackets? Enabled by default
|
||||

|
||||
|
||||
>`"bracket-pair-colorizer-2.showHorizontalScopeLine"`
|
||||
Show a horizontal line between the brackets? Enabled by default
|
||||

|
||||
|
||||
>`"bracket-pair-colorizer-2.scopeLineRelativePosition"`
|
||||
Disable this to show the vertical line in column 0
|
||||

|
||||
|
||||
>`"bracket-pair-colorizer-2.scopeLineCSS"`
|
||||
Choose a border style to highlight the active scope. Use `{color}` to match the existing bracket color
|
||||
|
||||
```json
|
||||
"bracket-pair-colorizer-2.scopeLineCSS": [
|
||||
"borderStyle : solid",
|
||||
"borderWidth : 1px",
|
||||
"borderColor : {color}",
|
||||
"opacity: 0.5"
|
||||
]
|
||||
```
|
||||
|
||||
>`"bracket-pair-colorizer-2.excludedLanguages"`
|
||||
Exclude a language from being colorized
|
||||
|
||||
### Commands
|
||||
|
||||
These commands will expand/undo the cursor selection to the next scope
|
||||
|
||||
`"bracket-pair-colorizer-2.expandBracketSelection"`
|
||||
`"bracket-pair-colorizer-2.undoBracketSelection"`
|
||||
|
||||
Quick-start:
|
||||
|
||||
```
|
||||
{
|
||||
"key": "shift+alt+right",
|
||||
"command": "bracket-pair-colorizer-2.expandBracketSelection",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "shift+alt+left",
|
||||
"command": "bracket-pair-colorizer-2.undoBracketSelection",
|
||||
"when": "editorTextFocus"
|
||||
}
|
||||
```
|
||||
|
Before Width: | Height: | Size: 5 KiB |
|
Before Width: | Height: | Size: 4 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
|
@ -1,109 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="128"
|
||||
height="128"
|
||||
viewBox="0 0 128 128"
|
||||
id="svg2"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer2">
|
||||
<rect
|
||||
style="fill:#333333;fill-opacity:1"
|
||||
id="rect4300"
|
||||
width="128"
|
||||
height="128"
|
||||
x="0"
|
||||
y="2.2617187e-005" />
|
||||
</g>
|
||||
<g
|
||||
id="g3535">
|
||||
<g
|
||||
id="g3527">
|
||||
<text
|
||||
id="text3350"
|
||||
y="92.075386"
|
||||
x="48.020668"
|
||||
style="font-style:normal;font-weight:normal;font-size:40.00056458px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"
|
||||
transform="scale(1.0000162,0.9999838)"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Consolas;-inkscape-font-specification:Consolas;fill:#19a6ff;fill-opacity:1"
|
||||
y="92.075386"
|
||||
x="48.020668"
|
||||
id="tspan3352">(</tspan></text>
|
||||
<text
|
||||
transform="scale(0.99999644,1.0000036)"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="35.211063"
|
||||
y="97.293411"
|
||||
id="text3462"><tspan
|
||||
id="tspan3464"
|
||||
x="35.211063"
|
||||
y="97.293411"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:60px;font-family:Consolas;-inkscape-font-specification:Consolas;fill:#fffc00;fill-opacity:1">(</tspan></text>
|
||||
<text
|
||||
transform="scale(1.0000021,0.9999979)"
|
||||
id="text3466"
|
||||
y="102.51353"
|
||||
x="20.281208"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:80px;font-family:Consolas;-inkscape-font-specification:Consolas;fill:#b21212;fill-opacity:1"
|
||||
y="102.51353"
|
||||
x="20.281208"
|
||||
id="tspan3468">(</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g3519">
|
||||
<text
|
||||
id="text3350-8"
|
||||
y="56.804874"
|
||||
x="57.885876"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Consolas;-inkscape-font-specification:Consolas;fill:#19a6ff;fill-opacity:1"
|
||||
y="56.804874"
|
||||
x="57.885876"
|
||||
id="tspan3352-6">)</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="59.695812"
|
||||
y="62.024811"
|
||||
id="text3462-4"><tspan
|
||||
id="tspan3464-2"
|
||||
x="59.695812"
|
||||
y="62.024811"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:60px;font-family:Consolas;-inkscape-font-specification:Consolas;fill:#fffc00;fill-opacity:1">)</tspan></text>
|
||||
<text
|
||||
id="text3466-0"
|
||||
y="67.244247"
|
||||
x="63.584751"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:80px;font-family:Consolas;-inkscape-font-specification:Consolas;fill:#b21212;fill-opacity:1"
|
||||
y="67.244247"
|
||||
x="63.584751"
|
||||
id="tspan3468-8">)</tspan></text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
|
@ -1,3 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=IBracketManager.js.map
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=IExtensionGrammar.js.map
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class Bracket {
|
||||
constructor(token, color) {
|
||||
this.token = token;
|
||||
this.color = color;
|
||||
}
|
||||
}
|
||||
exports.default = Bracket;
|
||||
//# sourceMappingURL=bracket.js.map
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const bracket_1 = require("./bracket");
|
||||
class BracketClose extends bracket_1.default {
|
||||
constructor(token, openBracket) {
|
||||
super(token, openBracket.color);
|
||||
this.openBracket = openBracket;
|
||||
}
|
||||
}
|
||||
exports.default = BracketClose;
|
||||
//# sourceMappingURL=bracketClose.js.map
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRegexForBrackets = void 0;
|
||||
function getRegexForBrackets(input) {
|
||||
const longestFirst = input.sort((a, b) => (b.open.length + b.close.length) - (a.open.length + a.close.length));
|
||||
const pieces = [];
|
||||
longestFirst.forEach((b) => {
|
||||
pieces.push(b.open);
|
||||
pieces.push(b.close);
|
||||
});
|
||||
return createBracketOrRegExp(pieces);
|
||||
}
|
||||
exports.getRegexForBrackets = getRegexForBrackets;
|
||||
function createBracketOrRegExp(pieces) {
|
||||
const regexStr = `(${pieces.map(prepareBracketForRegExp).join(")|(")})`;
|
||||
return createRegExp(regexStr, true, { global: true });
|
||||
}
|
||||
function prepareBracketForRegExp(str) {
|
||||
// This bracket pair uses letters like e.g. "begin" - "end"
|
||||
const insertWordBoundaries = (/^[\w]+$/.test(str));
|
||||
str = escapeRegExpCharacters(str);
|
||||
return (insertWordBoundaries ? `\\b${str}\\b` : str);
|
||||
}
|
||||
function escapeRegExpCharacters(value) {
|
||||
return value.replace(/[\-\\\{\}\*\+\?\|\^\$\.\[\]\(\)\#]/g, "\\$&");
|
||||
}
|
||||
function createRegExp(searchString, isRegex, options = {}) {
|
||||
if (!searchString) {
|
||||
throw new Error("Cannot create regex from empty string");
|
||||
}
|
||||
if (!isRegex) {
|
||||
searchString = escapeRegExpCharacters(searchString);
|
||||
}
|
||||
if (options.wholeWord) {
|
||||
if (!/\B/.test(searchString.charAt(0))) {
|
||||
searchString = "\\b" + searchString;
|
||||
}
|
||||
if (!/\B/.test(searchString.charAt(searchString.length - 1))) {
|
||||
searchString = searchString + "\\b";
|
||||
}
|
||||
}
|
||||
let modifiers = "";
|
||||
if (options.global) {
|
||||
modifiers += "g";
|
||||
}
|
||||
if (!options.matchCase) {
|
||||
modifiers += "i";
|
||||
}
|
||||
if (options.multiline) {
|
||||
modifiers += "m";
|
||||
}
|
||||
return new RegExp(searchString, modifiers);
|
||||
}
|
||||
//# sourceMappingURL=bracketUtil.js.map
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var ColorMode;
|
||||
(function (ColorMode) {
|
||||
ColorMode[ColorMode["Consecutive"] = 0] = "Consecutive";
|
||||
ColorMode[ColorMode["Independent"] = 1] = "Independent";
|
||||
})(ColorMode || (ColorMode = {}));
|
||||
exports.default = ColorMode;
|
||||
//# sourceMappingURL=colorMode.js.map
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class DefinitionAfterInheritance {
|
||||
constructor(language, scopes) {
|
||||
this.language = language;
|
||||
this.scopes = scopes;
|
||||
}
|
||||
}
|
||||
exports.default = DefinitionAfterInheritance;
|
||||
//# sourceMappingURL=definitionAfterInheritance.js.map
|
||||
|
|
@ -1,382 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const vscode = require("vscode");
|
||||
const lineState_1 = require("./lineState");
|
||||
const textLine_1 = require("./textLine");
|
||||
const vscodeFiles_1 = require("./vscodeFiles");
|
||||
class DocumentDecoration {
|
||||
constructor(document, config, settings) {
|
||||
// This program caches lines, and will only analyze linenumbers including or above a modified line
|
||||
this.lines = [];
|
||||
this.scopeDecorations = [];
|
||||
this.scopeSelectionHistory = [];
|
||||
this.settings = settings;
|
||||
this.document = document;
|
||||
this.languageConfig = config;
|
||||
}
|
||||
dispose() {
|
||||
this.disposeScopeDecorations();
|
||||
}
|
||||
onDidChangeTextDocument(contentChanges) {
|
||||
if (contentChanges.length > 1 || !contentChanges[0].range.isSingleLine || contentChanges[0].text.length > 1) {
|
||||
let minLineIndexToUpdate = 0;
|
||||
for (const contentChange of contentChanges) {
|
||||
minLineIndexToUpdate = Math.min(minLineIndexToUpdate, contentChange.range.start.line);
|
||||
}
|
||||
if (minLineIndexToUpdate === 0) {
|
||||
this.lines = [];
|
||||
}
|
||||
else {
|
||||
this.lines.splice(minLineIndexToUpdate);
|
||||
}
|
||||
this.tokenizeDocument();
|
||||
return;
|
||||
}
|
||||
const change = contentChanges[0];
|
||||
const lineNumber = change.range.start.line;
|
||||
// Parse overlapped lines with goal to see if we can avoid document reparse
|
||||
// By just moving existing brackets if the amount of brackets on a line didn't change
|
||||
const newLine = this.tokenizeLine(lineNumber);
|
||||
const currentLine = this.lines[lineNumber];
|
||||
// Current line has new brackets which need to be colored
|
||||
if (!currentLine.getRuleStack().equals(newLine.getRuleStack()) ||
|
||||
currentLine.getBracketHash() !== newLine.getBracketHash()) {
|
||||
this.lines[lineNumber] = newLine;
|
||||
this.lines.splice(lineNumber + 1);
|
||||
this.tokenizeDocument();
|
||||
return;
|
||||
}
|
||||
const charOffset = change.text.length - change.rangeLength;
|
||||
currentLine.offset(change.range.start.character, charOffset);
|
||||
}
|
||||
expandBracketSelection(editor) {
|
||||
const newSelections = [];
|
||||
editor.selections.forEach((selection) => {
|
||||
if (this.scopeSelectionHistory.length === 0) {
|
||||
this.scopeSelectionHistory.push(editor.selections);
|
||||
}
|
||||
const nextPos = this.document.validatePosition(selection.active.translate(0, 1));
|
||||
const endBracket = this.searchScopeForwards(nextPos);
|
||||
if (!endBracket) {
|
||||
return;
|
||||
}
|
||||
const start = endBracket.openBracket.token.range.start.translate(0, 1);
|
||||
const end = endBracket.token.range.end.translate(0, -1);
|
||||
newSelections.push(new vscode.Selection(start, end));
|
||||
});
|
||||
if (newSelections.length > 0) {
|
||||
this.scopeSelectionHistory.push(newSelections);
|
||||
editor.selections = newSelections;
|
||||
}
|
||||
}
|
||||
undoBracketSelection(editor) {
|
||||
this.scopeSelectionHistory.pop();
|
||||
if (this.scopeSelectionHistory.length === 0) {
|
||||
return;
|
||||
}
|
||||
const scopes = this.scopeSelectionHistory[this.scopeSelectionHistory.length - 1];
|
||||
editor.selections = scopes;
|
||||
}
|
||||
// Lines are stored in an array, if line is requested outside of array bounds
|
||||
// add emptys lines until array is correctly sized
|
||||
getLine(index, state) {
|
||||
if (index < this.lines.length) {
|
||||
return this.lines[index];
|
||||
}
|
||||
else {
|
||||
if (this.lines.length === 0) {
|
||||
this.lines.push(new textLine_1.default(state, new lineState_1.default(this.settings, this.languageConfig), 0));
|
||||
}
|
||||
if (index < this.lines.length) {
|
||||
return this.lines[index];
|
||||
}
|
||||
if (index === this.lines.length) {
|
||||
const previousLine = this.lines[this.lines.length - 1];
|
||||
const newLine = new textLine_1.default(state, previousLine.cloneState(), index);
|
||||
this.lines.push(newLine);
|
||||
return newLine;
|
||||
}
|
||||
throw new Error("Cannot look more than one line ahead");
|
||||
}
|
||||
}
|
||||
tokenizeDocument() {
|
||||
// console.log("Tokenizing " + this.document.fileName);
|
||||
// One document may be shared by multiple editors (side by side view)
|
||||
const editors = vscode.window.visibleTextEditors.filter((e) => this.document === e.document);
|
||||
if (editors.length === 0) {
|
||||
// console.warn("No editors associated with document: " + this.document.fileName);
|
||||
return;
|
||||
}
|
||||
// console.time("tokenizeDocument");
|
||||
const lineIndex = this.lines.length;
|
||||
const lineCount = this.document.lineCount;
|
||||
if (lineIndex < lineCount) {
|
||||
// console.log("Reparse from line: " + (lineIndex + 1));
|
||||
for (let i = lineIndex; i < lineCount; i++) {
|
||||
const newLine = this.tokenizeLine(i);
|
||||
this.lines.push(newLine);
|
||||
}
|
||||
}
|
||||
// console.log("Coloring document");
|
||||
this.colorDecorations(editors);
|
||||
// console.timeEnd("tokenizeDocument");
|
||||
}
|
||||
updateScopeDecorations(event) {
|
||||
// console.time("updateScopeDecorations");
|
||||
this.disposeScopeDecorations();
|
||||
// For performance reasons we only do one selection for now.
|
||||
// Simply wrap in foreach selection for multicursor, maybe put it behind an option?
|
||||
const selection = event.textEditor.selection;
|
||||
const closeBracket = this.searchScopeForwards(selection.active);
|
||||
if (!closeBracket) {
|
||||
return;
|
||||
}
|
||||
const openBracket = closeBracket.openBracket;
|
||||
const beginRange = openBracket.token.range;
|
||||
const endRange = closeBracket.token.range;
|
||||
const startLineIndex = openBracket.token.range.start.line;
|
||||
const endLineIndex = closeBracket.token.range.start.line;
|
||||
if (this.settings.highlightActiveScope) {
|
||||
const decoration = this.settings.createScopeBracketDecorations(closeBracket.color);
|
||||
event.textEditor.setDecorations(decoration, [beginRange, endRange]);
|
||||
this.scopeDecorations.push(decoration);
|
||||
}
|
||||
if (this.settings.showBracketsInGutter) {
|
||||
if (startLineIndex === endLineIndex) {
|
||||
const decoration = this.settings.createGutterBracketDecorations(closeBracket.color, openBracket.token.character + closeBracket.token.character);
|
||||
event.textEditor.setDecorations(decoration, [beginRange, endRange]);
|
||||
this.scopeDecorations.push(decoration);
|
||||
}
|
||||
else {
|
||||
const decorationOpen = this.settings.createGutterBracketDecorations(openBracket.color, openBracket.token.character);
|
||||
event.textEditor.setDecorations(decorationOpen, [beginRange]);
|
||||
this.scopeDecorations.push(decorationOpen);
|
||||
const decorationClose = this.settings.createGutterBracketDecorations(closeBracket.color, closeBracket.token.character);
|
||||
event.textEditor.setDecorations(decorationClose, [endRange]);
|
||||
this.scopeDecorations.push(decorationClose);
|
||||
}
|
||||
}
|
||||
if (this.settings.showBracketsInRuler) {
|
||||
const decoration = this.settings.createRulerBracketDecorations(closeBracket.color);
|
||||
event.textEditor.setDecorations(decoration, [beginRange, endRange]);
|
||||
this.scopeDecorations.push(decoration);
|
||||
}
|
||||
const lastWhiteSpaceCharacterIndex = this.document.lineAt(endRange.start).firstNonWhitespaceCharacterIndex;
|
||||
const lastBracketStartIndex = endRange.start.character;
|
||||
const lastBracketIsFirstCharacterOnLine = lastWhiteSpaceCharacterIndex === lastBracketStartIndex;
|
||||
let leftBorderColumn = Infinity;
|
||||
const tabSize = event.textEditor.options.tabSize;
|
||||
const position = this.settings.scopeLineRelativePosition ?
|
||||
Math.min(endRange.start.character, beginRange.start.character) : 0;
|
||||
let leftBorderIndex = position;
|
||||
const start = beginRange.start.line + 1;
|
||||
const end = endRange.start.line;
|
||||
// Start -1 because prefer draw line at current indent level
|
||||
for (let lineIndex = start - 1; lineIndex <= end; lineIndex++) {
|
||||
const line = this.document.lineAt(lineIndex);
|
||||
if (!line.isEmptyOrWhitespace) {
|
||||
const firstCharIndex = line.firstNonWhitespaceCharacterIndex;
|
||||
leftBorderIndex = Math.min(leftBorderIndex, firstCharIndex);
|
||||
leftBorderColumn = Math.min(leftBorderColumn, this.calculateColumnFromCharIndex(line.text, firstCharIndex, tabSize));
|
||||
}
|
||||
}
|
||||
if (this.settings.showVerticalScopeLine) {
|
||||
const verticalLineRanges = [];
|
||||
const endOffset = lastBracketIsFirstCharacterOnLine ? end - 1 : end;
|
||||
for (let lineIndex = start; lineIndex <= endOffset; lineIndex++) {
|
||||
const line = this.document.lineAt(lineIndex);
|
||||
const linePosition = new vscode.Position(lineIndex, this.calculateCharIndexFromColumn(line.text, leftBorderColumn, tabSize));
|
||||
const range = new vscode.Range(linePosition, linePosition);
|
||||
const valid = line.text.length >= leftBorderIndex;
|
||||
verticalLineRanges.push({ range, valid });
|
||||
}
|
||||
const safeFallbackPosition = new vscode.Position(start - 1, leftBorderIndex);
|
||||
this.setVerticalLineDecoration(closeBracket, event, safeFallbackPosition, verticalLineRanges);
|
||||
}
|
||||
if (this.settings.showHorizontalScopeLine) {
|
||||
const underlineLineRanges = [];
|
||||
const overlineLineRanges = [];
|
||||
if (startLineIndex === endLineIndex) {
|
||||
underlineLineRanges.push(new vscode.Range(beginRange.start, endRange.end));
|
||||
}
|
||||
else {
|
||||
const startTextLine = this.document.lineAt(startLineIndex);
|
||||
const endTextLine = this.document.lineAt(endLineIndex);
|
||||
const leftStartPos = new vscode.Position(beginRange.start.line, this.calculateCharIndexFromColumn(startTextLine.text, leftBorderColumn, tabSize));
|
||||
const leftEndPos = new vscode.Position(endRange.start.line, this.calculateCharIndexFromColumn(endTextLine.text, leftBorderColumn, tabSize));
|
||||
underlineLineRanges.push(new vscode.Range(leftStartPos, beginRange.end));
|
||||
if (lastBracketIsFirstCharacterOnLine) {
|
||||
overlineLineRanges.push(new vscode.Range(leftEndPos, endRange.end));
|
||||
}
|
||||
else {
|
||||
underlineLineRanges.push(new vscode.Range(leftEndPos, endRange.end));
|
||||
}
|
||||
}
|
||||
if (underlineLineRanges) {
|
||||
this.setUnderLineDecoration(closeBracket, event, underlineLineRanges);
|
||||
}
|
||||
if (overlineLineRanges) {
|
||||
this.setOverLineDecoration(closeBracket, event, overlineLineRanges);
|
||||
}
|
||||
}
|
||||
// console.timeEnd("updateScopeDecorations");
|
||||
}
|
||||
tokenizeLine(index) {
|
||||
const newText = this.document.lineAt(index).text;
|
||||
const previousLineRuleStack = index > 0 ?
|
||||
this.lines[index - 1].getRuleStack() :
|
||||
undefined;
|
||||
const previousLineState = index > 0 ?
|
||||
this.lines[index - 1].cloneState() :
|
||||
new lineState_1.default(this.settings, this.languageConfig);
|
||||
const tokenized = this.languageConfig.grammar.tokenizeLine2(newText, previousLineRuleStack);
|
||||
const tokens = tokenized.tokens;
|
||||
const lineTokens = new vscodeFiles_1.LineTokens(tokens, newText);
|
||||
const matches = new Array();
|
||||
const count = lineTokens.getCount();
|
||||
for (let i = 0; i < count; i++) {
|
||||
const tokenType = lineTokens.getStandardTokenType(i);
|
||||
if (!vscodeFiles_1.ignoreBracketsInToken(tokenType)) {
|
||||
const searchStartOffset = tokens[i * 2];
|
||||
const searchEndOffset = i < count ? tokens[(i + 1) * 2] : newText.length;
|
||||
const currentTokenText = newText.substring(searchStartOffset, searchEndOffset);
|
||||
let result;
|
||||
// tslint:disable-next-line:no-conditional-assignment
|
||||
while ((result = this.languageConfig.regex.exec(currentTokenText)) !== null) {
|
||||
matches.push({ content: result[0], index: result.index + searchStartOffset });
|
||||
}
|
||||
}
|
||||
}
|
||||
const newLine = new textLine_1.default(tokenized.ruleStack, previousLineState, index);
|
||||
for (const match of matches) {
|
||||
const lookup = this.languageConfig.bracketToId.get(match.content);
|
||||
if (lookup) {
|
||||
newLine.AddToken(match.content, match.index, lookup.key, lookup.open);
|
||||
}
|
||||
}
|
||||
return newLine;
|
||||
}
|
||||
setOverLineDecoration(bracket, event, overlineLineRanges) {
|
||||
const lineDecoration = this.settings.createScopeLineDecorations(bracket.color, true, false, false, false);
|
||||
event.textEditor.setDecorations(lineDecoration, overlineLineRanges);
|
||||
this.scopeDecorations.push(lineDecoration);
|
||||
}
|
||||
setUnderLineDecoration(bracket, event, underlineLineRanges) {
|
||||
const lineDecoration = this.settings.createScopeLineDecorations(bracket.color, false, false, true, false);
|
||||
event.textEditor.setDecorations(lineDecoration, underlineLineRanges);
|
||||
this.scopeDecorations.push(lineDecoration);
|
||||
}
|
||||
setVerticalLineDecoration(bracket, event, fallBackPosition, verticalLineRanges) {
|
||||
const offsets = [];
|
||||
const normalDecoration = this.settings.createScopeLineDecorations(bracket.color, false, false, false, true);
|
||||
if (verticalLineRanges.length === 0) {
|
||||
return;
|
||||
}
|
||||
const normalRanges = verticalLineRanges.filter((e) => e.valid).map((e) => e.range);
|
||||
// Get first valid range, if non fall-back to opening position
|
||||
let aboveValidRange = new vscode.Range(fallBackPosition, fallBackPosition);
|
||||
for (const lineRange of verticalLineRanges) {
|
||||
if (lineRange.valid) {
|
||||
aboveValidRange = lineRange.range;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Keep updating last valid range to keep offset distance minimum
|
||||
to prevent missing decorations when scrolling */
|
||||
for (const lineRange of verticalLineRanges) {
|
||||
if (lineRange.valid) {
|
||||
aboveValidRange = lineRange.range;
|
||||
}
|
||||
else {
|
||||
const offset = lineRange.range.start.line - aboveValidRange.start.line;
|
||||
offsets.push({ range: aboveValidRange, downOffset: offset });
|
||||
}
|
||||
}
|
||||
event.textEditor.setDecorations(normalDecoration, normalRanges);
|
||||
this.scopeDecorations.push(normalDecoration);
|
||||
offsets.forEach((offset) => {
|
||||
const decoration = this.settings.createScopeLineDecorations(bracket.color, false, false, false, true, offset.downOffset);
|
||||
event.textEditor.setDecorations(decoration, [offset.range]);
|
||||
this.scopeDecorations.push(decoration);
|
||||
});
|
||||
}
|
||||
disposeScopeDecorations() {
|
||||
for (const decoration of this.scopeDecorations) {
|
||||
decoration.dispose();
|
||||
}
|
||||
this.scopeDecorations = [];
|
||||
}
|
||||
searchScopeForwards(position) {
|
||||
for (let i = position.line; i < this.lines.length; i++) {
|
||||
const endBracket = this.lines[i].getClosingBracket(position);
|
||||
if (endBracket) {
|
||||
return endBracket;
|
||||
}
|
||||
}
|
||||
}
|
||||
colorDecorations(editors) {
|
||||
// console.time("colorDecorations");
|
||||
const colorMap = new Map();
|
||||
// Reduce all the colors/ranges of the lines into a singular map
|
||||
for (const line of this.lines) {
|
||||
{
|
||||
const brackets = line.getAllBrackets();
|
||||
for (const bracket of brackets) {
|
||||
const existingRanges = colorMap.get(bracket.color);
|
||||
if (existingRanges !== undefined) {
|
||||
existingRanges.push(bracket.token.range);
|
||||
}
|
||||
else {
|
||||
colorMap.set(bracket.color, [bracket.token.range]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const [color, decoration] of this.settings.bracketDecorations) {
|
||||
if (color === "") {
|
||||
continue;
|
||||
}
|
||||
const ranges = colorMap.get(color);
|
||||
for (const editor of editors) {
|
||||
if (ranges !== undefined) {
|
||||
editor.setDecorations(decoration, ranges);
|
||||
}
|
||||
else {
|
||||
// We must set non-used colors to an empty array
|
||||
// or previous decorations will not be invalidated
|
||||
editor.setDecorations(decoration, []);
|
||||
}
|
||||
}
|
||||
}
|
||||
// console.timeEnd("colorDecorations");
|
||||
}
|
||||
calculateColumnFromCharIndex(lineText, charIndex, tabSize) {
|
||||
let spacing = 0;
|
||||
for (let index = 0; index < charIndex; index++) {
|
||||
if (lineText.charAt(index) === "\t") {
|
||||
spacing += tabSize - spacing % tabSize;
|
||||
}
|
||||
else {
|
||||
spacing++;
|
||||
}
|
||||
}
|
||||
return spacing;
|
||||
}
|
||||
calculateCharIndexFromColumn(lineText, column, tabSize) {
|
||||
let spacing = 0;
|
||||
for (let index = 0; index <= column; index++) {
|
||||
if (spacing >= column) {
|
||||
return index;
|
||||
}
|
||||
if (lineText.charAt(index) === "\t") {
|
||||
spacing += tabSize - spacing % tabSize;
|
||||
}
|
||||
else {
|
||||
spacing++;
|
||||
}
|
||||
}
|
||||
return spacing;
|
||||
}
|
||||
}
|
||||
exports.default = DocumentDecoration;
|
||||
//# sourceMappingURL=documentDecoration.js.map
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const vscode_1 = require("vscode");
|
||||
const documentDecoration_1 = require("./documentDecoration");
|
||||
const settings_1 = require("./settings");
|
||||
class DocumentDecorationManager {
|
||||
constructor() {
|
||||
this.documents = new Map();
|
||||
this.settings = new settings_1.default();
|
||||
}
|
||||
Dispose() {
|
||||
this.documents.forEach((document, key) => {
|
||||
document.dispose();
|
||||
});
|
||||
this.settings.dispose();
|
||||
}
|
||||
expandBracketSelection(editor) {
|
||||
const documentDecoration = this.getDocumentDecorations(editor.document);
|
||||
if (documentDecoration) {
|
||||
documentDecoration.expandBracketSelection(editor);
|
||||
}
|
||||
}
|
||||
undoBracketSelection(editor) {
|
||||
const documentDecoration = this.getDocumentDecorations(editor.document);
|
||||
if (documentDecoration) {
|
||||
documentDecoration.undoBracketSelection(editor);
|
||||
}
|
||||
}
|
||||
updateDocument(document) {
|
||||
// console.log("updateDocument");
|
||||
const documentDecoration = this.getDocumentDecorations(document);
|
||||
if (documentDecoration) {
|
||||
documentDecoration.tokenizeDocument();
|
||||
}
|
||||
}
|
||||
onDidOpenTextDocument(document) {
|
||||
// console.log("onDidOpenTextDocument");
|
||||
const documentDecoration = this.getDocumentDecorations(document);
|
||||
if (documentDecoration) {
|
||||
documentDecoration.tokenizeDocument();
|
||||
}
|
||||
}
|
||||
onDidChangeTextDocument(event) {
|
||||
// console.log("onDidChangeTextDocument");
|
||||
const documentDecoration = this.getDocumentDecorations(event.document);
|
||||
if (documentDecoration) {
|
||||
documentDecoration.onDidChangeTextDocument(event.contentChanges);
|
||||
}
|
||||
}
|
||||
onDidCloseTextDocument(closedDocument) {
|
||||
// console.log("onDidCloseTextDocument");
|
||||
const uri = closedDocument.uri.toString();
|
||||
const document = this.documents.get(uri);
|
||||
if (document !== undefined) {
|
||||
// console.log("Disposing " + uri);
|
||||
document.dispose();
|
||||
this.documents.delete(uri);
|
||||
}
|
||||
}
|
||||
onDidChangeSelection(event) {
|
||||
// console.log("onDidChangeSelection");
|
||||
const documentDecoration = this.getDocumentDecorations(event.textEditor.document);
|
||||
if (documentDecoration &&
|
||||
(documentDecoration.settings.highlightActiveScope ||
|
||||
documentDecoration.settings.showBracketsInGutter ||
|
||||
documentDecoration.settings.showVerticalScopeLine ||
|
||||
documentDecoration.settings.showHorizontalScopeLine)) {
|
||||
documentDecoration.updateScopeDecorations(event);
|
||||
}
|
||||
}
|
||||
updateAllDocuments() {
|
||||
// console.log("updateAllDocuments");
|
||||
for (const editor of vscode_1.window.visibleTextEditors) {
|
||||
this.updateDocument(editor.document);
|
||||
}
|
||||
}
|
||||
getDocumentDecorations(document) {
|
||||
if (!this.isValidDocument(document)) {
|
||||
return;
|
||||
}
|
||||
const uri = document.uri.toString();
|
||||
// console.log("Looking for " + uri + " from cache");
|
||||
let documentDecorations = this.documents.get(uri);
|
||||
if (documentDecorations === undefined) {
|
||||
const languageConfig = this.tryGetLanguageConfig(document.languageId);
|
||||
if (!languageConfig) {
|
||||
// console.log("Could not find tokenizer for " + document.languageId);
|
||||
return;
|
||||
}
|
||||
if (languageConfig instanceof Promise) {
|
||||
// console.log("Found Tokenizer promise for " + document.languageId);
|
||||
languageConfig.then((grammar) => {
|
||||
if (grammar) {
|
||||
this.updateDocument(document);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
// console.log("Found Tokenizer for " + document.languageId);
|
||||
documentDecorations = new documentDecoration_1.default(document, languageConfig, this.settings);
|
||||
// console.log("Adding " + uri + " to cache");
|
||||
this.documents.set(uri, documentDecorations);
|
||||
}
|
||||
// console.log("Retrieved " + uri + " from cache");
|
||||
return documentDecorations;
|
||||
}
|
||||
tryGetLanguageConfig(languageID) {
|
||||
return this.settings.TextMateLoader.tryGetLanguageConfig(languageID);
|
||||
}
|
||||
isValidDocument(document) {
|
||||
if (document === undefined) {
|
||||
// console.warn("Ignoring undefined document");
|
||||
return false;
|
||||
}
|
||||
if (document.lineCount === 0) {
|
||||
// console.warn("Ignoring document with 0 line counter");
|
||||
return false;
|
||||
}
|
||||
if (document.uri.scheme === "vscode") {
|
||||
// console.log("Ignoring document with 'vscode' uri");
|
||||
return false;
|
||||
}
|
||||
if (document.uri.scheme === "output") {
|
||||
// console.log("Ignoring document with 'output' uri");
|
||||
return false;
|
||||
}
|
||||
if (this.settings.excludedLanguages.has(document.languageId)) {
|
||||
// console.log("Ignoring document because language id was ignored in settings");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
exports.default = DocumentDecorationManager;
|
||||
//# sourceMappingURL=documentDecorationManager.js.map
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.deactivate = exports.activate = void 0;
|
||||
const vscode_1 = require("vscode");
|
||||
const documentDecorationManager_1 = require("./documentDecorationManager");
|
||||
function activate(context) {
|
||||
let documentDecorationManager = new documentDecorationManager_1.default();
|
||||
vscode_1.extensions.onDidChange(() => restart());
|
||||
context.subscriptions.push(vscode_1.commands.registerCommand("bracket-pair-colorizer-2.expandBracketSelection", () => {
|
||||
const editor = vscode_1.window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
documentDecorationManager.expandBracketSelection(editor);
|
||||
}), vscode_1.commands.registerCommand("bracket-pair-colorizer-2.undoBracketSelection", () => {
|
||||
const editor = vscode_1.window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
documentDecorationManager.undoBracketSelection(editor);
|
||||
}), vscode_1.workspace.onDidChangeConfiguration((event) => {
|
||||
if (event.affectsConfiguration("bracket-pair-colorizer-2") ||
|
||||
event.affectsConfiguration("editor.lineHeight") ||
|
||||
event.affectsConfiguration("editor.fontSize")) {
|
||||
restart();
|
||||
}
|
||||
}), vscode_1.window.onDidChangeVisibleTextEditors(() => {
|
||||
documentDecorationManager.updateAllDocuments();
|
||||
}), vscode_1.workspace.onDidChangeTextDocument((event) => {
|
||||
if (event.contentChanges.length > 0) {
|
||||
documentDecorationManager.onDidChangeTextDocument(event);
|
||||
}
|
||||
}), vscode_1.workspace.onDidCloseTextDocument((event) => {
|
||||
documentDecorationManager.onDidCloseTextDocument(event);
|
||||
}), vscode_1.workspace.onDidOpenTextDocument((event) => {
|
||||
documentDecorationManager.onDidOpenTextDocument(event);
|
||||
}), vscode_1.window.onDidChangeTextEditorSelection((event) => {
|
||||
documentDecorationManager.onDidChangeSelection(event);
|
||||
}));
|
||||
documentDecorationManager.updateAllDocuments();
|
||||
function restart() {
|
||||
documentDecorationManager.Dispose();
|
||||
documentDecorationManager = new documentDecorationManager_1.default();
|
||||
documentDecorationManager.updateAllDocuments();
|
||||
}
|
||||
}
|
||||
exports.activate = activate;
|
||||
// tslint:disable-next-line:no-empty
|
||||
function deactivate() {
|
||||
}
|
||||
exports.deactivate = deactivate;
|
||||
//# sourceMappingURL=extension.js.map
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class FoundBracket {
|
||||
constructor(range, type) {
|
||||
this.range = range;
|
||||
this.character = type;
|
||||
}
|
||||
}
|
||||
exports.default = FoundBracket;
|
||||
//# sourceMappingURL=foundBracket.js.map
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const vscode_1 = require("vscode");
|
||||
const umd_1 = require("vscode-uri/lib/umd");
|
||||
class GutterIconManager {
|
||||
constructor() {
|
||||
this.escape = require("escape-html");
|
||||
this.iconDict = new Map();
|
||||
// tslint:disable-next-line:callable-types
|
||||
this.disposables = new Array();
|
||||
this.fontFamily = vscode_1.workspace.getConfiguration("editor").fontFamily;
|
||||
this.readEditorLineHeight();
|
||||
}
|
||||
Dispose() {
|
||||
this.disposables.forEach((callback) => {
|
||||
callback();
|
||||
});
|
||||
this.disposables = [];
|
||||
}
|
||||
GetIconUri(bracket, color) {
|
||||
const colorDict = this.iconDict.get(bracket);
|
||||
if (colorDict) {
|
||||
const uri = colorDict.get(color);
|
||||
if (uri) {
|
||||
return uri;
|
||||
}
|
||||
else {
|
||||
const newUri = this.createIcon(color, bracket);
|
||||
colorDict.set(color, newUri);
|
||||
return newUri;
|
||||
}
|
||||
}
|
||||
else {
|
||||
const newUri = this.createIcon(color, bracket);
|
||||
const dict = new Map();
|
||||
dict.set(color, newUri);
|
||||
this.iconDict.set(bracket, dict);
|
||||
return newUri;
|
||||
}
|
||||
}
|
||||
createIcon(color, bracket) {
|
||||
const svg = `<svg xmlns="http://www.w3.org/2000/svg" height="${this.lineHeight}" width="${this.lineHeight}">` +
|
||||
`<text x="50%" y="50%" fill="${color}" font-family="${this.fontFamily}" font-size="${this.fontSize}" ` +
|
||||
`text-anchor="middle" dominant-baseline="middle">` +
|
||||
`${this.escape(bracket)}` +
|
||||
`</text>` +
|
||||
`</svg>`;
|
||||
const encodedSVG = encodeURIComponent(svg);
|
||||
const URI = "data:image/svg+xml;utf8," + encodedSVG;
|
||||
return umd_1.default.parse(URI);
|
||||
}
|
||||
readEditorLineHeight() {
|
||||
const MINIMUM_LINE_HEIGHT = 8;
|
||||
const MAXIMUM_LINE_HEIGHT = 150;
|
||||
const GOLDEN_LINE_HEIGHT_RATIO = (process.platform === "darwin") ? 1.5 : 1.35;
|
||||
const editorConfig = vscode_1.workspace.getConfiguration("editor", null);
|
||||
const fontSize = editorConfig.get("fontSize");
|
||||
const configuredLineHeight = editorConfig.get("lineHeight");
|
||||
function clamp(n, min, max) {
|
||||
if (n < min) {
|
||||
return min;
|
||||
}
|
||||
if (n > max) {
|
||||
return max;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
function safeParseInt(n, defaultValue) {
|
||||
if (typeof n === "number") {
|
||||
return Math.round(n);
|
||||
}
|
||||
const r = parseInt(n, 10);
|
||||
if (isNaN(r)) {
|
||||
return defaultValue;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
let lineHeight = safeParseInt(configuredLineHeight, 0);
|
||||
lineHeight = clamp(lineHeight, 0, MAXIMUM_LINE_HEIGHT);
|
||||
if (lineHeight === 0) {
|
||||
lineHeight = Math.round(GOLDEN_LINE_HEIGHT_RATIO * fontSize);
|
||||
}
|
||||
else if (lineHeight < MINIMUM_LINE_HEIGHT) {
|
||||
lineHeight = MINIMUM_LINE_HEIGHT;
|
||||
}
|
||||
this.lineHeight = lineHeight;
|
||||
this.fontSize = Math.ceil(fontSize * (2 / 3));
|
||||
}
|
||||
}
|
||||
exports.default = GutterIconManager;
|
||||
//# sourceMappingURL=gutterIconManager.js.map
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class LanguageConfig {
|
||||
constructor(grammar, regex, bracketToId) {
|
||||
this.grammar = grammar;
|
||||
this.regex = regex;
|
||||
this.bracketToId = bracketToId;
|
||||
}
|
||||
}
|
||||
exports.default = LanguageConfig;
|
||||
//# sourceMappingURL=languageConfig.js.map
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class LanguageDefinition {
|
||||
}
|
||||
exports.default = LanguageDefinition;
|
||||
//# sourceMappingURL=languageDefinition.js.map
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const colorMode_1 = require("./colorMode");
|
||||
const multipleIndexes_1 = require("./multipleIndexes");
|
||||
const singularIndex_1 = require("./singularIndex");
|
||||
const token_1 = require("./token");
|
||||
class LineState {
|
||||
constructor(settings, languageConfig, previousState) {
|
||||
this.settings = settings;
|
||||
this.languageConfig = languageConfig;
|
||||
if (previousState !== undefined) {
|
||||
this.bracketManager = previousState.colorIndexes;
|
||||
this.previousBracketColor = previousState.previousBracketColor;
|
||||
}
|
||||
else {
|
||||
switch (settings.colorMode) {
|
||||
case colorMode_1.default.Consecutive:
|
||||
this.bracketManager = new singularIndex_1.default(settings);
|
||||
break;
|
||||
case colorMode_1.default.Independent:
|
||||
this.bracketManager = new multipleIndexes_1.default(settings, languageConfig);
|
||||
break;
|
||||
default: throw new RangeError("Not implemented enum value");
|
||||
}
|
||||
}
|
||||
}
|
||||
getBracketHash() {
|
||||
return this.bracketManager.getHash();
|
||||
}
|
||||
cloneState() {
|
||||
const clone = {
|
||||
colorIndexes: this.bracketManager.copyCumulativeState(),
|
||||
previousBracketColor: this.previousBracketColor,
|
||||
};
|
||||
return new LineState(this.settings, this.languageConfig, clone);
|
||||
}
|
||||
getClosingBracket(position) {
|
||||
return this.bracketManager.getClosingBracket(position);
|
||||
}
|
||||
offset(startIndex, amount) {
|
||||
this.bracketManager.offset(startIndex, amount);
|
||||
}
|
||||
addBracket(type, character, beginIndex, lineIndex, open) {
|
||||
const token = new token_1.default(type, character, beginIndex, lineIndex);
|
||||
if (open) {
|
||||
this.addOpenBracket(token);
|
||||
}
|
||||
else {
|
||||
this.addCloseBracket(token);
|
||||
}
|
||||
}
|
||||
getAllBrackets() {
|
||||
return this.bracketManager.getAllBrackets();
|
||||
}
|
||||
addOpenBracket(token) {
|
||||
let colorIndex;
|
||||
if (this.settings.forceIterationColorCycle) {
|
||||
colorIndex = (this.bracketManager.getPreviousIndex(token.type) + 1) % this.settings.colors.length;
|
||||
}
|
||||
else {
|
||||
colorIndex = this.bracketManager.GetAmountOfOpenBrackets(token.type) % this.settings.colors.length;
|
||||
}
|
||||
let color = this.settings.colors[colorIndex];
|
||||
if (this.settings.forceUniqueOpeningColor && color === this.previousBracketColor) {
|
||||
colorIndex = (colorIndex + 1) % this.settings.colors.length;
|
||||
color = this.settings.colors[colorIndex];
|
||||
}
|
||||
this.previousBracketColor = color;
|
||||
this.bracketManager.addOpenBracket(token, colorIndex);
|
||||
}
|
||||
;
|
||||
addCloseBracket(token) {
|
||||
this.bracketManager.addCloseBracket(token);
|
||||
}
|
||||
}
|
||||
exports.default = LineState;
|
||||
//# sourceMappingURL=lineState.js.map
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class ModifierPair {
|
||||
constructor(openingCharacter, closingCharacter, counter) {
|
||||
this.counter = 0;
|
||||
this.openingCharacter = openingCharacter;
|
||||
this.closingCharacter = closingCharacter;
|
||||
if (counter !== undefined) {
|
||||
this.counter = counter;
|
||||
}
|
||||
}
|
||||
Clone() {
|
||||
return new ModifierPair(this.openingCharacter, this.closingCharacter, this.counter);
|
||||
}
|
||||
}
|
||||
exports.default = ModifierPair;
|
||||
//# sourceMappingURL=modifierPair.js.map
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const vscode_1 = require("vscode");
|
||||
const bracket_1 = require("./bracket");
|
||||
const bracketClose_1 = require("./bracketClose");
|
||||
class MultipleBracketGroups {
|
||||
constructor(settings, languageConfig, previousState) {
|
||||
this.allLinesOpenBracketStack = [];
|
||||
this.allBracketsOnLine = [];
|
||||
this.bracketsHash = "";
|
||||
this.previousOpenBracketColorIndexes = [];
|
||||
this.settings = settings;
|
||||
this.languageConfig = languageConfig;
|
||||
if (previousState !== undefined) {
|
||||
this.allLinesOpenBracketStack = previousState.currentOpenBracketColorIndexes;
|
||||
this.previousOpenBracketColorIndexes = previousState.previousOpenBracketColorIndexes;
|
||||
}
|
||||
else {
|
||||
for (const value of languageConfig.bracketToId.values()) {
|
||||
this.allLinesOpenBracketStack[value.key] = [];
|
||||
this.previousOpenBracketColorIndexes[value.key] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
getPreviousIndex(type) {
|
||||
return this.previousOpenBracketColorIndexes[type];
|
||||
}
|
||||
addOpenBracket(token, colorIndex) {
|
||||
const openBracket = new bracket_1.default(token, this.settings.colors[colorIndex]);
|
||||
this.allBracketsOnLine.push(openBracket);
|
||||
this.bracketsHash += openBracket.token.character;
|
||||
this.allLinesOpenBracketStack[token.type].push(openBracket);
|
||||
this.previousOpenBracketColorIndexes[token.type] = colorIndex;
|
||||
}
|
||||
GetAmountOfOpenBrackets(type) {
|
||||
return this.allLinesOpenBracketStack[type].length;
|
||||
}
|
||||
addCloseBracket(token) {
|
||||
const openStack = this.allLinesOpenBracketStack[token.type];
|
||||
if (openStack.length > 0) {
|
||||
if (openStack[openStack.length - 1].token.type === token.type) {
|
||||
const openBracket = openStack.pop();
|
||||
const closeBracket = new bracketClose_1.default(token, openBracket);
|
||||
this.allBracketsOnLine.push(closeBracket);
|
||||
this.bracketsHash += closeBracket.token.character;
|
||||
return;
|
||||
}
|
||||
}
|
||||
const orphan = new bracket_1.default(token, this.settings.unmatchedScopeColor);
|
||||
this.allBracketsOnLine.push(orphan);
|
||||
this.bracketsHash += orphan.token.character;
|
||||
}
|
||||
getClosingBracket(position) {
|
||||
for (const bracket of this.allBracketsOnLine) {
|
||||
if (!(bracket instanceof bracketClose_1.default)) {
|
||||
continue;
|
||||
}
|
||||
const closeBracket = bracket;
|
||||
const openBracket = closeBracket.openBracket;
|
||||
const range = new vscode_1.Range(openBracket.token.range.start.translate(0, 1), closeBracket.token.range.end.translate(0, -1));
|
||||
if (range.contains(position)) {
|
||||
return closeBracket;
|
||||
}
|
||||
}
|
||||
}
|
||||
getAllBrackets() {
|
||||
return this.allBracketsOnLine;
|
||||
}
|
||||
getHash() {
|
||||
return this.bracketsHash;
|
||||
}
|
||||
offset(startIndex, amount) {
|
||||
for (const bracket of this.allBracketsOnLine) {
|
||||
if (bracket.token.range.start.character >= startIndex) {
|
||||
bracket.token.offset(amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
copyCumulativeState() {
|
||||
const clone = [];
|
||||
for (const value of this.allLinesOpenBracketStack) {
|
||||
clone.push(value.slice());
|
||||
}
|
||||
return new MultipleBracketGroups(this.settings, this.languageConfig, {
|
||||
currentOpenBracketColorIndexes: clone,
|
||||
previousOpenBracketColorIndexes: this.previousOpenBracketColorIndexes.slice(),
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.default = MultipleBracketGroups;
|
||||
//# sourceMappingURL=multipleIndexes.js.map
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class ScopePair {
|
||||
}
|
||||
exports.default = ScopePair;
|
||||
//# sourceMappingURL=scopePair.js.map
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ScopeType = void 0;
|
||||
var ScopeType;
|
||||
(function (ScopeType) {
|
||||
ScopeType[ScopeType["Ambiguous"] = 0] = "Ambiguous";
|
||||
ScopeType[ScopeType["Open"] = 1] = "Open";
|
||||
ScopeType[ScopeType["Close"] = 2] = "Close";
|
||||
})(ScopeType = exports.ScopeType || (exports.ScopeType = {}));
|
||||
class ScopeSingle {
|
||||
constructor(tokenName, type, key) {
|
||||
this.tokenName = tokenName;
|
||||
this.type = type;
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
exports.default = ScopeSingle;
|
||||
//# sourceMappingURL=scopeSingle.js.map
|
||||
|
|
@ -1,204 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const vscode = require("vscode");
|
||||
const colorMode_1 = require("./colorMode");
|
||||
const gutterIconManager_1 = require("./gutterIconManager");
|
||||
const textMateLoader_1 = require("./textMateLoader");
|
||||
const vscode_1 = require("vscode");
|
||||
class Settings {
|
||||
constructor() {
|
||||
this.TextMateLoader = new textMateLoader_1.default();
|
||||
this.isDisposed = false;
|
||||
const workspaceColors = vscode.workspace.getConfiguration("workbench.colorCustomizations", undefined);
|
||||
this.gutterIcons = new gutterIconManager_1.default();
|
||||
const configuration = vscode.workspace.getConfiguration("bracket-pair-colorizer-2", undefined);
|
||||
const activeScopeCSS = configuration.get("activeScopeCSS");
|
||||
if (!Array.isArray(activeScopeCSS)) {
|
||||
throw new Error("activeScopeCSS is not an array");
|
||||
}
|
||||
this.activeBracketCSSElements = activeScopeCSS.map((e) => [e.substring(0, e.indexOf(":")).trim(),
|
||||
e.substring(e.indexOf(":") + 1).trim()]);
|
||||
const scopeLineCSS = configuration.get("scopeLineCSS");
|
||||
if (!Array.isArray(scopeLineCSS)) {
|
||||
throw new Error("scopeLineCSS is not an array");
|
||||
}
|
||||
this.activeScopeLineCSSElements = scopeLineCSS.map((e) => [e.substring(0, e.indexOf(":")).trim(),
|
||||
e.substring(e.indexOf(":") + 1).trim()]);
|
||||
const borderStyle = this.activeScopeLineCSSElements.filter((e) => e[0] === "borderStyle");
|
||||
if (borderStyle && borderStyle[0].length === 2) {
|
||||
this.activeScopeLineCSSBorder = borderStyle[0][1];
|
||||
}
|
||||
else {
|
||||
this.activeScopeLineCSSBorder = "none";
|
||||
}
|
||||
this.highlightActiveScope = configuration.get("highlightActiveScope");
|
||||
if (typeof this.highlightActiveScope !== "boolean") {
|
||||
throw new Error("alwaysHighlightActiveScope is not a boolean");
|
||||
}
|
||||
this.showVerticalScopeLine = configuration.get("showVerticalScopeLine");
|
||||
if (typeof this.showVerticalScopeLine !== "boolean") {
|
||||
throw new Error("showVerticalScopeLine is not a boolean");
|
||||
}
|
||||
this.showHorizontalScopeLine = configuration.get("showHorizontalScopeLine");
|
||||
if (typeof this.showHorizontalScopeLine !== "boolean") {
|
||||
throw new Error("showHorizontalScopeLine is not a boolean");
|
||||
}
|
||||
this.scopeLineRelativePosition = configuration.get("scopeLineRelativePosition");
|
||||
if (typeof this.scopeLineRelativePosition !== "boolean") {
|
||||
throw new Error("scopeLineRelativePosition is not a boolean");
|
||||
}
|
||||
this.showBracketsInGutter = configuration.get("showBracketsInGutter");
|
||||
if (typeof this.showBracketsInGutter !== "boolean") {
|
||||
throw new Error("showBracketsInGutter is not a boolean");
|
||||
}
|
||||
this.showBracketsInRuler = configuration.get("showBracketsInRuler");
|
||||
if (typeof this.showBracketsInRuler !== "boolean") {
|
||||
throw new Error("showBracketsInRuler is not a boolean");
|
||||
}
|
||||
this.rulerPosition = configuration.get("rulerPosition");
|
||||
if (typeof this.rulerPosition !== "string") {
|
||||
throw new Error("rulerPosition is not a string");
|
||||
}
|
||||
this.unmatchedScopeColor = configuration.get("unmatchedScopeColor");
|
||||
if (typeof this.unmatchedScopeColor !== "string") {
|
||||
throw new Error("unmatchedScopeColor is not a string");
|
||||
}
|
||||
this.forceUniqueOpeningColor = configuration.get("forceUniqueOpeningColor");
|
||||
if (typeof this.forceUniqueOpeningColor !== "boolean") {
|
||||
throw new Error("forceUniqueOpeningColor is not a boolean");
|
||||
}
|
||||
this.forceIterationColorCycle = configuration.get("forceIterationColorCycle");
|
||||
if (typeof this.forceIterationColorCycle !== "boolean") {
|
||||
throw new Error("forceIterationColorCycle is not a boolean");
|
||||
}
|
||||
this.colorMode = colorMode_1.default[configuration.get("colorMode")];
|
||||
if (typeof this.colorMode !== "number") {
|
||||
throw new Error("colorMode enum could not be parsed");
|
||||
}
|
||||
this.colors = configuration.get("colors");
|
||||
if (!Array.isArray(this.colors)) {
|
||||
throw new Error("colors is not an array");
|
||||
}
|
||||
this.bracketDecorations = this.createBracketDecorations();
|
||||
const excludedLanguages = configuration.get("excludedLanguages");
|
||||
if (!Array.isArray(excludedLanguages)) {
|
||||
throw new Error("excludedLanguages is not an array");
|
||||
}
|
||||
this.excludedLanguages = new Set(excludedLanguages);
|
||||
}
|
||||
dispose() {
|
||||
if (!this.isDisposed) {
|
||||
this.bracketDecorations.forEach((decoration) => {
|
||||
decoration.dispose();
|
||||
});
|
||||
this.bracketDecorations.clear();
|
||||
this.gutterIcons.Dispose();
|
||||
this.isDisposed = true;
|
||||
}
|
||||
}
|
||||
createGutterBracketDecorations(color, bracket) {
|
||||
const gutterIcon = this.gutterIcons.GetIconUri(bracket, color);
|
||||
const decorationSettings = {
|
||||
gutterIconPath: gutterIcon,
|
||||
};
|
||||
const decoration = vscode.window.createTextEditorDecorationType(decorationSettings);
|
||||
return decoration;
|
||||
}
|
||||
createRulerBracketDecorations(color) {
|
||||
const decorationSettings = {
|
||||
overviewRulerColor: color.includes(".") ? new vscode_1.ThemeColor(color) : color,
|
||||
overviewRulerLane: vscode.OverviewRulerLane[this.rulerPosition],
|
||||
};
|
||||
const decoration = vscode.window.createTextEditorDecorationType(decorationSettings);
|
||||
return decoration;
|
||||
}
|
||||
createScopeBracketDecorations(color) {
|
||||
const decorationSettings = {
|
||||
rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,
|
||||
};
|
||||
let opacity = "1";
|
||||
for (const element of this.activeBracketCSSElements) {
|
||||
const key = element[0];
|
||||
const value = element[1];
|
||||
if (key.includes("Color")) {
|
||||
const cssColor = value.replace("{color}", color);
|
||||
decorationSettings[key] = cssColor.includes(".") ? new vscode_1.ThemeColor(cssColor) : cssColor;
|
||||
continue;
|
||||
}
|
||||
if (key === "opacity") {
|
||||
opacity = value;
|
||||
}
|
||||
else {
|
||||
decorationSettings[key] = value;
|
||||
}
|
||||
}
|
||||
;
|
||||
let borderColorType = typeof (decorationSettings["backgroundColor"]);
|
||||
if (borderColorType === "undefined") {
|
||||
decorationSettings["backgroundColor"] = "; opacity: " + opacity;
|
||||
}
|
||||
else if (borderColorType === "string") {
|
||||
decorationSettings["backgroundColor"] += "; opacity: " + opacity;
|
||||
}
|
||||
const decoration = vscode.window.createTextEditorDecorationType(decorationSettings);
|
||||
return decoration;
|
||||
}
|
||||
createScopeLineDecorations(color, top = true, right = true, bottom = true, left = true, yOffset) {
|
||||
const decorationSettings = {
|
||||
rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,
|
||||
};
|
||||
const none = "none";
|
||||
const topBorder = top ? this.activeScopeLineCSSBorder : none;
|
||||
const rightBorder = right ? this.activeScopeLineCSSBorder : none;
|
||||
const botBorder = bottom ? this.activeScopeLineCSSBorder : none;
|
||||
const leftBorder = left ? this.activeScopeLineCSSBorder : none;
|
||||
let opacity = "1";
|
||||
for (const element of this.activeScopeLineCSSElements) {
|
||||
const key = element[0];
|
||||
const value = element[1];
|
||||
if (key.includes("Color")) {
|
||||
const cssColor = value.replace("{color}", color);
|
||||
decorationSettings[key] = cssColor.includes(".") ? new vscode_1.ThemeColor(cssColor) : cssColor;
|
||||
continue;
|
||||
}
|
||||
if (key === "opacity") {
|
||||
opacity = value;
|
||||
}
|
||||
else {
|
||||
decorationSettings[key] = value;
|
||||
}
|
||||
}
|
||||
let borderColorType = typeof (decorationSettings["borderColor"]);
|
||||
if (borderColorType === "undefined") {
|
||||
decorationSettings["borderColor"] = "; opacity: " + opacity;
|
||||
}
|
||||
else if (borderColorType === "string") {
|
||||
decorationSettings["borderColor"] += "; opacity: " + opacity;
|
||||
}
|
||||
let borderStyle = `${topBorder} ${rightBorder} ${botBorder} ${leftBorder}`;
|
||||
if (yOffset !== undefined && yOffset !== 0) {
|
||||
borderStyle += "; transform: translateY(" + yOffset * 100 + "%); z-index: 1;";
|
||||
}
|
||||
// tslint:disable-next-line:no-string-literal
|
||||
decorationSettings["borderStyle"] = borderStyle;
|
||||
const decoration = vscode.window.createTextEditorDecorationType(decorationSettings);
|
||||
return decoration;
|
||||
}
|
||||
createBracketDecorations() {
|
||||
const decorations = new Map();
|
||||
for (const color of this.colors) {
|
||||
const decoration = vscode.window.createTextEditorDecorationType({
|
||||
color: color.includes(".") ? new vscode_1.ThemeColor(color) : color,
|
||||
rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,
|
||||
});
|
||||
decorations.set(color, decoration);
|
||||
}
|
||||
const unmatchedDecoration = vscode.window.createTextEditorDecorationType({
|
||||
color: this.unmatchedScopeColor, rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,
|
||||
});
|
||||
decorations.set(this.unmatchedScopeColor, unmatchedDecoration);
|
||||
return decorations;
|
||||
}
|
||||
}
|
||||
exports.default = Settings;
|
||||
//# sourceMappingURL=settings.js.map
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const vscode_1 = require("vscode");
|
||||
const bracket_1 = require("./bracket");
|
||||
const bracketClose_1 = require("./bracketClose");
|
||||
class SingularBracketGroup {
|
||||
constructor(settings, previousState) {
|
||||
this.allLinesOpenBracketStack = [];
|
||||
this.allBracketsOnLine = [];
|
||||
this.bracketsHash = "";
|
||||
this.previousOpenBracketColorIndex = -1;
|
||||
this.settings = settings;
|
||||
if (previousState !== undefined) {
|
||||
this.allLinesOpenBracketStack = previousState.currentOpenBracketColorIndexes;
|
||||
this.previousOpenBracketColorIndex = previousState.previousOpenBracketColorIndex;
|
||||
}
|
||||
}
|
||||
getPreviousIndex(type) {
|
||||
return this.previousOpenBracketColorIndex;
|
||||
}
|
||||
getAllBrackets() {
|
||||
return this.allBracketsOnLine;
|
||||
}
|
||||
addOpenBracket(token, colorIndex) {
|
||||
const openBracket = new bracket_1.default(token, this.settings.colors[colorIndex]);
|
||||
this.allLinesOpenBracketStack.push(openBracket);
|
||||
this.allBracketsOnLine.push(openBracket);
|
||||
this.bracketsHash += openBracket.token.character;
|
||||
this.previousOpenBracketColorIndex = colorIndex;
|
||||
}
|
||||
GetAmountOfOpenBrackets(type) {
|
||||
return this.allLinesOpenBracketStack.length;
|
||||
}
|
||||
addCloseBracket(token) {
|
||||
if (this.allLinesOpenBracketStack.length > 0) {
|
||||
if (this.allLinesOpenBracketStack[this.allLinesOpenBracketStack.length - 1].token.type === token.type) {
|
||||
const openBracket = this.allLinesOpenBracketStack.pop();
|
||||
const closeBracket = new bracketClose_1.default(token, openBracket);
|
||||
this.allBracketsOnLine.push(closeBracket);
|
||||
this.bracketsHash += closeBracket.token.character;
|
||||
return;
|
||||
}
|
||||
}
|
||||
const orphan = new bracket_1.default(token, this.settings.unmatchedScopeColor);
|
||||
this.allBracketsOnLine.push(orphan);
|
||||
this.bracketsHash += orphan.token.character;
|
||||
}
|
||||
getClosingBracket(position) {
|
||||
for (const bracket of this.allBracketsOnLine) {
|
||||
if (!(bracket instanceof bracketClose_1.default)) {
|
||||
continue;
|
||||
}
|
||||
const closeBracket = bracket;
|
||||
const openBracket = closeBracket.openBracket;
|
||||
const range = new vscode_1.Range(openBracket.token.range.start.translate(0, 1), closeBracket.token.range.end.translate(0, -1));
|
||||
if (range.contains(position)) {
|
||||
return closeBracket;
|
||||
}
|
||||
}
|
||||
}
|
||||
getHash() {
|
||||
return this.bracketsHash;
|
||||
}
|
||||
offset(startIndex, amount) {
|
||||
for (const bracket of this.allBracketsOnLine) {
|
||||
if (bracket.token.range.start.character >= startIndex) {
|
||||
bracket.token.offset(amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
copyCumulativeState() {
|
||||
return new SingularBracketGroup(this.settings, {
|
||||
currentOpenBracketColorIndexes: this.allLinesOpenBracketStack.slice(),
|
||||
previousOpenBracketColorIndex: this.previousOpenBracketColorIndex,
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.default = SingularBracketGroup;
|
||||
//# sourceMappingURL=singularIndex.js.map
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class TextLine {
|
||||
constructor(ruleStack, lineState, index) {
|
||||
this.lineState = lineState;
|
||||
this.ruleStack = ruleStack;
|
||||
this.index = index;
|
||||
}
|
||||
getRuleStack() {
|
||||
return this.ruleStack;
|
||||
}
|
||||
// Return a copy of the line while mantaining bracket state. colorRanges is not mantained.
|
||||
cloneState() {
|
||||
return this.lineState.cloneState();
|
||||
}
|
||||
getBracketHash() {
|
||||
return this.lineState.getBracketHash();
|
||||
}
|
||||
AddToken(currentChar, index, key, open) {
|
||||
this.lineState.addBracket(key, currentChar, index, this.index, open);
|
||||
}
|
||||
getClosingBracket(position) {
|
||||
return this.lineState.getClosingBracket(position);
|
||||
}
|
||||
offset(startIndex, amount) {
|
||||
this.lineState.offset(startIndex, amount);
|
||||
}
|
||||
getAllBrackets() {
|
||||
return this.lineState.getAllBrackets();
|
||||
}
|
||||
}
|
||||
exports.default = TextLine;
|
||||
//# sourceMappingURL=textLine.js.map
|
||||
|
|
@ -1,145 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TextMateLoader = void 0;
|
||||
const path = require("path");
|
||||
const vscode = require("vscode");
|
||||
const fs = require("fs");
|
||||
const bracketUtil_1 = require("./bracketUtil");
|
||||
const JSON5 = require("json5");
|
||||
const languageConfig_1 = require("./languageConfig");
|
||||
class TextMateLoader {
|
||||
constructor() {
|
||||
this.scopeNameToLanguage = new Map();
|
||||
this.scopeNameToPath = new Map();
|
||||
this.languageToScopeName = new Map();
|
||||
this.languageToConfigPath = new Map();
|
||||
this.languageId = 1;
|
||||
this.languageConfigs = new Map();
|
||||
this.initializeGrammars();
|
||||
this.vsctm = this.loadTextMate();
|
||||
this.oniguruma = this.loadOniguruma();
|
||||
}
|
||||
tryGetLanguageConfig(languageID) {
|
||||
const existingTokenizer = this.languageConfigs.get(languageID);
|
||||
if (existingTokenizer) {
|
||||
return existingTokenizer;
|
||||
}
|
||||
const scopeName = this.languageToScopeName.get(languageID);
|
||||
if (!scopeName) {
|
||||
return;
|
||||
}
|
||||
const configPath = this.languageToConfigPath.get(languageID);
|
||||
if (!configPath) {
|
||||
return;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.readFile(configPath, (error, content) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
else {
|
||||
const config = JSON5.parse(content.toString());
|
||||
const brackets = config.brackets;
|
||||
resolve(brackets);
|
||||
}
|
||||
});
|
||||
}).then((brackets) => {
|
||||
if (!brackets) {
|
||||
return null;
|
||||
}
|
||||
const registry = new this.vsctm.Registry({
|
||||
// tslint:disable-next-line:object-literal-shorthand
|
||||
onigLib: Promise.resolve({
|
||||
createOnigScanner: (sources) => new this.oniguruma.OnigScanner(sources),
|
||||
createOnigString: (str) => new this.oniguruma.OnigString(str)
|
||||
}),
|
||||
loadGrammar: (scopeName) => {
|
||||
const path = this.scopeNameToPath.get(scopeName);
|
||||
if (!path) {
|
||||
return null;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.readFile(path, (error, content) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
else {
|
||||
const text = content.toString();
|
||||
const rawGrammar = this.vsctm.parseRawGrammar(text, path);
|
||||
resolve(rawGrammar);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
// Load the JavaScript grammar and any other grammars included by it async.
|
||||
return registry.loadGrammarWithConfiguration(scopeName, this.languageId++, {}).then((grammar) => {
|
||||
if (grammar) {
|
||||
if (!this.languageConfigs.has(languageID)) {
|
||||
const mappedBrackets = brackets.map((b) => ({ open: b[0], close: b[1] }))
|
||||
.filter((e) => e.open !== "<" && e.close !== ">");
|
||||
if (mappedBrackets.length === 0) {
|
||||
return;
|
||||
}
|
||||
const bracketToId = new Map();
|
||||
for (let i = 0; i < brackets.length; i++) {
|
||||
const bracket = brackets[i];
|
||||
bracketToId.set(bracket[0], { open: true, key: i });
|
||||
bracketToId.set(bracket[1], { open: false, key: i });
|
||||
}
|
||||
let maxBracketLength = 0;
|
||||
for (const bracket of mappedBrackets) {
|
||||
maxBracketLength = Math.max(maxBracketLength, bracket.open.length);
|
||||
maxBracketLength = Math.max(maxBracketLength, bracket.close.length);
|
||||
}
|
||||
const regex = bracketUtil_1.getRegexForBrackets(mappedBrackets);
|
||||
this.languageConfigs.set(languageID, new languageConfig_1.default(grammar, regex, bracketToId));
|
||||
}
|
||||
}
|
||||
return grammar;
|
||||
});
|
||||
});
|
||||
}
|
||||
getNodeModulePath(moduleName) {
|
||||
return path.join(vscode.env.appRoot, 'node_modules.asar', moduleName);
|
||||
}
|
||||
getNodeModule(moduleName) {
|
||||
return require(this.getNodeModulePath(moduleName));
|
||||
}
|
||||
loadTextMate() {
|
||||
return this.getNodeModule("vscode-textmate");
|
||||
}
|
||||
loadOniguruma() {
|
||||
const oniguruma = this.getNodeModule("vscode-oniguruma");
|
||||
const wasmPath = path.join(this.getNodeModulePath("vscode-oniguruma"), 'release', 'onig.wasm');
|
||||
const onigurumaWasm = fs.readFileSync(wasmPath).buffer;
|
||||
oniguruma.loadWASM(onigurumaWasm);
|
||||
return oniguruma;
|
||||
}
|
||||
initializeGrammars() {
|
||||
for (const extension of vscode.extensions.all) {
|
||||
const packageJSON = extension.packageJSON;
|
||||
if (packageJSON.contributes) {
|
||||
if (packageJSON.contributes.grammars && packageJSON.contributes.languages) {
|
||||
for (const grammar of packageJSON.contributes.grammars) {
|
||||
if (grammar.language && grammar.scopeName && grammar.path) {
|
||||
const fullPath = path.join(extension.extensionPath, grammar.path);
|
||||
this.languageToScopeName.set(grammar.language, grammar.scopeName);
|
||||
this.scopeNameToPath.set(grammar.scopeName, fullPath);
|
||||
this.scopeNameToLanguage.set(grammar.scopeName, grammar.language);
|
||||
}
|
||||
}
|
||||
for (const language of packageJSON.contributes.languages) {
|
||||
if (language.configuration) {
|
||||
const configPath = path.join(extension.extensionPath, language.configuration);
|
||||
this.languageToConfigPath.set(language.id, configPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.TextMateLoader = TextMateLoader;
|
||||
exports.default = TextMateLoader;
|
||||
//# sourceMappingURL=textMateLoader.js.map
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const vscode_1 = require("vscode");
|
||||
class Token {
|
||||
constructor(type, character, beginIndex, lineIndex) {
|
||||
this.type = type;
|
||||
this.character = character;
|
||||
const startPos = new vscode_1.Position(lineIndex, beginIndex);
|
||||
const endPos = startPos.translate(0, character.length);
|
||||
this.range = new vscode_1.Range(startPos, endPos);
|
||||
}
|
||||
offset(amount) {
|
||||
this.range = new vscode_1.Range(this.range.start.translate(0, amount), this.range.end.translate(0, amount));
|
||||
}
|
||||
}
|
||||
exports.default = Token;
|
||||
//# sourceMappingURL=token.js.map
|
||||
|
|
@ -1,218 +0,0 @@
|
|||
"use strict";
|
||||
// tslint:disable:no-bitwise
|
||||
// tslint:disable:max-classes-per-file
|
||||
// tslint:disable:variable-name
|
||||
// tslint:disable:member-access
|
||||
// tslint:disable:member-ordering
|
||||
// tslint:disable:prefer-const
|
||||
// tslint:disable:max-line-length
|
||||
// tslint:disable:quotemark
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TokenMetadata = exports.SlicedLineTokens = exports.LineTokens = exports.ignoreBracketsInToken = void 0;
|
||||
function ignoreBracketsInToken(standardTokenType) {
|
||||
return (standardTokenType & 7 /* value */) !== 0;
|
||||
}
|
||||
exports.ignoreBracketsInToken = ignoreBracketsInToken;
|
||||
class LineTokens {
|
||||
constructor(tokens, text) {
|
||||
this._tokens = tokens;
|
||||
this._tokensCount = (this._tokens.length >>> 1);
|
||||
this._text = text;
|
||||
}
|
||||
equals(other) {
|
||||
if (other instanceof LineTokens) {
|
||||
return this.slicedEquals(other, 0, this._tokensCount);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
slicedEquals(other, sliceFromTokenIndex, sliceTokenCount) {
|
||||
if (this._text !== other._text) {
|
||||
return false;
|
||||
}
|
||||
if (this._tokensCount !== other._tokensCount) {
|
||||
return false;
|
||||
}
|
||||
const from = (sliceFromTokenIndex << 1);
|
||||
const to = from + (sliceTokenCount << 1);
|
||||
for (let i = from; i < to; i++) {
|
||||
if (this._tokens[i] !== other._tokens[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
getLineContent() {
|
||||
return this._text;
|
||||
}
|
||||
getCount() {
|
||||
return this._tokensCount;
|
||||
}
|
||||
getStartOffset(tokenIndex) {
|
||||
if (tokenIndex > 0) {
|
||||
return this._tokens[(tokenIndex - 1) << 1];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
getLanguageId(tokenIndex) {
|
||||
const metadata = this._tokens[(tokenIndex << 1) + 1];
|
||||
return TokenMetadata.getLanguageId(metadata);
|
||||
}
|
||||
getStandardTokenType(tokenIndex) {
|
||||
const metadata = this._tokens[(tokenIndex << 1) + 1];
|
||||
return TokenMetadata.getTokenType(metadata);
|
||||
}
|
||||
getForeground(tokenIndex) {
|
||||
const metadata = this._tokens[(tokenIndex << 1) + 1];
|
||||
return TokenMetadata.getForeground(metadata);
|
||||
}
|
||||
getClassName(tokenIndex) {
|
||||
const metadata = this._tokens[(tokenIndex << 1) + 1];
|
||||
return TokenMetadata.getClassNameFromMetadata(metadata);
|
||||
}
|
||||
getInlineStyle(tokenIndex, colorMap) {
|
||||
const metadata = this._tokens[(tokenIndex << 1) + 1];
|
||||
return TokenMetadata.getInlineStyleFromMetadata(metadata, colorMap);
|
||||
}
|
||||
getEndOffset(tokenIndex) {
|
||||
return this._tokens[tokenIndex << 1];
|
||||
}
|
||||
/**
|
||||
* Find the token containing offset `offset`.
|
||||
* @param offset The search offset
|
||||
* @return The index of the token containing the offset.
|
||||
*/
|
||||
findTokenIndexAtOffset(offset) {
|
||||
return LineTokens.findIndexInTokensArray(this._tokens, offset);
|
||||
}
|
||||
inflate() {
|
||||
return this;
|
||||
}
|
||||
sliceAndInflate(startOffset, endOffset, deltaOffset) {
|
||||
return new SlicedLineTokens(this, startOffset, endOffset, deltaOffset);
|
||||
}
|
||||
static convertToEndOffset(tokens, lineTextLength) {
|
||||
const tokenCount = (tokens.length >>> 1);
|
||||
const lastTokenIndex = tokenCount - 1;
|
||||
for (let tokenIndex = 0; tokenIndex < lastTokenIndex; tokenIndex++) {
|
||||
tokens[tokenIndex << 1] = tokens[(tokenIndex + 1) << 1];
|
||||
}
|
||||
tokens[lastTokenIndex << 1] = lineTextLength;
|
||||
}
|
||||
static findIndexInTokensArray(tokens, desiredIndex) {
|
||||
if (tokens.length <= 2) {
|
||||
return 0;
|
||||
}
|
||||
let low = 0;
|
||||
let high = (tokens.length >>> 1) - 1;
|
||||
while (low < high) {
|
||||
let mid = low + Math.floor((high - low) / 2);
|
||||
let endOffset = tokens[(mid << 1)];
|
||||
if (endOffset === desiredIndex) {
|
||||
return mid + 1;
|
||||
}
|
||||
else if (endOffset < desiredIndex) {
|
||||
low = mid + 1;
|
||||
}
|
||||
else if (endOffset > desiredIndex) {
|
||||
high = mid;
|
||||
}
|
||||
}
|
||||
return low;
|
||||
}
|
||||
}
|
||||
exports.LineTokens = LineTokens;
|
||||
class SlicedLineTokens {
|
||||
constructor(source, startOffset, endOffset, deltaOffset) {
|
||||
this._source = source;
|
||||
this._startOffset = startOffset;
|
||||
this._endOffset = endOffset;
|
||||
this._deltaOffset = deltaOffset;
|
||||
this._firstTokenIndex = source.findTokenIndexAtOffset(startOffset);
|
||||
this._tokensCount = 0;
|
||||
for (let i = this._firstTokenIndex, len = source.getCount(); i < len; i++) {
|
||||
const tokenStartOffset = source.getStartOffset(i);
|
||||
if (tokenStartOffset >= endOffset) {
|
||||
break;
|
||||
}
|
||||
this._tokensCount++;
|
||||
}
|
||||
}
|
||||
equals(other) {
|
||||
if (other instanceof SlicedLineTokens) {
|
||||
return (this._startOffset === other._startOffset
|
||||
&& this._endOffset === other._endOffset
|
||||
&& this._deltaOffset === other._deltaOffset
|
||||
&& this._source.slicedEquals(other._source, this._firstTokenIndex, this._tokensCount));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
getCount() {
|
||||
return this._tokensCount;
|
||||
}
|
||||
getForeground(tokenIndex) {
|
||||
return this._source.getForeground(this._firstTokenIndex + tokenIndex);
|
||||
}
|
||||
getEndOffset(tokenIndex) {
|
||||
const tokenEndOffset = this._source.getEndOffset(this._firstTokenIndex + tokenIndex);
|
||||
return Math.min(this._endOffset, tokenEndOffset) - this._startOffset + this._deltaOffset;
|
||||
}
|
||||
getClassName(tokenIndex) {
|
||||
return this._source.getClassName(this._firstTokenIndex + tokenIndex);
|
||||
}
|
||||
getInlineStyle(tokenIndex, colorMap) {
|
||||
return this._source.getInlineStyle(this._firstTokenIndex + tokenIndex, colorMap);
|
||||
}
|
||||
findTokenIndexAtOffset(offset) {
|
||||
return this._source.findTokenIndexAtOffset(offset + this._startOffset - this._deltaOffset) - this._firstTokenIndex;
|
||||
}
|
||||
}
|
||||
exports.SlicedLineTokens = SlicedLineTokens;
|
||||
class TokenMetadata {
|
||||
static getLanguageId(metadata) {
|
||||
return (metadata & 255 /* LANGUAGEID_MASK */) >>> 0 /* LANGUAGEID_OFFSET */;
|
||||
}
|
||||
static getTokenType(metadata) {
|
||||
return (metadata & 1792 /* TOKEN_TYPE_MASK */) >>> 8 /* TOKEN_TYPE_OFFSET */;
|
||||
}
|
||||
static getFontStyle(metadata) {
|
||||
return (metadata & 14336 /* FONT_STYLE_MASK */) >>> 11 /* FONT_STYLE_OFFSET */;
|
||||
}
|
||||
static getForeground(metadata) {
|
||||
return (metadata & 8372224 /* FOREGROUND_MASK */) >>> 14 /* FOREGROUND_OFFSET */;
|
||||
}
|
||||
static getBackground(metadata) {
|
||||
return (metadata & 4286578688 /* BACKGROUND_MASK */) >>> 23 /* BACKGROUND_OFFSET */;
|
||||
}
|
||||
static getClassNameFromMetadata(metadata) {
|
||||
let foreground = this.getForeground(metadata);
|
||||
let className = 'mtk' + foreground;
|
||||
let fontStyle = this.getFontStyle(metadata);
|
||||
if (fontStyle & 1 /* Italic */) {
|
||||
className += ' mtki';
|
||||
}
|
||||
if (fontStyle & 2 /* Bold */) {
|
||||
className += ' mtkb';
|
||||
}
|
||||
if (fontStyle & 4 /* Underline */) {
|
||||
className += ' mtku';
|
||||
}
|
||||
return className;
|
||||
}
|
||||
static getInlineStyleFromMetadata(metadata, colorMap) {
|
||||
const foreground = this.getForeground(metadata);
|
||||
const fontStyle = this.getFontStyle(metadata);
|
||||
let result = `color: ${colorMap[foreground]};`;
|
||||
if (fontStyle & 1 /* Italic */) {
|
||||
result += 'font-style: italic;';
|
||||
}
|
||||
if (fontStyle & 2 /* Bold */) {
|
||||
result += 'font-weight: bold;';
|
||||
}
|
||||
if (fontStyle & 4 /* Underline */) {
|
||||
result += 'text-decoration: underline;';
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
exports.TokenMetadata = TokenMetadata;
|
||||
//# sourceMappingURL=vscodeFiles.js.map
|
||||
|
|
@ -1,193 +0,0 @@
|
|||
{
|
||||
"name": "bracket-pair-colorizer-2",
|
||||
"displayName": "Bracket Pair Colorizer 2",
|
||||
"description": "A customizable extension for colorizing matching brackets",
|
||||
"version": "0.2.1",
|
||||
"publisher": "CoenraadS",
|
||||
"engines": {
|
||||
"vscode": "^1.45.0"
|
||||
},
|
||||
"icon": "images/icon.png",
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"extensionKind": [
|
||||
"ui",
|
||||
"workspace"
|
||||
],
|
||||
"activationEvents": [
|
||||
"onStartupFinished"
|
||||
],
|
||||
"keywords": [
|
||||
"bracket",
|
||||
"brackets",
|
||||
"pair",
|
||||
"color",
|
||||
"colour",
|
||||
"multi-root ready"
|
||||
],
|
||||
"galleryBanner": {
|
||||
"color": "#1E1E1E",
|
||||
"theme": "dark"
|
||||
},
|
||||
"main": "./out/src/extension",
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "bracket-pair-colorizer-2.expandBracketSelection",
|
||||
"title": "Expand Bracket Selection"
|
||||
},
|
||||
{
|
||||
"command": "bracket-pair-colorizer-2.undoBracketSelection",
|
||||
"title": "Undo Bracket Selection"
|
||||
}
|
||||
],
|
||||
"configuration": {
|
||||
"type": "object",
|
||||
"title": "Bracket Pair Colorizer 2",
|
||||
"properties": {
|
||||
"bracket-pair-colorizer-2.colors": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"Gold",
|
||||
"Orchid",
|
||||
"LightSkyBlue"
|
||||
],
|
||||
"description": "Scope colors",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.unmatchedScopeColor": {
|
||||
"type": "string",
|
||||
"default": "Red",
|
||||
"description": "Unmatched Scope Color",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.forceUniqueOpeningColor": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Ensure that an opening brackets color does not match a previous brackets color",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.forceIterationColorCycle": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Should opening brackets iterate the color cycle even if they are not nested",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.colorMode": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Consecutive",
|
||||
"Independent"
|
||||
],
|
||||
"default": "Consecutive",
|
||||
"description": "Should different brackets share a color group (Consecutive), or use their own color group (Independent)",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.highlightActiveScope": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Should the active scope brackets always be highlighted? Recommended to disable editor.matchBrackets if using this feature.",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.activeScopeCSS": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"borderStyle : solid",
|
||||
"borderWidth : 1px",
|
||||
"borderColor : {color}",
|
||||
"opacity: 0.5"
|
||||
],
|
||||
"description": "CSS for the active scope. Use {color} to match the bracket color. The string types listed at https://code.visualstudio.com/docs/extensionAPI/vscode-api#DecorationRenderOptions can be used",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.showBracketsInGutter": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Show active bracket scope in gutter?",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.showBracketsInRuler": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Show active bracket scope in ruler?",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.rulerPosition": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Center",
|
||||
"Full",
|
||||
"Left",
|
||||
"Right"
|
||||
],
|
||||
"default": "Center",
|
||||
"description": "Show active bracket scope in ruler?",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.showVerticalScopeLine": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Show a vertical line on the left side of the editor representing the active bracket scope?",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.showHorizontalScopeLine": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Show a horizontal line to create a block around the active bracket scope?",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.scopeLineRelativePosition": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "True: Scope Line will start from the ending bracket position. False: Scope Line will always be at column 0",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.scopeLineCSS": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"borderStyle : solid",
|
||||
"borderWidth : 1px",
|
||||
"borderColor : {color}",
|
||||
"opacity: 0.5"
|
||||
],
|
||||
"description": "CSS for the scope line. Use {color} to match the bracket color. The string types listed at https://code.visualstudio.com/docs/extensionAPI/vscode-api#DecorationRenderOptions can be used",
|
||||
"scope": "window"
|
||||
},
|
||||
"bracket-pair-colorizer-2.excludedLanguages": {
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"description": "Don't colorize files of these languages",
|
||||
"scope": "window"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "tsc -p ./",
|
||||
"compile": "tsc -watch -p ./"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/json5": "0.0.30",
|
||||
"@types/node": "^6.14.13",
|
||||
"tslint": "^4.5.1",
|
||||
"typescript": "^4.3.2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/CoenraadS/Bracket-Pair-Colorizer-2"
|
||||
},
|
||||
"license": "SEE LICENSE IN LICENSE.md",
|
||||
"dependencies": {
|
||||
"@types/vscode": "^1.57.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"json5": "^2.2.0",
|
||||
"vscode-uri": "^1.0.6"
|
||||
},
|
||||
"__metadata": {
|
||||
"id": "5a6e2b21-1d61-4acd-b31b-907f9c23f18a",
|
||||
"publisherId": "d0a031ad-49a6-4982-aba0-6391e97e948b",
|
||||
"publisherDisplayName": "CoenraadS",
|
||||
"installedTimestamp": 1632235492796
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||
<Metadata>
|
||||
<Identity Language="en-US" Id="vscode-eslint" Version="2.1.23" Publisher="dbaeumer"/>
|
||||
<DisplayName>ESLint</DisplayName>
|
||||
<Description xml:space="preserve">Integrates ESLint JavaScript into VS Code.</Description>
|
||||
<Tags>multi-root ready,json,ignore,__ext_eslintignore,jsonc,javascript,linters</Tags>
|
||||
<Categories>Programming Languages,Linters</Categories>
|
||||
<GalleryFlags>Public</GalleryFlags>
|
||||
<Badges></Badges>
|
||||
<Properties>
|
||||
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.57.0" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="workspace" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/Microsoft/vscode-eslint.git" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/Microsoft/vscode-eslint.git" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/Microsoft/vscode-eslint.git" />
|
||||
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Support" Value="https://github.com/Microsoft/vscode-eslint/issues" />
|
||||
|
||||
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" />
|
||||
|
||||
|
||||
|
||||
</Properties>
|
||||
<License>extension/License.txt</License>
|
||||
<Icon>extension/eslint_icon.png</Icon>
|
||||
</Metadata>
|
||||
<Installation>
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
|
||||
</Installation>
|
||||
<Dependencies/>
|
||||
<Assets>
|
||||
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
|
||||
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.Changelog" Path="extension/CHANGELOG.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.License" Path="extension/License.txt" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Icons.Default" Path="extension/eslint_icon.png" Addressable="true" />
|
||||
</Assets>
|
||||
</PackageManifest>
|
||||
|
|
@ -1,393 +0,0 @@
|
|||
### 2.1.23
|
||||
|
||||
- Fixes [Server should provide default result for code actions so that canceled requests can be removed from queue](https://github.com/microsoft/vscode-eslint/issues/1283)
|
||||
|
||||
### 2.1.22
|
||||
|
||||
- adapt VS Code's workspace trust model. As a consequence the custom dialog ESLint introduced in version `2.1.7` got removed.
|
||||
- Various [bug fixes](https://github.com/microsoft/vscode-eslint/issues?q=milestone%3A2.1.22+)
|
||||
|
||||
|
||||
### 2.1.21
|
||||
|
||||
- Internal insider release.
|
||||
|
||||
### 2.1.20
|
||||
|
||||
- Merged [Implement eslint.rules.customizations - with overrides](https://github.com/microsoft/vscode-eslint/pull/1164)
|
||||
|
||||
### 2.1.19
|
||||
|
||||
- fixed [Using `eslint.nodePath` globally rather than locally, yet on every new window: `The eslint.nodePath setting requires user confirmation. To do so execute the Select Node Path command.`](https://github.com/microsoft/vscode-eslint/issues/1203)
|
||||
|
||||
### 2.1.18
|
||||
|
||||
- warn about nodePath values being defined separately in the workspace folder although a multi workspace folder setup is open.
|
||||
|
||||
### 2.1.17
|
||||
|
||||
- add user confirmation for the `eslint.runtime` and the `eslint.nodePath` setting
|
||||
- fixed [command to restart server or plugins without quitting vscode](https://github.com/microsoft/vscode-eslint/issues/164)
|
||||
|
||||
### 2.1.16
|
||||
|
||||
- Updated Readme document.
|
||||
|
||||
### 2.1.15
|
||||
|
||||
- Internal insider release.
|
||||
|
||||
### 2.1.14
|
||||
|
||||
- Update to version 7.0.0 of the LSP libraries
|
||||
- Various [bug fixes](https://github.com/microsoft/vscode-eslint/issues?q=is%3Aissue+is%3Aclosed+milestone%3A2.1.14).
|
||||
|
||||
### 2.1.13
|
||||
|
||||
- [v2.1.10 - Extension 'ESlint' cannot format file](https://github.com/microsoft/vscode-eslint/issues/1086)
|
||||
|
||||
### 2.1.11 & 2.1.12
|
||||
|
||||
- Internal insider release.
|
||||
|
||||
### 2.1.10
|
||||
|
||||
- Add an 'Always Allow' to the library confirmation dialog added in 2.1.7. Also added a status indication show the ESLint library decision mode.
|
||||
- Fixed vulnerability described in [CVE-2021-27081](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-27081)
|
||||
|
||||
### 2.1.9
|
||||
|
||||
- Internal insider release.
|
||||
|
||||
### 2.1.8
|
||||
|
||||
- Polish the message of the confirmation dialog that was introduced in 2.1.7
|
||||
- Fix bug that caused the confirmation dialog to pop up for all open editors when not trusting the local version of VS Code
|
||||
|
||||
### 2.1.7
|
||||
|
||||
- Ask the user for confirmation before executing the code from an installed ESLint library. Also added commands to manage the decisions made for the ESLint libraries.
|
||||
|
||||
### 2.1.6
|
||||
|
||||
- Update LSP libraries
|
||||
|
||||
### 2.1.5
|
||||
|
||||
- [UnhandledPromiseRejectionWarning: Error: Request workspace/configuration failed with message: Cannot read property 'source.fixAll.eslint' of null](https://github.com/microsoft/vscode-eslint/issues/950)
|
||||
- ["Do you want Code to open the external website?" on eslint errors](https://github.com/microsoft/vscode-eslint/issues/949)
|
||||
- [all suggestions being applied on save](https://github.com/microsoft/vscode-eslint/issues/947)
|
||||
- [Error: "Cannot read property 'source.fixAll.eslint' of null"](https://github.com/microsoft/vscode-eslint/issues/945)
|
||||
|
||||
### 2.1.4
|
||||
|
||||
- Was used as an insider preview release.
|
||||
|
||||
### 2.1.3
|
||||
|
||||
- [FixAll on save doesn't pick up file change from organize imports](https://github.com/microsoft/vscode-eslint/issues/939)
|
||||
|
||||
### 2.1.2
|
||||
|
||||
- [Adopt new link support in diagnostics](https://github.com/microsoft/vscode-eslint/issues/911)
|
||||
|
||||
### 2.1.1
|
||||
|
||||
- [Support for ESLint suggest API](https://github.com/microsoft/vscode-eslint/pull/814)
|
||||
|
||||
### 2.0.15
|
||||
|
||||
- Update to latest LSP libraries
|
||||
|
||||
### 2.0.14
|
||||
|
||||
- Bug Fixes:
|
||||
- [Auto fix made double comma to fix trailing comma](https://github.com/microsoft/vscode-eslint/issues/871)
|
||||
|
||||
### 2.0.13
|
||||
|
||||
- Fixes [no validation of .vue files (2.0.12)](https://github.com/microsoft/vscode-eslint/issues/870)
|
||||
|
||||
### 2.0.12
|
||||
|
||||
- Improved performance for code actions on save by reusing fixes for already known problems.
|
||||
- Added a setting `eslint.codeActionsOnSave.mode` to revive the 1.9.x version behavior of only fixing already known problems on save.
|
||||
- Bug fixes:
|
||||
- [Can't lint .ts files when use vue-eslint-parser](https://github.com/microsoft/vscode-eslint/issues/864)
|
||||
|
||||
### 2.0.11
|
||||
|
||||
- Fixes [Eslint not working when open above level directory](https://github.com/microsoft/vscode-eslint/issues/854)
|
||||
|
||||
### 2.0.10
|
||||
|
||||
- Various bug fixes especially around settings migration.
|
||||
|
||||
### 2.0.4
|
||||
|
||||
A new major version of the extension. Major improvements are around code actions on save, formatting, working directory setup and validating of TypeScript files.
|
||||
|
||||
### 1.9.2
|
||||
|
||||
- Moved to latest LSP libraries
|
||||
- Fixed [Document change might not cause re-validation. Results in stale errors](https://github.com/microsoft/vscode-eslint/issues/758)
|
||||
- Merged [Fix None position values in publishDiagnostics message](https://github.com/microsoft/vscode-eslint/pull/753)
|
||||
|
||||
### 1.9.1
|
||||
|
||||
- Moved to latest LSP libraries
|
||||
- Add experimental support for delta document sync
|
||||
- Add support for [eslint.lintTask.options] (https://github.com/microsoft/vscode-eslint/pull/698)
|
||||
- Add support for `eslint.experimental.incrementalSync` which enable incremental document synchronization for improved performance.
|
||||
|
||||
### 1.9.0
|
||||
|
||||
- Moved to latest LSP libraries
|
||||
- Added support for [eslint.quiet](https://github.com/microsoft/vscode-eslint/pull/661)
|
||||
|
||||
### 1.8.2
|
||||
|
||||
- Fix version mismatch problem between LSP client lib and VS Code version.
|
||||
|
||||
### 1.8.1
|
||||
|
||||
- Moved to latest LSP libraries
|
||||
- Web pack extension and server
|
||||
- Fixes [Extension causes high CPU load](https://github.com/Microsoft/vscode-eslint/issues/620)
|
||||
|
||||
### 1.8.0
|
||||
|
||||
- Moved to latest LSP libraries
|
||||
- Merged in [PR [#588](https://github.com/Microsoft/vscode-eslint/issues/588)](https://github.com/Microsoft/vscode-eslint/pull/588/) which adds to turn off the actions to disable rules per line and to open the documentation.
|
||||
- Merged in [PR [#572](https://github.com/Microsoft/vscode-eslint/issues/572)](https://github.com/Microsoft/vscode-eslint/pull/572) which adds support for pnpm.
|
||||
|
||||
### 1.7.0
|
||||
|
||||
- Merged in [PR [#530](https://github.com/Microsoft/vscode-eslint/issues/530)](https://github.com/Microsoft/vscode-eslint/pull/530) which adds support to disable a rule per line or for the whole file as well as navigating to the documentation.
|
||||
|
||||
### 1.6.1
|
||||
|
||||
- Fixes [#558](https://github.com/Microsoft/vscode-eslint/issues/558) to adopt new functionality in VS Code 1.28
|
||||
|
||||
### 1.6.0
|
||||
|
||||
- Adopt the LSP JSON tracing options from the LSP libraries to enable better tracing support
|
||||
|
||||
### 1.5.0
|
||||
|
||||
- Allow setting the node runtime to use for the language server. Fixes [#345](https://github.com/Microsoft/vscode-eslint/issues/345) [PR [#516](https://github.com/Microsoft/vscode-eslint/issues/516)](https://github.com/Microsoft/vscode-eslint/pull/516)
|
||||
- eslintignore comment syntax highlighting [PR [#473](https://github.com/Microsoft/vscode-eslint/issues/473)](https://github.com/Microsoft/vscode-eslint/pull/473)
|
||||
|
||||
### 1.4.14
|
||||
|
||||
- Include `semver` for client
|
||||
|
||||
### 1.4.13
|
||||
|
||||
- Upgraded to latest LSP libraries to handle process spawn / fork crashes under Electron 2.x
|
||||
|
||||
### 1.4.12
|
||||
|
||||
- Upgrade to latest version of the LSP libraries
|
||||
- Fixes [eslint server crashed 5 times in the last 3 minutes. the server will not be restarted.](https://github.com/Microsoft/vscode-eslint/issues/437)
|
||||
|
||||
### 1.4.11
|
||||
|
||||
Internal version to track down [eslint server crashed 5 times in the last 3 minutes. the server will not be restarted.](https://github.com/Microsoft/vscode-eslint/issues/437)
|
||||
|
||||
### 1.4.10
|
||||
|
||||
- [Add Command to create a YAML configuration](https://github.com/Microsoft/vscode-eslint/issues/409)
|
||||
|
||||
### 1.4.9
|
||||
|
||||
- Using latest vscode-languageclient library to fix problems with server restarts and double change notifications.
|
||||
|
||||
### 1.4.8
|
||||
|
||||
- Using latest vscode-languageclient library to get rid of unnecessary console.log statements.
|
||||
|
||||
### 1.4.7
|
||||
|
||||
- [extension not working](https://github.com/Microsoft/vscode-eslint/issues/365)
|
||||
- [Create a task provider for linting the whole workspace](https://github.com/Microsoft/vscode-eslint/pull/410)
|
||||
|
||||
### 1.4.6
|
||||
|
||||
- [Rename server.js to a more specific name so that eslint is easily recognized by code --status](https://github.com/Microsoft/vscode-eslint/issues/406)
|
||||
|
||||
### 1.4.5
|
||||
|
||||
- [UnhandledPromiseRejectionWarning when renaming .eslintrc.json](https://github.com/Microsoft/vscode-eslint/issues/403)
|
||||
- [update error message and add a hint to update yarn setting if using yarn](https://github.com/Microsoft/vscode-eslint/pull/390)
|
||||
|
||||
### 1.4.4
|
||||
|
||||
- [request: better error message if eslint crashes](https://github.com/Microsoft/vscode-eslint/issues/391)
|
||||
|
||||
### 1.4.3
|
||||
|
||||
- Moved to version 3.5.0 of the vscode-languageserver-node libraries.
|
||||
|
||||
### 1.4.2
|
||||
|
||||
- [ESLint should show a warning icon when something failed in the status bar](https://github.com/Microsoft/vscode-eslint/issues/328)
|
||||
|
||||
### 1.4.1
|
||||
|
||||
- small setting description fix.
|
||||
- tagged extension as multi root ready.
|
||||
|
||||
### 1.4.0
|
||||
|
||||
- Add support for [Yarn](https://yarnpkg.com/lang/en/). To use yarn instead of npm with the eslint extension set the settings `"eslint.packageManager": "yarn"`. To use npm set the value to `"npm"`.
|
||||
|
||||
### 1.3.2
|
||||
|
||||
Fixes:
|
||||
|
||||
- [Latest update appears to have broken nodePath specification ](https://github.com/Microsoft/vscode-eslint/issues/298)
|
||||
|
||||
### 1.3.1
|
||||
|
||||
Fixes:
|
||||
|
||||
- [Failed to lint Untitled JavaScript file.](https://github.com/Microsoft/vscode-eslint/issues/295)
|
||||
|
||||
### 1.3.0
|
||||
|
||||
- Add support for multi workspace folder setups. Adding this support required a major code change both on the extension and the server side. So if you recognized problems with this version please report them as quick as possible in the [GitHub repository](https://github.com/Microsoft/vscode-eslint).
|
||||
|
||||
Version 1.3.0 of the ESLint extension requires at least version 1.16 of VS Code.
|
||||
|
||||
### 1.2.11
|
||||
|
||||
Fixes:
|
||||
|
||||
- [(Insiders/1.2.10) "Cannot read property 'then' of undefined](https://github.com/Microsoft/vscode-eslint/issues/240)
|
||||
|
||||
### 1.2.10
|
||||
|
||||
Performance work around code actions and validation. Fixed:
|
||||
|
||||
- [Slowdown on code assist with eslint enabled](https://github.com/Microsoft/vscode-eslint/issues/215)
|
||||
|
||||
### 1.2.9
|
||||
|
||||
This version was an internal test release which wasn't available in the market place
|
||||
|
||||
### 1.2.8
|
||||
|
||||
### Fixes:
|
||||
|
||||
- [Linting is still enabled when viewing git diff.](https://github.com/Microsoft/vscode-eslint/issues/216)
|
||||
|
||||
### 1.2.7
|
||||
|
||||
#### Fixes:
|
||||
|
||||
- [Don't lint git diff.](https://github.com/Microsoft/vscode-eslint/issues/200)
|
||||
|
||||
### 1.2.6
|
||||
|
||||
#### Fixes:
|
||||
|
||||
- [Do not always run eslint from the project's root directory](https://github.com/Microsoft/vscode-eslint/issues/196)
|
||||
- [baseDir should be an absolute path](https://github.com/Microsoft/vscode-eslint/issues/202)
|
||||
|
||||
|
||||
### <a name="RN125"></a>1.2.5
|
||||
|
||||
- Validating a single file (no workspace folder open) will set the working directory to the directory containing the file.
|
||||
- Added support for working directories. ESLint resolves configuration files relative to a working directory. This new settings allows users to control which working directory is used for which files. Consider the following setups:
|
||||
|
||||
```
|
||||
client/
|
||||
.eslintignore
|
||||
.eslintrc.json
|
||||
client.js
|
||||
server/
|
||||
.eslintignore
|
||||
.eslintrc.json
|
||||
server.js
|
||||
```
|
||||
|
||||
Then using the setting:
|
||||
```json
|
||||
"eslint.workingDirectories": [
|
||||
"./client", "./server"
|
||||
]
|
||||
```
|
||||
will validate files inside the server directory with the server directory as the current working directory. Same for files in the client directory. If the setting is omitted the working directory is the workspace folder.
|
||||
|
||||
|
||||
### 1.2.4
|
||||
|
||||
- fixes [.eslintignore is completely ignored](https://github.com/Microsoft/vscode-eslint/issues/198)
|
||||
- reverted fix for [Does not respect nested eslintignore files](https://github.com/Microsoft/vscode-eslint/issues/111) since it broke the use case of a single global .eslintrc file
|
||||
|
||||
### 1.2.3
|
||||
|
||||
- Bug fixes:
|
||||
- [Does not respect nested eslintignore files](https://github.com/Microsoft/vscode-eslint/issues/111)
|
||||
- [eslintrc configuration cascading not being honored ](https://github.com/Microsoft/vscode-eslint/issues/97)
|
||||
- [autoFixOnSave not working with eslint.run=onSave](https://github.com/Microsoft/vscode-eslint/issues/158)
|
||||
- [autoFixOnSave not listed under Settings Options in Readme](https://github.com/Microsoft/vscode-eslint/issues/188)
|
||||
|
||||
### 1.2.2
|
||||
|
||||
- Added configuration options to enable code actions and auto fix on save selectively per language. In release 1.2.1 code actions and auto fix on save very still only
|
||||
available for JavaScript. In 1.2.2 you can now enable this selectively per language. For compatibility it is enabled by default for JavaScript and disabled by default for all
|
||||
other languages. The reason is that I encounter cases for non JavaScript file types where the computed fixes had wrong positions resulting in 'broken' documents. To enable it simply
|
||||
provide an object literal in the validate setting with the properties `language` and `autoFix` instead of a simple `string`. An example is:
|
||||
```json
|
||||
"eslint.validate": [ "javascript", "javascriptreact", { "language": "html", "autoFix": true } ]
|
||||
```
|
||||
|
||||
### <a name="RN121"></a>1.2.1
|
||||
|
||||
- Added support to validate file types other than JavaScript. To enable this, you need to do the following:
|
||||
- Configure ESLint with an additional plugin to do the actual validation. For example, to validate HTML files install
|
||||
`eslint-plugin-html` using `npm install eslint-plugin-html --save-dev` and update the eslint configuration (e.g. .eslintrc.json file)
|
||||
with `"plugin": [ "html" ]`.
|
||||
- Add the corresponding language identifier to the `eslint.validate` setting. Something like `"eslint.validate": [ "javascript", "javascriptreact", "html" ]`.
|
||||
If the setting is missing, it defaults to `["javascript", "javascriptreact"]`
|
||||
|
||||
Please note that code actions and auto fix on save is still only available for JavaScript. The reason is that I detected position problems with fixes contributed by plugins
|
||||
resulting in broken source code when applied.
|
||||
|
||||
### 1.1.0
|
||||
|
||||
- Supports more than one ESLint module installation in a workspace. This eases working with typical client / server setups where ESLint is installed
|
||||
in a `node_modules` folder in the `server` and the `client` directory.
|
||||
- Improved error handling if a plugin can't be loaded.
|
||||
- Added commands to enable and disable ESLint.
|
||||
|
||||
### 1.0.8
|
||||
|
||||
- Supports auto fix on save. Needs to be enabled via `"eslint.autoFixOnSave": true`. Please note that auto fix on save will only happen
|
||||
if the save happened manually or via focus lost. This is consistent with VS Code's format on save behavior. Auto fix on save requires
|
||||
VS Code version 1.6 or newer.
|
||||
|
||||
### 1.0.7
|
||||
|
||||
- Fixed problem with validating package.json when editing .eslintrc.* files.
|
||||
|
||||
### 1.0.5
|
||||
|
||||
- Moving to official 2.5.0 language server libraries.
|
||||
|
||||
### 1.0.4
|
||||
|
||||
- Bug fixing: eslint is validating package.json files
|
||||
|
||||
### 1.0.3
|
||||
|
||||
- Errors in configuration files are only shown in a status message if the file is not open in the editor. Otherwise message are shown in the output channel only.
|
||||
|
||||
### 1.0.2
|
||||
|
||||
- Added a status bar item to inform the user about problems with ESLint. A message box only appears if the user attention is required.
|
||||
- Improved handling of missing corrupted configuration files.
|
||||
- The ESLint package is now loaded from parent folders as well.
|
||||
- Added an action to create a .eslintrc.json file.
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
Copyright (c) Microsoft Corporation
|
||||
|
||||
All rights reserved.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
|
||||
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
|
@ -1,261 +0,0 @@
|
|||
# VS Code ESLint extension
|
||||
|
||||
[](https://dev.azure.com/ms/vscode-eslint/_build/latest?definitionId=18)
|
||||
|
||||
Integrates [ESLint](http://eslint.org/) into VS Code. If you are new to ESLint check the [documentation](http://eslint.org/).
|
||||
|
||||
The extension uses the ESLint library installed in the opened workspace folder. If the folder doesn't provide one the extension looks for a global install version. If you haven't installed ESLint either locally or globally do so by running `npm install eslint` in the workspace folder for a local install or `npm install -g eslint` for a global install.
|
||||
|
||||
On new folders you might also need to create a `.eslintrc` configuration file. You can do this by either using the VS Code command `Create ESLint configuration` or by running the `eslint` command in a terminal. If you have installed ESLint globally (see above) then run [`eslint --init`](http://eslint.org/docs/user-guide/command-line-interface) in a terminal. If you have installed ESLint locally then run [`.\node_modules\.bin\eslint --init`](http://eslint.org/docs/user-guide/command-line-interface) under Windows and [`./node_modules/.bin/eslint --init`](http://eslint.org/docs/user-guide/command-line-interface) under Linux and Mac.
|
||||
|
||||
## Release Notes
|
||||
|
||||
This section describes major releases and their improvements. For a detailed list of changes please refer to the [change log](https://github.com/Microsoft/vscode-eslint/blob/HEAD/./CHANGELOG.md);
|
||||
|
||||
### Version 2.1.22
|
||||
|
||||
Adapt VS Code's workspace trust model. As a consequence the custom dialog ESLint introduced in version `2.1.7` got removed. In addition the `off` value got added to the eslint rule customization support.
|
||||
|
||||
### Version 2.1.20
|
||||
|
||||
Added support to customize the severity of eslint rules. See the new setting `eslint.rules.customizations`.
|
||||
|
||||
### Version 2.1.18
|
||||
|
||||
Asking for confirmation of the `eslint.nodePath` value revealed a setup where that value is defined separately on a workspace folder level although a multi workspace folder setup is open (e.g. a code-workspace file). These setups need to define the `eslint.nodePath` value in the corresponding `code-workspace` file and the extension now warns the user about it. Below an example of such a `code-workspace` file
|
||||
|
||||
```json
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "project-a"
|
||||
},
|
||||
{
|
||||
"path": "project-b"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"eslint.nodePath": "myCustomNodePath"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Version 2.1.17
|
||||
|
||||
To follow VS Code's model to confirm workspace local settings that impact code execution the two settings `eslint.runtime` and `eslint.nodePath` now need user confirmation if defined locally in a workspace folder or a workspace file. Users using these settings in those local scopes will see a notification reminding them of the confirmation need.
|
||||
|
||||
The version also adds a command to restart the ESLint server.
|
||||
|
||||
### Version 2.1.10
|
||||
|
||||
The approval flow to allow the execution of a ESLint library got reworked. Its initial experience is now as follows:
|
||||
|
||||
- no modal dialog is shown when the ESLint extension tries to load an ESLint library for the first time and an approval is necessary. Instead the ESLint status bar item changes to  indicating that the execution is currently block.
|
||||
- if the active text editor content would be validated using ESLint, a problem at the top of the file is shown in addition.
|
||||
|
||||
The execution of the ESLint library can be denied or approved using the following gestures:
|
||||
- clicking on the status bar icon
|
||||
- using the quick fix for the corresponding ESLint problem
|
||||
- executing the command `ESLint: Manage Library Execution` from the command palette
|
||||
|
||||
All gestures will open the following dialog:
|
||||
|
||||

|
||||
|
||||
The chosen action is then reflected in the ESLint status bar item in the following way:
|
||||
|
||||
- `Allow` will prefix the status bar item with a check mark.
|
||||
- `Allow Everywhere` will prefix the status bar item with a double check mark.
|
||||
- `Deny` and `Disable` will prefix the status bar item with a blocked sign.
|
||||
|
||||
You can manage our decisions using the following commands:
|
||||
|
||||
- `ESLint: Manage Library Execution` will reopen aboves dialog
|
||||
- `ESLint: Reset Library Decisions` lets you reset previous decisions who have made.
|
||||
|
||||
This release also addresses the vulnerability described in [CVE-2021-27081](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-27081).
|
||||
|
||||
### Version 2.0.4
|
||||
|
||||
The 2.0.4 version of the extension contains the following major improvements:
|
||||
|
||||
* Improved TypeScript detection - As soon as TypeScript is correctly configured inside ESLint, you no longer need additional configuration through VS Code's `eslint.validate` setting. The same is true for HTML and Vue.js files.
|
||||
* Glob working directory support - Projects that have a complex folder structure and need to customize the working directories via `eslint.workingDirectories` can now use glob patterns instead of listing every project folder. For example, `{ "pattern": "code-*" }` will match all project folders starting with `code-`. In addition, the extension now changes the working directory by default. You can disable this feature with the new `!cwd` property.
|
||||
* Formatter support: ESLint can now be used as a formatter. To enable this feature use the `eslint.format.enable` setting.
|
||||
* Improved Auto Fix on Save - Auto Fix on Save is now part of VS Code's Code Action on Save infrastructure and computes all possible fixes in one round. It is customized via the `editor.codeActionsOnSave` setting. The setting supports the ESLint specific property `source.fixAll.eslint`. The extension also respects the generic property `source.fixAll`.
|
||||
|
||||
The setting below turns on Auto Fix for all providers including ESLint:
|
||||
|
||||
```json
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": true
|
||||
}
|
||||
```
|
||||
|
||||
In contrast, this configuration only turns it on for ESLint:
|
||||
|
||||
```json
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
}
|
||||
```
|
||||
|
||||
You can also selectively disable ESLint via:
|
||||
|
||||
```json
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": true,
|
||||
"source.fixAll.eslint": false
|
||||
}
|
||||
```
|
||||
|
||||
Also note that there is a time budget of 750ms to run code actions on save which might not be enough for large JavaScript / TypeScript file. You can increase the time budget using the `editor.codeActionsOnSaveTimeout` setting.
|
||||
|
||||
The old `eslint.autoFixOnSave` setting is now deprecated and can safely be removed.
|
||||
|
||||
## Settings Options
|
||||
|
||||
If you are using an ESLint extension version < 2.x then please refer to the settings options [here](https://github.com/microsoft/vscode-eslint/blob/master/history/settings_1_9_x.md).
|
||||
|
||||
This extension contributes the following variables to the [settings](https://code.visualstudio.com/docs/customization/userandworkspace):
|
||||
|
||||
- `eslint.enable`: enable/disable ESLint. Is enabled by default. This setting got deprecated in favour of enabling / disabling the extension in the Extension's viewlet.
|
||||
- `eslint.debug`: enables ESLint's debug mode (same as --debug command line option). Please see the ESLint output channel for the debug output. This options is very helpful to track down configuration and installation problems with ESLint since it provides verbose information about how ESLint is validating a file.
|
||||
- `eslint.lintTask.enable`: whether the extension contributes a lint task to lint a whole workspace folder.
|
||||
- `eslint.lintTask.options`: Command line options applied when running the task for linting the whole workspace (https://eslint.org/docs/user-guide/command-line-interface).
|
||||
An example to point to a custom `.eslintrc.json` file and a custom `.eslintignore` is:
|
||||
```json
|
||||
{
|
||||
"eslint.lintTask.options": "-c C:/mydirectory/.eslintrc.json --ignore-path C:/mydirectory/.eslintignore ."
|
||||
}
|
||||
```
|
||||
- `eslint.packageManager`: controls the package manager to be used to resolve the ESLint library. This has only an influence if the ESLint library is resolved globally. Valid values are `"npm"` or `"yarn"` or `"pnpm"`.
|
||||
- `eslint.options`: options to configure how ESLint is started using the [ESLint CLI Engine API](http://eslint.org/docs/developer-guide/nodejs-api#cliengine). Defaults to an empty option bag.
|
||||
An example to point to a custom `.eslintrc.json` file is:
|
||||
```json
|
||||
{
|
||||
"eslint.options": { "configFile": "C:/mydirectory/.eslintrc.json" }
|
||||
}
|
||||
```
|
||||
- `eslint.run` - run the linter `onSave` or `onType`, default is `onType`.
|
||||
- `eslint.quiet` - ignore warnings.
|
||||
- `eslint.runtime` - use this setting to set the path of the node runtime to run ESLint under. [Use `"node"`](https://github.com/microsoft/vscode-eslint/issues/1233#issuecomment-815521280) if you want to use your default system version of node.
|
||||
- `eslint.nodeEnv` - use this setting if an ESLint plugin or configuration needs `process.env.NODE_ENV` to be defined.
|
||||
- `eslint.nodePath` - use this setting if an installed ESLint package can't be detected, for example `/myGlobalNodePackages/node_modules`.
|
||||
- `eslint.probe` = an array for language identifiers for which the ESLint extension should be activated and should try to validate the file. If validation fails for probed languages the extension says silent. Defaults to `["javascript", "javascriptreact", "typescript", "typescriptreact", "html", "vue", "markdown"]`.
|
||||
- `eslint.validate` - an array of language identifiers specifying the files for which validation is to be enforced. This is an old legacy setting and should in normal cases not be necessary anymore. Defaults to `["javascript", "javascriptreact"]`.
|
||||
- `eslint.format.enable`: enables ESLint as a formatter for validated files. Although you can also use the formatter on save using the setting `editor.formatOnSave` it is recommended to use the `editor.codeActionsOnSave` feature since it allows for better configurability.
|
||||
- `eslint.workingDirectories` - specifies how the working directories ESLint is using are computed. ESLint resolves configuration files (e.g. `eslintrc`, `.eslintignore`) relative to a working directory so it is important to configure this correctly. If executing ESLint in the terminal requires you to change the working directory in the terminal into a sub folder then it is usually necessary to tweak this setting. (see also [CLIEngine options#cwd](https://eslint.org/docs/developer-guide/nodejs-api#cliengine)). Please also keep in mind that the `.eslintrc*` file is resolved considering the parent directories whereas the `.eslintignore` file is only honored in the current working directory. The following values can be used:
|
||||
- `[{ "mode": "location" }]` (@since 2.0.0): instructs ESLint to uses the workspace folder location or the file location (if no workspace folder is open) as the working directory. This is the default and is the same strategy as used in older versions of the ESLint extension (1.9.x versions).
|
||||
- `[{ "mode": "auto" }]` (@since 2.0.0): instructs ESLint to infer a working directory based on the location of `package.json`, `.eslintignore` and `.eslintrc*` files. This might work in many cases but can lead to unexpected results as well.
|
||||
- `string[]`: an array of working directories to use.
|
||||
Consider the following directory layout:
|
||||
```
|
||||
root/
|
||||
client/
|
||||
.eslintrc.json
|
||||
client.js
|
||||
server/
|
||||
.eslintignore
|
||||
.eslintrc.json
|
||||
server.js
|
||||
```
|
||||
Then using the setting:
|
||||
```javascript
|
||||
"eslint.workingDirectories": [ "./client", "./server" ]
|
||||
```
|
||||
will validate files inside the server directory with the server directory as the current eslint working directory. Same for files in the client directory. The ESLint extension will also change the process's working directory to the provided directories. If this is not wanted a literal with the `!cwd` property can be used (e.g. `{ "directory": "./client", "!cwd": true }`). This will use the client directory as the ESLint working directory but will not change the process`s working directory.
|
||||
- `[{ "pattern": glob pattern }]` (@since 2.0.0): Allows to specify a pattern to detect the working directory. This is basically a short cut for listing every directory. If you have a mono repository with all your projects being below a packages folder you can use `{ "pattern": "./packages/*/" }` to make all these folders working directories.
|
||||
- `eslint.codeAction.disableRuleComment` - object with properties:
|
||||
- `enable` - show disable lint rule in the quick fix menu. `true` by default.
|
||||
- `location` - choose to either add the `eslint-disable` comment on the `separateLine` or `sameLine`. `separateLine` is the default.
|
||||
Example:
|
||||
```json
|
||||
{ "enable": true, "location": "sameLine" }
|
||||
```
|
||||
- `eslint.codeAction.showDocumentation` - object with properties:
|
||||
- `enable` - show open lint rule documentation web page in the quick fix menu. `true` by default.
|
||||
|
||||
- `eslint.codeActionsOnSave.mode` (@since 2.0.12): controls which problems are fix when running code actions on save
|
||||
- `all`: fixes all possible problems by revalidating the file's content. This executes the same code path as running eslint with the `--fix` option in the terminal and therefore can take some time. This is the default value.
|
||||
- `problems`: fixes only the currently known fixable problems as long as their textual edits are non overlapping. This mode is a lot faster but very likely only fixes parts of the problems.
|
||||
|
||||
- `eslint.rules.customizations` (@since 2.1.20): force rules to report a different severity within VS Code compared to the project's true ESLint configuration. Contains two properties:
|
||||
- `"rule`": Select on rules with names that match, factoring in asterisks as wildcards: `{ "rule": "no-*", "severity": "warn" }`
|
||||
- Prefix the name with a `"!"` to target all rules that _don't_ match the name: `{ "rule": "!no-*", "severity": "info" }`
|
||||
- `"severity"`: Sets a new severity for matched rule(s), `"downgrade"`s them to a lower severity, `"upgrade"`s them to a higher severity, or `"default"`s them to their original severity
|
||||
|
||||
In this example, all rules are overridden to warnings:
|
||||
|
||||
```json
|
||||
"eslint.rules.customizations": [
|
||||
{ "rule": "*", "severity": "warn" }
|
||||
]
|
||||
```
|
||||
|
||||
In this example, `no-` rules are informative, other rules are downgraded, and `"radix"` is reset to default:
|
||||
|
||||
```json
|
||||
"eslint.rules.customizations": [
|
||||
{ "rule": "no-*", "severity": "info" },
|
||||
{ "rule": "!no-*", "severity": "downgrade" },
|
||||
{ "rule": "radix", "severity": "default" }
|
||||
]
|
||||
```
|
||||
|
||||
- `eslint.format.enable` (@since 2.0.0): uses ESlint as a formatter for files that are validated by ESLint. If enabled please ensure to disable other formatters if you want to make this the default. A good way to do so is to add the following setting `"[javascript]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" }` for JavaScript. For TypeScript you need to add `"[typescript]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" }`.
|
||||
- `eslint.onIgnoredFiles` (@since 2.0.10): used to control whether warnings should be generated when trying to lint ignored files. Default is `off`. Can be set to `warn`.
|
||||
- `editor.codeActionsOnSave` (@since 2.0.0): this setting now supports an entry `source.fixAll.eslint`. If set to true all auto-fixable ESLint errors from all plugins will be fixed on save. You can also selectively enable and disabled specific languages using VS Code's language scoped settings. To disable `codeActionsOnSave` for HTML files use the following setting:
|
||||
|
||||
```json
|
||||
"[html]": {
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The old `eslint.autoFixOnSave` setting is now deprecated and can safely be removed. Please also note that if you use ESLint as your default formatter you should turn off `editor.formatOnSave` when you have turned on `editor.codeActionsOnSave`. Otherwise you file gets fixed twice which in unnecessary.
|
||||
|
||||
## Settings Migration
|
||||
|
||||
If the old `eslint.autoFixOnSave` option is set to true ESLint will prompt to convert it to the new `editor.codeActionsOnSave` format. If you want to avoid the migration you can respond in the dialog in the following ways:
|
||||
|
||||
- Not now: the setting will not be migrated by ESLint prompts again the next time you open the workspace
|
||||
- Never migrate Settings: the settings migration will be disabled by changing the user setting `eslint.migration.2_x` to `off`
|
||||
|
||||
The migration can always be triggered manually using the command `ESLint: Migrate Settings`
|
||||
|
||||
## Commands:
|
||||
|
||||
This extension contributes the following commands to the Command palette.
|
||||
|
||||
- `Create '.eslintrc.json' file`: creates a new `.eslintrc.json` file.
|
||||
- `Fix all auto-fixable problems`: applies ESLint auto-fix resolutions to all fixable problems.
|
||||
- `Reset Library Decisions`: Resets the ESLint library validation confirmations.
|
||||
- `Manage Library Execution`: Opens the library execution confirmation dialog.
|
||||
|
||||
## Using the extension with VS Code's task running
|
||||
|
||||
The extension is linting an individual file only on typing. If you want to lint the whole workspace set `eslint.lintTask.enable` to `true` and the extension will also contribute the `eslint: lint whole folder` task. There is no need anymore to define a custom task in `tasks.json`.
|
||||
|
||||
## Using ESLint to validate TypeScript files
|
||||
|
||||
A great introduction on how to lint TypeScript using ESlint can be found in the [TypeScript - ESLint](https://github.com/typescript-eslint/typescript-eslint). Please make yourself familiar with the introduction before using the VS Code ESLint extension in a TypeScript setup. Especially make sure that you can validate TypeScript files successfully in a terminal using the `eslint` command.
|
||||
|
||||
This project itself uses ESLint to validate its TypeScript files. So it can be used as a blueprint to get started.
|
||||
|
||||
To avoid validation from any TSLint installation disable TSLint using `"tslint.enable": false`.
|
||||
|
||||
### Mono repository setup
|
||||
|
||||
As with JavaScript validating TypeScript in a mono repository requires that you tell the VS Code ESLint extension what the current working directories are. Use the `eslint.workingDirectories` setting to do so. For this repository the working directory setup looks as follows:
|
||||
|
||||
```json
|
||||
"eslint.workingDirectories": [ "./client", "./server" ]
|
||||
```
|
||||
|
||||
## ESLint 6.x
|
||||
|
||||
Migrating from ESLint 5.x to ESLint 6.x might need some adaption (see the [ESLint Migration Guide](https://eslint.org/docs/user-guide/migrating-to-6.0.0) for details). Before filing an issue against the VS Code ESLint extension please ensure that you can successfully validate your files in a terminal using the eslint command.
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
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/).
|
||||
|
||||
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.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
|
||||
|
||||
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).
|
||||
|
||||
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).
|
||||
|
||||
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:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
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.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
|
||||
For Microsoft vscode-eslint
|
||||
|
||||
This project incorporates material from the project(s) listed below (collectively, “Third Party Code”).
|
||||
Microsoft is not the original author of the Third Party Code. The original copyright notice and license
|
||||
under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed
|
||||
to you under their original license terms set forth below. Microsoft reserves all other rights not expressly
|
||||
granted, whether by implication, estoppel or otherwise.
|
||||
|
||||
1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped)
|
||||
|
||||
This project is licensed under the MIT license.
|
||||
Copyrights are respective of each contributor listed at the beginning of each definition file.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||