资源简介
这是system verilog自动补充插件
代码片段和文件信息
import sublime sublime_plugin
import re string os sys
sys.path.append(os.path.join(os.path.dirname(__file__) ‘verilogutil‘))
import verilogutil
import sublimeutil
class VerilogAlign(sublime_plugin.TextCommand):
def run(selfedit cmd=““):
if len(self.view.sel())==0 : return;
# TODO: handle multi cursor. Currently only first one ise used
# Expand the selection to a complete scope supported by the one of the align function
# Get sublime setting
self.settings = self.view.settings()
self.tab_size = int(self.settings.get(‘tab_size‘ 4))
self.char_space = ‘ ‘ * self.tab_size
self.use_space = self.settings.get(‘translate_tabs_to_spaces‘)
current_pos = self.view.viewport_position()
if not self.use_space:
self.char_space = ‘\t‘
# region = self.view.extract_scope(self.view.line(self.view.sel()[0]).a)
region = self.view.sel()[0]
region_start = region
scope = self.view.scope_name(region.a)
txt = ‘‘
if cmd == ‘reindent‘:
# Select whole text if nothing is selected
# Otherwise expand to the line
if region.empty():
region = sublime.Region(0self.view.size())
else :
region = self.view.line(self.view.sel()[0])
txt = self.reindent(self.view.substr(region))
elif ‘meta.module.inst‘ in scope:
(txtregion) = self.inst_align(region)
elif ‘meta.module.systemverilog‘ in scope:
(txtregion) = self.port_align(region)
else :
# empty region ? select all lines before and after until an empty line is found
if region.empty():
region = self.view.expand_by_class(regionsublime.CLASS_EMPTY_LINE)
# TODO: maybe have a better approach stopping at a begin end and line of comment as well
else:
region = self.view.line(self.view.sel()[0])
if self.view.classify(region.b) & sublime.CLASS_EMPTY_LINE :
region.b -= 1;
if self.view.classify(region.a) & sublime.CLASS_EMPTY_LINE :
region.a += 1;
txt = self.view.substr(region)
txt = self.reindent(self.view.substr(region))
(txtregion) = self.decl_align(txt region)
(txtregion) = self.assign_align(txt region)
if txt:
self.view.replace(editregiontxt)
sublimeutil.move_cursor(self.viewregion_start.a)
else :
sublime.status_message(‘No alignement support for this block of code.‘)
def get_indent_level(selftxt):
# make sure to not have mixed tab/space
if self.use_space:
t = txt.replace(‘\t‘self.char_space)
else:
t = txt.replace(self.char_space‘\t‘)
cnt = (len(t) - len(t.lstrip()))
if self.use_space:
cnt = int(cnt/self.tab_size)
return cnt
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 95 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\.hgignore
文件 149 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\.hg_archival.txt
文件 175 2015-02-01 21:38 Clams-sublimesystemverilog-c311bcfcbf26\begin-end.sublime-snippet
文件 178 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\beginend.sublime-macro
文件 219 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\case.sublime-snippet
文件 239 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\class.sublime-snippet
文件 1072 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\class_uvm.sublime-snippet
文件 326 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\comment_box.sublime-snippet
文件 197 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\constraint.sublime-snippet
文件 50 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\debug\deploy_local.py
文件 113 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\debug\undeploy_local.py
文件 802 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\debug\util.py
文件 0 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\debug\__init__.py
文件 1150 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\Default.sublime-commands
文件 200 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\Default.sublime-keymap
文件 173 2015-02-01 21:39 Clams-sublimesystemverilog-c311bcfcbf26\else.sublime-snippet
文件 1329 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\Find Results SV.hidden-tmLanguage
文件 233 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\for-loop.sublime-snippet
文件 215 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\function.sublime-snippet
文件 200 2015-02-01 21:38 Clams-sublimesystemverilog-c311bcfcbf26\if.sublime-snippet
文件 256 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\ifndef.sublime-snippet
文件 219 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\interface.sublime-snippet
文件 11301 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\LICENSE
文件 653 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\Main.sublime-menu
文件 259 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\messages\1.0.0.txt
文件 382 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\messages\1.0.1.txt
文件 98 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\messages\1.0.2.txt
文件 250 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\messages\1.1.0.txt
文件 295 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\messages\1.1.1.txt
文件 269 2015-01-27 06:31 Clams-sublimesystemverilog-c311bcfcbf26\messages\1.1.2.txt
............此处省略104个文件信息
- 上一篇:HMM算法第五种实现代码
- 下一篇:批量更改文件名和文件内容
相关资源
- asrock华擎app shop主板管理
- 华为解锁工具
- 西门子授权工具Sim_EKB_Install_2016_05_0
- wincc_v7.3授权工具
- UltraEdit 26.x版本 激活工具
- Jmeter工具对验证码的处理方法
- 群联PS2251量产工具
- 迅雷敏感资源限制解除小工具.zip
- U盘量产工具
- 安国(ALCOR)AU9386主控U盘量产修复工
- MT7662E_QA_Tool工具
- 很好用的网站前端页面爬取工具
- 网站模板扒皮工具
- 2019最新镜像工具,一键仿站
- 网站克隆整站复制仿站镜像拷贝工具
- SecureCRT 非常好用的串口工具
- 串口调试工具 SecureCRT
- 一个简单方便的服务端ftp搭建工具
- 串口发送小工具
- 官微刷票查票辅助(微信刷票查票辅
- synopsys 万能SCR Crack工具
- VS六种配色方案(工具-导入和导出设
- 直通车拼多多比价工具.docx
- 注册表优化工具(Systweak RegClean Pro)
- frp内网穿透工具 v0.33.0
- 高通CPU救砖工具刷入完整资料
- 易语言屏幕锁屏工具源码
- MEIZU解锁工具
- Driver Reviver 驱动管理工具 v4.0.1.60 官方
- Visual_Assist_X VS2008专用
评论
共有 条评论