Git Product home page Git Product logo

tabout's Introduction

TabOut

这是一个仿 VS Code 的 TabOut 插件的扩展,我觉得那个插件很好用,但在VS 商店却没有找到类似的扩展,遂制作此扩展供需要之人使用。

支持 TabOut 的特殊字符

每行为一组特殊字符,第一个特殊字符定义为开始,第二个定义为关闭。

new('[',']'),
new('{','}'),
new('(',')'),
new('\'','\''),
new('"','"'),
new(':',':'),
new('=','='),
new('<', '>'),
new('>', '<'),
new('.','.'),
new('`','`'),
new(';',';'),
new(',',','),

TabOut逻辑

在VS文本编辑器中按下Tab键后执行以下逻辑:

  1. 检查当前光标必须位于代码编辑器文档
  2. VS的自动补全和AI整行自动补全功能必须都是未提示状态
  3. 光标必须位于一行的行内,不能是行尾
  4. 光标必须不能位于行首的连续空格中
  5. 如果光标处为特殊字符,直接控制向后移动一个字符并结束
  6. 如果光标前是开始特殊字符,那么就向后查找直到遇到与开始特殊字符一组的关闭特殊字符,若可以遇到,就将光标放到这个特殊字符之前并结束
  7. 如果光标处是空格那么就向后查找直到遇到第一个非空格字符,若这个字符是任意的特殊字符,就将光标放到这个特殊字符之后并结束
  8. 若到此还未结束,则按照Tab键原始逻辑执行

求最优解

由于我没有在Visual Studio SDK中找到判断IntelliCode是否处于活动状态的API,目前我判断活动状态的方法是比较低效的。如果有哪位高手可以提供更好的解决方案或思路,欢迎PR或者创建Issue!

tabout's People

Contributors

zhyy2008z avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.