├── Support ├── WAI-ARIA.attribute.completions.json ├── lib │ ├── tm │ │ ├── complete-html.rb │ │ └── complete.rb │ └── current_word.rb ├── get-completions.js ├── HTML5.completions.json └── HTML5.attribute.completions.json ├── README.md ├── Tests └── test.html ├── Snippets ├── HTML5 Minimal Template.tmSnippet └── HTML5 Template.tmSnippet ├── Preferences ├── Completions.tmPreferences └── Completions Attributes.tmPreferences ├── Commands ├── HTML5 Tag Help.tmCommand ├── Documentation for Word : Selection (tool tip).tmCommand ├── Code Completion.tmCommand ├── Tidy HTML 5.tmCommand └── Remove Unnecessary HTML Quotes.tmCommand ├── Macros ├── Code Complete Tags <>.tmMacro ├── Code Complete Attributes >.tmMacro ├── Remove Unnecessary HTML Quotes in Selection.tmMacro └── Close Tag <:>.tmMacro ├── info.plist └── Syntaxes └── HTML 5.tmLanguage /Support/WAI-ARIA.attribute.completions.json: -------------------------------------------------------------------------------- 1 | { "tool_tip_prefix":"" 2 | , "suggestions": 3 | [] 4 | } 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | HTML5 TextMate Bundle 2 | ===================== 3 | 4 | Handles the optional quotes really well and stuff. 5 | -------------------------------------------------------------------------------- /Tests/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | test.html 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Support/lib/tm/complete-html.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'pp' 4 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/tm/complete' 5 | module TextMate 6 | class Complete 7 | 8 | def data(raw_data=nil) 9 | fix_legacy 10 | 11 | raw_data ||= read_data 12 | return {} unless raw_data and not raw_data.empty? 13 | 14 | @data = parse_data raw_data 15 | 16 | @data['suggestions'].reject! {|c| c['tag'] && c['tag'] != $TAG } 17 | 18 | return @data 19 | end 20 | 21 | end 22 | end 23 | 24 | $TAG = Word.current_word(/([-:a-z]+) 2 | 3 | 4 | 5 | content 6 | <!doctype html> 7 | <meta charset=utf-8> 8 | <title>${1:`echo $TM_FILENAME|cut -d. -f1`}</title> 9 | 10 | $0 11 | 12 | name 13 | HTML5 Minimal Template 14 | scope 15 | text.html 16 | tabTrigger 17 | html5 18 | uuid 19 | BB6D45E5-4C95-4FCC-95A0-970D8B6BB1D0 20 | 21 | 22 | -------------------------------------------------------------------------------- /Support/get-completions.js: -------------------------------------------------------------------------------- 1 | MOO=document.createElement('script');MOO.src="https://ajax.googleapis.com/ajax/libs/mootools/1.3/mootools.js";document.documentElement.appendChild(MOO); 2 | Element.prototype.valueOf = Element.prototype.toString = Element.prototype.toJSON = function(){return (''+this.textContent).replace(/\s+/g,' ')}; 3 | 4 | void alert(JSON.stringify($$('.element [title|=attr]').map(function(attr) { 5 | var tag = attr.getElement('! .element !~h4 * code'); 6 | return { 7 | tag: tag, 8 | display: tag + " " + attr, 9 | match: attr, 10 | insert: '="${0:}"', 11 | tool_tip: $$('[id$=' + attr + '] !p')[0] 12 | } 13 | })).replace(/\},\{/g,'}\n , {').replace(/^\[/g,' , ').replace(/\]$/g,'')) 14 | -------------------------------------------------------------------------------- /Preferences/Completions.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Completions Tags 7 | scope 8 | text.html.5 -meta.tag 9 | settings 10 | 11 | completions 12 | 13 | shellVariables 14 | 15 | 16 | name 17 | TM_COMPLETIONS_FILES 18 | value 19 | "HTML5.completions.json" 20 | 21 | 22 | 23 | uuid 24 | 99670372-EBC0-4532-85FC-3554699C1FEB 25 | 26 | 27 | -------------------------------------------------------------------------------- /Snippets/HTML5 Template.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <!doctype html> 7 | <html> 8 | <head> 9 | <meta charset=utf-8> 10 | <title>${1:`echo $TM_FILENAME|cut -d. -f1`}</title> 11 | </head> 12 | <body> 13 | 14 | $0 15 | 16 | </body> 17 | </html> 18 | 19 | name 20 | HTML5 Template 21 | scope 22 | text.html 23 | tabTrigger 24 | html5 25 | uuid 26 | 7A824003-79E9-4DB8-A9C8-E17BCAA34AB2 27 | 28 | 29 | -------------------------------------------------------------------------------- /Preferences/Completions Attributes.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Completions Attributes 7 | scope 8 | text.html.5 meta.tag 9 | settings 10 | 11 | completions 12 | 13 | shellVariables 14 | 15 | 16 | name 17 | TM_COMPLETIONS_FILES 18 | value 19 | "HTML5.attribute.completions.json" "WAI-ARIA.attribute.completions.json" 20 | 21 | 22 | 23 | uuid 24 | BAF95CCE-0CC4-4A31-BFED-30CF7910B3EE 25 | 26 | 27 | -------------------------------------------------------------------------------- /Commands/HTML5 Tag Help.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | cat|pbcopy -pboard find 9 | 10 | . "$TM_SUPPORT_PATH/lib/html.sh" 11 | redirect "http://dev.w3.org/html5/html-author/#the-${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}-element" 12 | 13 | fallbackInput 14 | scope 15 | input 16 | selection 17 | keyEquivalent 18 | ^h 19 | name 20 | HTML5 Tag Help 21 | output 22 | showAsHTML 23 | scope 24 | text.html.5 entity.name.tag 25 | uuid 26 | 08D444C2-7060-4FDB-9FC3-8CF010BC3236 27 | 28 | 29 | -------------------------------------------------------------------------------- /Commands/Documentation for Word : Selection (tool tip).tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby 9 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/tm/complete-html' 10 | TextMate::Complete.new.tip! 11 | 12 | fallbackInput 13 | word 14 | input 15 | none 16 | keyEquivalent 17 | ~ 18 | name 19 | Documentation for Word / Selection (tool tip) 20 | output 21 | showAsTooltip 22 | scope 23 | text.html.5, text.html.5 meta.tag 24 | uuid 25 | 5ABB6365-559B-4919-8B9D-376A5BF939A9 26 | 27 | 28 | -------------------------------------------------------------------------------- /Commands/Code Completion.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby 9 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/tm/complete-html' 10 | TextMate::Complete.new.complete! 11 | 12 | input 13 | none 14 | inputFormat 15 | text 16 | isDisabled 17 | 18 | keyEquivalent 19 | ~ 20 | name 21 | Code Completion 22 | outputCaret 23 | afterOutput 24 | outputFormat 25 | text 26 | outputLocation 27 | toolTip 28 | scope 29 | text.html.5, text.html.5 meta.tag -string, text.html.5 meta.tag punctuation.definition.tag.end 30 | uuid 31 | DFBD23E4-7DBF-49EE-8EB4-5EEE4349DBD2 32 | version 33 | 2 34 | 35 | 36 | -------------------------------------------------------------------------------- /Commands/Tidy HTML 5.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | captureFormatString 8 | $3 9 | capturePattern 10 | line (\d+) column (\d+) - (.*?)$ 11 | command 12 | # OPEN /tmp/tidy_errors.txt FOR ERRORS 13 | # 14 | "${TM_TIDY:-tidy}" -f /tmp/tidy_errors.txt -ashtml -clean -indent -omit -quiet -utf8 -wrap 0 --tab-size $TM_TAB_SIZE --indent-spaces $TM_TAB_SIZE|\ 15 | 16 | if [[ "$TM_SOFT_TABS" == "YES" ]]; then cat; else ruby -pe ' 17 | 18 | unless $in_pre 19 | tab_size = ENV["TM_TAB_SIZE"].to_i 20 | space, text = /( *)(.*)/m.match($_)[1..2] 21 | $_ = "\t" * (space.length / tab_size).floor + 22 | " " * (space.length % tab_size) + text 23 | end 24 | 25 | $in_pre = true if(/<pre>/) 26 | $in_pre = false if(/<\/pre>/) 27 | ' 28 | fi 29 | 30 | input 31 | document 32 | keyEquivalent 33 | ^H 34 | lineCaptureRegister 35 | 1 36 | name 37 | Tidy HTML5 38 | output 39 | replaceDocument 40 | scope 41 | text.html 42 | uuid 43 | 4A840F89-23F1-4526-B479-88CA88518AAD 44 | 45 | 46 | -------------------------------------------------------------------------------- /Macros/Code Complete Tags <>.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | argument 9 | < 10 | command 11 | insertText: 12 | 13 | 14 | argument 15 | 16 | beforeRunningCommand 17 | nop 18 | command 19 | #!/usr/bin/env ruby 20 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/tm/complete-html' 21 | TextMate::Complete.new.complete! 22 | 23 | input 24 | none 25 | keyEquivalent 26 | ~ 27 | name 28 | Code Completion 29 | output 30 | showAsTooltip 31 | scope 32 | text.html.5, text.html.5 meta.tag 33 | uuid 34 | DFBD23E4-7DBF-49EE-8EB4-5EEE4349DBD2 35 | 36 | command 37 | executeCommandWithOptions: 38 | 39 | 40 | isDisabled 41 | 42 | keyEquivalent 43 | < 44 | name 45 | Code Complete Tags <> 46 | scope 47 | text.html.5 -meta.tag 48 | uuid 49 | AD5E3273-DB9B-4870-8B10-E1F8180F0608 50 | 51 | 52 | -------------------------------------------------------------------------------- /Macros/Code Complete Attributes >.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | argument 9 | 10 | command 11 | insertText: 12 | 13 | 14 | argument 15 | 16 | beforeRunningCommand 17 | nop 18 | command 19 | #!/usr/bin/env ruby 20 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/tm/complete-html' 21 | TextMate::Complete.new.complete! 22 | 23 | input 24 | none 25 | keyEquivalent 26 | ~ 27 | name 28 | Code Completion 29 | output 30 | showAsTooltip 31 | scope 32 | text.html.5, text.html.5 meta.tag 33 | uuid 34 | DFBD23E4-7DBF-49EE-8EB4-5EEE4349DBD2 35 | 36 | command 37 | executeCommandWithOptions: 38 | 39 | 40 | isDisabled 41 | 42 | keyEquivalent 43 | 44 | name 45 | Code Complete Attributes > 46 | scope 47 | text.html.5 punctuation.definition.tag.end 48 | uuid 49 | 7F57F49B-5540-4287-B136-C29ED19A832B 50 | 51 | 52 | -------------------------------------------------------------------------------- /Commands/Remove Unnecessary HTML Quotes.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby 9 | 10 | def remove_html_quotes(html) 11 | html. 12 | gsub(/\b="([-._:a-zA-Z0-9]+)"(?=\s|>)/,'=\1'). 13 | gsub(/\b='([-._:a-zA-Z0-9]+)'(?=\s|>)/,'=\1') 14 | end 15 | 16 | print remove_html_quotes(STDIN.read) 17 | 18 | __END__ 19 | if __FILE__ == $0 20 | require "test/unit" 21 | class TestToggleHtmlQuotes < Test::Unit::TestCase 22 | 23 | def test_remove_html_quotes 24 | after = remove_html_quotes(<<-HTML) 25 | <div key=val> 26 | <div key="val"> 27 | <div key='val'> 28 | HTML 29 | assert_equal(<<-HTML, after) 30 | <div key=val> 31 | <div key=val> 32 | <div key=val> 33 | HTML 34 | end 35 | 36 | def test_remove_html_quotes_bugs0 37 | before = <<-HTML 38 | ="val" 39 | HTML 40 | after = remove_html_quotes(before) 41 | assert_equal before, after 42 | end 43 | 44 | end 45 | end 46 | 47 | fallbackInput 48 | scope 49 | input 50 | selection 51 | name 52 | Remove Unnecessary HTML Quotes 53 | output 54 | replaceSelectedText 55 | scope 56 | text.html meta.tag 57 | uuid 58 | E4634C6C-61FA-4848-8DB1-67CDE713A0BB 59 | 60 | 61 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | boyvivbhf+grkgzngr@fhogyrtenqvrag.pbz 7 | contactName 8 | Thomas Aylott 9 | deleted 10 | 11 | AA0F28ED-C25A-4C58-BE30-3ACE0572CE9C 12 | 13 | description 14 | 15 | mainMenu 16 | 17 | items 18 | 19 | 7A824003-79E9-4DB8-A9C8-E17BCAA34AB2 20 | ------------------------------------ 21 | 4A840F89-23F1-4526-B479-88CA88518AAD 22 | ------------------------------------ 23 | E4634C6C-61FA-4848-8DB1-67CDE713A0BB 24 | C92BBBB1-AB7A-4C88-B691-48FB65DAF542 25 | 26 | submenus 27 | 28 | 29 | name 30 | HTML5 — SubtleGradient 31 | ordering 32 | 33 | 8659E9F6-30F9-4B26-AD9F-2F849B513E61 34 | 08D444C2-7060-4FDB-9FC3-8CF010BC3236 35 | 99670372-EBC0-4532-85FC-3554699C1FEB 36 | BAF95CCE-0CC4-4A31-BFED-30CF7910B3EE 37 | 5ABB6365-559B-4919-8B9D-376A5BF939A9 38 | DFBD23E4-7DBF-49EE-8EB4-5EEE4349DBD2 39 | 4A840F89-23F1-4526-B479-88CA88518AAD 40 | E4634C6C-61FA-4848-8DB1-67CDE713A0BB 41 | C92BBBB1-AB7A-4C88-B691-48FB65DAF542 42 | B28D5A30-FC02-4312-9350-7A2E98C63B0C 43 | AD5E3273-DB9B-4870-8B10-E1F8180F0608 44 | 7F57F49B-5540-4287-B136-C29ED19A832B 45 | 7A824003-79E9-4DB8-A9C8-E17BCAA34AB2 46 | 47 | uuid 48 | 630DEED4-EA5C-4592-9C06-6F9823C50718 49 | 50 | 51 | -------------------------------------------------------------------------------- /Macros/Remove Unnecessary HTML Quotes in Selection.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | argument 9 | 10 | beforeRunningCommand 11 | nop 12 | command 13 | #!/usr/bin/env ruby 14 | 15 | def remove_html_quotes(html) 16 | html. 17 | gsub(/\b="([-._:a-zA-Z0-9]+)"(?=\s|>)/,'=\1'). 18 | gsub(/\b='([-._:a-zA-Z0-9]+)'(?=\s|>)/,'=\1') 19 | end 20 | 21 | print remove_html_quotes(STDIN.read) 22 | 23 | __END__ 24 | if __FILE__ == $0 25 | require "test/unit" 26 | class TestToggleHtmlQuotes < Test::Unit::TestCase 27 | 28 | def test_remove_html_quotes 29 | after = remove_html_quotes(<<-HTML) 30 | <div key=val> 31 | <div key="val"> 32 | <div key='val'> 33 | HTML 34 | assert_equal(<<-HTML, after) 35 | <div key=val> 36 | <div key=val> 37 | <div key=val> 38 | HTML 39 | end 40 | 41 | def test_remove_html_quotes_bugs0 42 | before = <<-HTML 43 | ="val" 44 | HTML 45 | after = remove_html_quotes(before) 46 | assert_equal before, after 47 | end 48 | 49 | end 50 | end 51 | 52 | fallbackInput 53 | scope 54 | input 55 | selection 56 | name 57 | Remove HTML Quotes 58 | output 59 | replaceSelectedText 60 | scope 61 | text.html meta.tag 62 | uuid 63 | E4634C6C-61FA-4848-8DB1-67CDE713A0BB 64 | 65 | command 66 | executeCommandWithOptions: 67 | 68 | 69 | keyEquivalent 70 | ^" 71 | name 72 | Remove Unnecessary HTML Quotes in Selection 73 | scope 74 | text.html 75 | uuid 76 | C92BBBB1-AB7A-4C88-B691-48FB65DAF542 77 | 78 | 79 | -------------------------------------------------------------------------------- /Macros/Close Tag <:>.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | command 9 | deleteBackward: 10 | 11 | 12 | argument 13 | 14 | beforeRunningCommand 15 | nop 16 | command 17 | #!/usr/bin/env ruby 18 | 19 | doc = STDIN.read 20 | line = ENV['TM_LINE_NUMBER'].to_i 21 | line_index = ENV['TM_LINE_INDEX'].to_i 22 | 23 | if ENV.has_key? 'TM_INPUT_START_LINE' then 24 | line = ENV['TM_INPUT_START_LINE'].to_i 25 | line_index = ENV['TM_INPUT_START_LINE_INDEX'].to_i 26 | end 27 | 28 | before = /(.*\n){#{line-1}}.{#{line_index}}/.match(doc)[0] 29 | 30 | before.gsub!(/<[^>]+\/\s*>/i, '') 31 | 32 | # remove all self-closing tags 33 | if ENV.has_key?('TM_HTML_EMPTY_TAGS') then 34 | empty_tags = ENV['TM_HTML_EMPTY_TAGS'] 35 | before.gsub!(/<(#{empty_tags})\b[^>]*>/i, '') 36 | end 37 | 38 | # remove all comments 39 | before.gsub!(/<!--.*?-->/m, '') 40 | 41 | stack = [ ] 42 | before.scan(/<\s*(\/)?\s*(\w[\w:-]*)[^>]*>/) do |m| 43 | if m[0].nil? then 44 | stack << m[1] 45 | else 46 | until stack.empty? do 47 | close_tag = stack.pop 48 | break if close_tag == m[1] 49 | end 50 | end 51 | end 52 | 53 | if stack.empty? then 54 | %x{ osascript -e beep &>/dev/null & } 55 | else 56 | print "</#{stack.pop}>" 57 | end 58 | input 59 | document 60 | keyEquivalent 61 | ~@. 62 | name 63 | Insert Close Tag 64 | output 65 | afterSelectedText 66 | uuid 67 | 0658019F-3635-462E-AAC2-74E4FE508A9B 68 | 69 | command 70 | executeCommandWithOptions: 71 | 72 | 73 | isDisabled 74 | 75 | keyEquivalent 76 | / 77 | name 78 | Close Tag </> 79 | scope 80 | text.html.5 invalid.illegal.incomplete.html 81 | uuid 82 | B28D5A30-FC02-4312-9350-7A2E98C63B0C 83 | 84 | 85 | -------------------------------------------------------------------------------- /Support/lib/current_word.rb: -------------------------------------------------------------------------------- 1 | # When creating a custom regex for Word.current_word, you need to keep a few things in mind: 2 | # The regex matches from your caret, so your caret position will always be the beginning of the line 3 | # Everything before your caret is reversed for the match, so the left of your caret will also match your caret position as ^ 4 | # You must use a capture group () for the text you're trying to match 5 | # You must use a capture group () for the text before/after your match 6 | # 7 | # EG: /(^[a-z]*)(.*$)/ 8 | # The first capture group in that regex will match from your caret out until it can't find anymore lowercase letters. 9 | # Then it'll match everything else in the line as the before/after match part. 10 | # You can currently only use a single regex to match before and after your caret. 11 | # 12 | # Since your regex matches what's before your caret in reverse, you'll have to reverse specific stuff in your regex, eg: 13 | # /(.*):/ wouldn't match 'color' in ` color: `, but /:(.*)/ would. 14 | # It's reversed you see 15 | # 16 | module Word 17 | def self.current_word(pat='a-zA-Z0-9', direction=:both) 18 | word = ENV['TM_SELECTED_TEXT'] 19 | 20 | if word.nil? or word.empty? 21 | line, col = ENV['TM_CURRENT_LINE'], ENV['TM_LINE_INDEX'].to_i 22 | 23 | if pat.kind_of? Regexp 24 | @reg = pat 25 | else 26 | @reg = /(^[#{pat}]*)(.*$\r?\n?)/ 27 | end 28 | 29 | left, before_match = *( line[0...col].reverse.match(@reg) ||[])[1..2] 30 | right, after_match = *( line[col..-1] .match(@reg) ||[])[1..2] 31 | 32 | (before_match||='').reverse! 33 | (left||='').reverse! 34 | 35 | # p before_match, left, right, after_match 36 | 37 | case direction 38 | when :both then word = [left, right].join('') 39 | when :left then word = left 40 | when :right then word = right 41 | when :hash then word = { 42 | :line => [before_match, left, right, after_match].join(''), 43 | :before_match => before_match, 44 | :left => left, 45 | :right => right, 46 | :after_match => after_match, 47 | } 48 | end 49 | end 50 | 51 | word 52 | end 53 | end 54 | 55 | if __FILE__ == $0 56 | require "test/unit" 57 | class TestWord < Test::Unit::TestCase 58 | # =begin 59 | def test_with_spaces 60 | ENV['TM_SELECTED_TEXT']= nil 61 | ENV['TM_CURRENT_LINE'] = <<-EOF 62 | BeforeAfter 63 | EOF 64 | ENV['TM_LINE_INDEX'] = '10' 65 | ENV['TM_TAB_SIZE'] = '2' 66 | assert_equal 'BeforeAfter', Word.current_word 67 | assert_equal 'Before', Word.current_word('a-zA-Z0-9',:left) 68 | assert_equal 'After', Word.current_word('a-zA-Z0-9',:right) 69 | 70 | assert_equal ' Before', Word.current_word(" a-zA-Z",:left) 71 | assert_equal 'After ', Word.current_word(" a-zA-Z",:right) 72 | end 73 | 74 | def test_with_tabs 75 | ENV['TM_SELECTED_TEXT']= nil 76 | ENV['TM_CURRENT_LINE'] = <<-EOF 77 | BeforeAfter 78 | EOF 79 | ENV['TM_LINE_INDEX'] = '8' 80 | ENV['TM_TAB_SIZE'] = '2' 81 | assert_equal 'BeforeAfter', Word.current_word 82 | assert_equal 'Before', Word.current_word('a-zA-Z0-9',:left) 83 | assert_equal 'After', Word.current_word('a-zA-Z0-9',:right) 84 | 85 | assert_equal "\t\tBefore", Word.current_word("\ta-zA-Z",:left) 86 | assert_equal "After\t\t", Word.current_word("\ta-zA-Z",:right) 87 | end 88 | 89 | def test_with_dash 90 | ENV['TM_SELECTED_TEXT']= nil 91 | ENV['TM_CURRENT_LINE'] = <<-EOF 92 | Before--After 93 | EOF 94 | ENV['TM_LINE_INDEX'] = '11' 95 | ENV['TM_TAB_SIZE'] = '2' 96 | assert_equal 'Before--After', Word.current_word('-a-zA-Z0-9') 97 | assert_equal 'Before-', Word.current_word('-a-zA-Z0-9',:left) 98 | assert_equal '-After', Word.current_word('-a-zA-Z0-9',:right) 99 | 100 | assert_equal 'Before-', Word.current_word("\ta-zA-Z\-",:left) 101 | end 102 | 103 | def test_hash_result 104 | ENV['TM_SELECTED_TEXT']= nil 105 | ENV['TM_CURRENT_LINE'] = <<-EOF 106 | before_match BeforeAfter after_match 107 | EOF 108 | ENV['TM_LINE_INDEX'] = '22' 109 | ENV['TM_TAB_SIZE'] = '2' 110 | 111 | word = Word.current_word("a-zA-Z",:hash) 112 | 113 | assert_equal ENV['TM_CURRENT_LINE'], "#{word[:line]}" 114 | assert_equal 'Before', word[:left] 115 | assert_equal 'After', word[:right] 116 | end 117 | =begin 118 | =end 119 | def test_both_result 120 | ENV['TM_SELECTED_TEXT']= nil 121 | ENV['TM_CURRENT_LINE'] = <<-EOF 122 | before_match BeforeAfter after_match 123 | EOF 124 | ENV['TM_LINE_INDEX'] = '22' 125 | ENV['TM_TAB_SIZE'] = '2' 126 | 127 | assert_equal 'BeforeAfter', Word.current_word("a-zA-Z",:both) 128 | end 129 | 130 | def test_should_support_custom_regex 131 | ENV['TM_SELECTED_TEXT']= nil 132 | ENV['TM_CURRENT_LINE'] = <<-EOF 133 | before_match BeforeAfter after_match 134 | EOF 135 | ENV['TM_LINE_INDEX'] = '22' 136 | ENV['TM_TAB_SIZE'] = '2' 137 | 138 | assert_equal '', Word.current_word(/[a-zA-Z]/,:both) # No match since no capture group was used! 139 | 140 | assert_equal 'ef', Word.current_word(/([a-z])/,:both) # Capture group, but only selecting a single caracter before and after the caret 141 | assert_equal 'eforefter', Word.current_word(/([a-z]+)/,:both) # Only lowercase characters 142 | assert_equal 'BeforeAfter', Word.current_word(/^([a-z]*)/i,:both) # Ignore case 143 | assert_equal 'BeforeAfter', Word.current_word(/^([a-zA-Z]*)/,:both) # Explicit case 144 | end 145 | 146 | def test_should_support_custom_regex_example1 147 | ENV['TM_SELECTED_TEXT']= nil 148 | ENV['TM_CURRENT_LINE'] = <<-EOF 149 | background-color: ; 150 | EOF 151 | ENV['TM_LINE_INDEX'] = '20' 152 | ENV['TM_TAB_SIZE'] = '2' 153 | 154 | assert_equal ' background-color: ', Word.current_word(/^(.*)/,:left) 155 | assert_equal 'background-color', Word.current_word(/:([-a-z]+)/,:left) 156 | end 157 | 158 | def test_should_support_custom_regex_example2 159 | ENV['TM_SELECTED_TEXT']= nil 160 | ENV['TM_CURRENT_LINE'] = <<-EOF 161 |

Lorem ipsum dolor sit amet

162 | EOF 163 | ENV['TM_LINE_INDEX'] = '44' 164 | ENV['TM_TAB_SIZE'] = '2' 165 | 166 | assert_equal %Q{\t

Lorem ipsum}, Word.current_word(/^(.*)/,:left) 167 | assert_equal 'Lorem ipsum dolor sit amet', Word.current_word(/^([^<>]+)/i,:both) 168 | 169 | # You have to reverse the regex since it's matching against the reverse of the text before the caret 170 | assert_equal 'p', Word.current_word(/([-:a-z]+) "/Applications/TextMate.app/Contents/Resources/Bundle Item Icons/Commands.png", 15 | "D" => "/Applications/TextMate.app/Contents/Resources/Bundle Item Icons/Drag Commands.png", 16 | "L" => "/Applications/TextMate.app/Contents/Resources/Bundle Item Icons/Languages.png", 17 | "M" => "/Applications/TextMate.app/Contents/Resources/Bundle Item Icons/Macros.png", 18 | "P" => "/Applications/TextMate.app/Contents/Resources/Bundle Item Icons/Preferences.png", 19 | "S" => "/Applications/TextMate.app/Contents/Resources/Bundle Item Icons/Snippets.png", 20 | "T" => "/Applications/TextMate.app/Contents/Resources/Bundle Item Icons/Templates.png", 21 | "Doc" => "/Applications/TextMate.app/Contents/Resources/Bundle Item Icons/Template Files.png", 22 | } 23 | 24 | def initialize 25 | end 26 | 27 | # 0-config completion command using environment variables for everything 28 | def complete! 29 | return choices unless choices 30 | TextMate::UI.complete(choices, {:images => images, :extra_chars => extra_chars}) 31 | end 32 | 33 | def tip! 34 | # If there is no current_word, then check the next current_word 35 | # If there really is no current_word, then show a menu of choices 36 | 37 | chars = "a-zA-Z0-9" # Hard-coded into D2 38 | chars += Regexp.escape(extra_chars) if extra_chars 39 | current_word ||= Word.current_word chars, :both 40 | 41 | result = nil 42 | menu_choices = nil 43 | choices = nil 44 | choice = 0 45 | 46 | [current_word, current_method_name, current_collection_name].each do |initial_filter| 47 | next unless initial_filter and not initial_filter.empty? 48 | # p initial_filter 49 | 50 | choices = self.choices.select { |c| (c['match'] || c['display']) =~ /^#{Regexp.quote(initial_filter)}/ } 51 | 52 | # p choices 53 | break if choices and not choices.empty? 54 | end 55 | choices ||= self.choices 56 | 57 | menu_choices = choices.map { |c| c['display'] } 58 | choice = TextMate::UI.menu(menu_choices) if menu_choices and menu_choices.length > 1 59 | if choice 60 | result = choices[choice] 61 | end 62 | result = {'tool_tip' => 'No information'} unless result 63 | 64 | TextMate::UI.tool_tip( result['tool_tip'], {:format => result['tool_tip_format'] || :text }) 65 | end 66 | 67 | def choices 68 | @choices ||= data['suggestions'] 69 | end 70 | def choices= choice_array 71 | @choices = array_to_suggestions(choice_array) 72 | end 73 | 74 | def images 75 | @images = data['images'] || IMAGES 76 | 77 | data['images']||{}.each_pair do |name,path| 78 | @images[name] = path 79 | next if File.exists? @images[name] 80 | @images[name] = ENV['TM_BUNDLE_SUPPORT'] + "/#{IMAGES_FOLDER_NAME}/" + path 81 | next if File.exists? @images[name] 82 | @images[name] = ENV['TM_SUPPORT_PATH'] + "/#{IMAGES_FOLDER_NAME}/" + path 83 | next if File.exists? @images[name] 84 | end 85 | 86 | @images 87 | end 88 | 89 | def tool_tip_prefix 90 | @tool_tip_prefix ||= data['tool_tip_prefix'] 91 | end 92 | 93 | def extra_chars 94 | ENV['TM_COMPLETIONS_EXTRACHARS'] || data['extra_chars'] 95 | end 96 | 97 | def chars 98 | "a-zA-Z0-9" 99 | end 100 | 101 | private 102 | def data(raw_data=nil) 103 | fix_legacy 104 | 105 | raw_data ||= read_data 106 | return {} unless raw_data and not raw_data.empty? 107 | 108 | @data = parse_data raw_data 109 | return @data 110 | end 111 | 112 | def read_data 113 | raw_data = read_file 114 | raw_data ||= read_string 115 | raw_data 116 | end 117 | 118 | def read_file 119 | paths = [ENV['TM_COMPLETIONS_FILE']] if ENV['TM_COMPLETIONS_FILE'] 120 | paths ||= Shellwords.shellwords( ENV['TM_COMPLETIONS_FILES'] ) if ENV.has_key?('TM_COMPLETIONS_FILES') 121 | return nil unless paths 122 | 123 | paths.map do |path| 124 | next unless path and not path.empty? 125 | path = ENV['TM_BUNDLE_SUPPORT'] + '/' + path unless File.exists? path 126 | next unless File.exists? path 127 | 128 | { :data => File.read(path), 129 | :format => path.scan(/\.([^\.]+)$/).last.last 130 | } 131 | end 132 | end 133 | 134 | def read_string 135 | [{:data => ENV['TM_COMPLETIONS'], 136 | :format => ENV['TM_COMPLETIONS_SPLIT'] 137 | }] 138 | end 139 | 140 | attr_accessor :filepath 141 | 142 | def parse_data(raw_datas) 143 | return @parsed if @parsed 144 | parsed = {"suggestions"=>[]} 145 | 146 | raw_datas.each do |raw_data| 147 | suggestions = parsed['suggestions'] 148 | 149 | case raw_data[:format] 150 | when 'plist' 151 | par = parse_plist(raw_data) 152 | when 'json' 153 | par = parse_json(raw_data) 154 | when "txt" 155 | raw_data[:format] = "\n" 156 | par = parse_string(raw_data) 157 | when nil 158 | raw_data[:format] = "," 159 | par = parse_string(raw_data) 160 | else 161 | par = parse_string(raw_data) 162 | end 163 | 164 | if par['tool_tip_prefix'] 165 | par['suggestions'] = par['suggestions'].map do |suggestion| 166 | suggestion['tool_tip'] = (par['tool_tip_prefix']||'') + (suggestion['tool_tip']||'') 167 | suggestion 168 | end 169 | end 170 | 171 | parsed.merge! par 172 | parsed['suggestions'] = suggestions + parsed['suggestions'] 173 | end 174 | 175 | @parsed = parsed 176 | end 177 | def parse_string(raw_data) 178 | return {} unless raw_data and raw_data[:data] 179 | return raw_data[:data] unless raw_data[:data].respond_to? :to_str 180 | raw_data[:data] = raw_data[:data].to_str 181 | 182 | data = {} 183 | data['suggestions'] = array_to_suggestions(raw_data[:data].split(raw_data[:format])) 184 | data 185 | end 186 | def parse_plist(raw_data) 187 | OSX::PropertyList.load(raw_data[:data]) 188 | end 189 | def parse_json(raw_data) 190 | JSON.parse(raw_data[:data]) 191 | end 192 | 193 | def array_to_suggestions(suggestions) 194 | suggestions.delete('') 195 | 196 | suggestions.map! do |c| 197 | {'display' => c} 198 | end 199 | 200 | suggestions 201 | end 202 | def current_method_name 203 | # Regex for finding a method or function name that's close to your caret position using Word.current_word 204 | # TODO: Allow completion prefs to define their own Complete.tip! method_name 205 | 206 | characters = "a-zA-Z0-9" # Hard-coded into D2 207 | characters += Regexp.escape(extra_chars) if extra_chars 208 | 209 | regex = %r/ 210 | (?> [^\(\)]+ | \) (?> [^\(\)]+ | \) (?> [^\(\)]+ | \) (?> [^\(\)]+ | \) (?> [^\(\)]+ | \) (?> [^\(\)]* ) \( | )+ \( | )+ \( | )+ \( | )+ \( | )+ 211 | (?: \(([#{characters}]+) )?/ix 212 | 213 | Word.current_word(regex,:left) 214 | end 215 | def current_collection_name 216 | characters = "a-zA-Z0-9" # Hard-coded into D2 217 | characters += Regexp.escape(extra_chars) if extra_chars 218 | 219 | regex = %r/ 220 | (?> [^\[\]]+ | \] (?> [^\[\]]+ | \] (?> [^\[\]]+ | \] (?> [^\[\]]+ | \] (?> [^\[\]]+ | \] (?> [^\[\]]* ) \[ | )+ \[ | )+ \[ | )+ \[ | )+ \[ | )+ 221 | (?: \[([#{characters}]+) )?/ix 222 | 223 | Word.current_word(regex,:left) 224 | end 225 | 226 | def fix_legacy 227 | ENV['TM_COMPLETIONS_SPLIT'] ||= ENV['TM_COMPLETIONS_split'] 228 | end 229 | end 230 | end 231 | 232 | if __FILE__ == $0 233 | 234 | `open "txmt://open?url=file://$TM_FILEPATH"` #For testing purposes, make this document the topmost so that the complete popup works 235 | ENV['WEB_PREVIEW_RUBY']='NO-RUN' 236 | require "test/unit" 237 | # require "complete" 238 | 239 | class TestComplete < Test::Unit::TestCase 240 | def setup 241 | @string_raw = 'ad(),adipisicing,aliqua,aliquip,amet,anim,aute,cillum,commodo,consectetur,consequat,culpa,cupidatat,deserunt,do,dolor,dolore,Duis,ea,eiusmod,elit,enim,esse,est,et,eu,ex,Excepteur,exercitation,fugiat,id,in,incididunt,ipsum,irure,labore,laboris,laborum,Lorem,magna,minim,mollit,nisi,non,nostrud,nulla,occaecat,officia,pariatur,proident,qui,quis,reprehenderit,sed,sint,sit,sunt,tempor,ullamco,Ut,ut,velit,veniam,voluptate,' 242 | 243 | @plist_raw = <<-'PLIST' 244 | { suggestions = ( 245 | { display = moo; image = Drag; insert = "(${1:one}, ${2:one}, ${3:three}${4:, ${5:five}, ${6:six}})"; tool_tip = "moo(one, two, four[, five])\n This method does something or other maybe.\n Insert longer description of it here."; }, 246 | { display = foo; image = Macro; insert = "(${1:one}, \"${2:one}\", ${3:three}${4:, ${5:five}, ${6:six}})"; tool_tip = "foo(one, two)\n This method does something or other maybe.\n Insert longer description of it here."; }, 247 | { display = bar; image = Command; insert = "(${1:one}, ${2:one}, \"${3:three}\"${4:, \"${5:five}\", ${6:six}})"; tool_tip = "bar(one, two[, three])\n This method does something or other maybe.\n Insert longer description of it here."; } 248 | ); 249 | extra_chars = '.'; 250 | images = { 251 | Command = "Commands.png"; 252 | Drag = "Drag Commands.png"; 253 | Language = "Languages.png"; 254 | Macro = "Macros.png"; 255 | Preference = "Preferences.png"; 256 | Snippet = "Snippets.png"; 257 | Template = "Template Files.png"; 258 | Templates = "Templates.png"; 259 | }; 260 | } 261 | PLIST 262 | 263 | @json_raw = <<-'JSON' 264 | { 265 | "extra_chars": "-_$.", 266 | "suggestions": [ 267 | { "display": ".moo", "image": "", "insert": "(${1:one}, ${2:one}, ${3:three}${4:, ${5:five}, ${6:six}})", "tool_tip": "moo(one, two, four[, five])\n This method does something or other maybe.\n Insert longer description of it here." }, 268 | { "display": "foo", "image": "", "insert": "(${1:one}, \"${2:one}\", ${3:three}${4:, ${5:five}, ${6:six}})", "tool_tip": "foo(one, two)\n This method does something or other maybe.\n Insert longer description of it here." }, 269 | { "display": "bar", "image": "", "insert": "(${1:one}, ${2:one}, \"${3:three}\"${4:, \"${5:five}\", ${6:six}})", "tool_tip": "bar(one, two[, three])\n This method does something or other maybe.\n Insert longer description of it here." } 270 | ], 271 | "images": { 272 | "String" : "String.png", 273 | "RegExp" : "RegExp.png", 274 | "Number" : "Number.png", 275 | "Array" : "Array.png", 276 | "Function": "Function.png", 277 | "Object" : "Object.png", 278 | "Node" : "Node.png", 279 | "NodeList": "NodeList.png" 280 | } 281 | } 282 | JSON 283 | end 284 | 285 | def test_basic_complete 286 | ENV['TM_COMPLETIONS'] = @string_raw 287 | 288 | assert_equal ENV['TM_COMPLETIONS'].split(','), TextMate::Complete.new.choices.map{|c| c['display']} 289 | assert_equal TextMate::Complete::IMAGES, TextMate::Complete.new.images 290 | 291 | TextMate::Complete.new.complete! 292 | end 293 | # 294 | def test_should_support_plist 295 | ENV['TM_COMPLETIONS_SPLIT']='plist' 296 | ENV['TM_COMPLETIONS'] = @plist_raw 297 | TextMate::Complete.new.complete! 298 | end 299 | # 300 | def test_should_support_json 301 | ENV.delete 'TM_COMPLETIONS' 302 | assert_nil(ENV['TM_COMPLETIONS']) 303 | ENV.delete 'TM_COMPLETIONS_SPLIT' 304 | assert_nil(ENV['TM_COMPLETIONS_SPLIT']) 305 | 306 | ENV['TM_COMPLETIONS_SPLIT']='json' 307 | ENV['TM_COMPLETIONS'] = @json_raw 308 | fred = TextMate::Complete.new 309 | assert_equal(3, fred.choices.length) 310 | end 311 | # 312 | def test_should_be_able_to_modify_the_choices 313 | ENV['TM_COMPLETIONS'] = @string_raw 314 | 315 | fred = TextMate::Complete.new 316 | 317 | assert_not_nil fred.choices 318 | assert_equal ENV['TM_COMPLETIONS'].split(','), fred.choices.map{|c| c['display']} 319 | fred.choices.reject!{|choice| choice['display'] !~ /^a/ } 320 | assert_equal ENV['TM_COMPLETIONS'].split(',').grep(/^a/), fred.choices.map{|c| c['display']} 321 | 322 | fred.choices=%w[fred is not my name] 323 | assert_equal %w[fred is not my name], fred.choices.map{|c| c['display']} 324 | end 325 | # 326 | def test_should_parse_files_based_on_extension_plist 327 | ENV['TM_COMPLETIONS_FILE'] = '/tmp/completions_test.plist' 328 | 329 | File.open(ENV['TM_COMPLETIONS_FILE'],'w'){|file| file.write @plist_raw } 330 | assert File.exists?(ENV['TM_COMPLETIONS_FILE']) 331 | 332 | fred = TextMate::Complete.new 333 | assert_equal(['moo', 'foo', 'bar'], fred.choices.map{|c| c['display']}) 334 | end 335 | # 336 | def test_should_parse_files_based_on_extension_txt 337 | ENV.delete 'TM_COMPLETIONS' 338 | assert_nil(ENV['TM_COMPLETIONS']) 339 | ENV.delete 'TM_COMPLETIONS_SPLIT' 340 | assert_nil(ENV['TM_COMPLETIONS_SPLIT']) 341 | 342 | ENV['TM_COMPLETIONS_FILE'] = '/tmp/completions_test.txt' 343 | 344 | File.open(ENV['TM_COMPLETIONS_FILE'],'w'){|file| file.write @string_raw.gsub(',',"\n") } 345 | assert File.exists?(ENV['TM_COMPLETIONS_FILE']) 346 | 347 | fred = TextMate::Complete.new 348 | 349 | assert_equal(@string_raw.split(','), fred.choices.map{|c| c['display']}) 350 | end 351 | # 352 | def test_should_parse_multiple_files 353 | ENV.delete 'TM_COMPLETIONS' 354 | assert_nil(ENV['TM_COMPLETIONS']) 355 | ENV.delete 'TM_COMPLETIONS_SPLIT' 356 | assert_nil(ENV['TM_COMPLETIONS_SPLIT']) 357 | ENV.delete 'TM_COMPLETIONS_FILE' 358 | assert_nil(ENV['TM_COMPLETIONS_FILE']) 359 | 360 | ENV['TM_COMPLETIONS_FILES'] = "'/tmp/completions_test.txt' '/tmp/completions_test1.txt' '/tmp/completions_test2.txt'" 361 | 362 | require 'shellwords' 363 | Shellwords.shellwords( ENV['TM_COMPLETIONS_FILES'] ).each_with_index do |filepath,i| 364 | File.open(filepath,'w'){|file| file.write @string_raw.gsub(',',"#{i}\n") } 365 | assert File.exists?(filepath) 366 | end 367 | 368 | fred = TextMate::Complete.new 369 | 370 | assert_equal(@string_raw.split(',').uniq.length * 3, fred.choices.map{|c| c['display']}.length ) 371 | end 372 | # 373 | def test_should_override_split_with_extension 374 | ENV['TM_COMPLETIONS_SPLIT'] = ',' 375 | ENV['TM_COMPLETIONS_FILE'] = '/tmp/completions_test.plist' 376 | 377 | File.open(ENV['TM_COMPLETIONS_FILE'],'w'){|file| file.write @plist_raw } 378 | assert File.exists?(ENV['TM_COMPLETIONS_FILE']) 379 | 380 | fred = TextMate::Complete.new 381 | assert_equal(['moo', 'foo', 'bar'], fred.choices.map{|c| c['display']}) 382 | end 383 | # 384 | def test_should_get_extra_chars_from_var 385 | ENV['TM_COMPLETIONS_SPLIT']=',' 386 | ENV['TM_COMPLETIONS'] = @string_raw 387 | ENV['TM_COMPLETIONS_EXTRACHARS'] = '.' 388 | 389 | fred = TextMate::Complete.new 390 | assert_equal('.', fred.extra_chars) 391 | end 392 | # 393 | def test_should_get_extra_chars_from_plist 394 | ENV['TM_COMPLETIONS_SPLIT']='plist' 395 | ENV['TM_COMPLETIONS'] = @plist_raw 396 | 397 | assert_nil(ENV['TM_COMPLETIONS_EXTRACHARS']) 398 | 399 | fred = TextMate::Complete.new 400 | assert_equal('.', fred.extra_chars) 401 | end 402 | # TODO: should_fix_image_paths 403 | =begin 404 | def test_should_fix_image_paths 405 | ENV['TM_COMPLETIONS_SPLIT'] = 'plist' 406 | ENV['TM_COMPLETIONS'] = @plist_raw 407 | ENV['TM_BUNDLE_SUPPORT'] = '/tmp' 408 | ENV['TM_SUPPORT_PATH'] = '/tmp' 409 | 410 | images = OSX::PropertyList.load(@plist_raw)['images'] 411 | 412 | FileUtils.mkdir_p "#{ENV['TM_SUPPORT_PATH']}/#{TextMate::Complete::IMAGES_FOLDER_NAME}" 413 | images.each_pair do |name,path| 414 | File.open("#{ENV['TM_SUPPORT_PATH']}/#{TextMate::Complete::IMAGES_FOLDER_NAME}/#{path}", 'w'){ |file| file.write('') } 415 | end 416 | 417 | TextMate::Complete.new.images.each_pair do |name,path| 418 | assert File.exists?(path) 419 | end 420 | 421 | end 422 | =end 423 | def test_should_apply_prefix 424 | ENV.delete 'TM_COMPLETIONS' 425 | assert_nil(ENV['TM_COMPLETIONS']) 426 | ENV.delete 'TM_COMPLETIONS_SPLIT' 427 | assert_nil(ENV['TM_COMPLETIONS_SPLIT']) 428 | 429 | @json_raw = <<-'JSON' 430 | { 431 | "extra_chars": "-_$.", 432 | "tool_tip_prefix":"prefix", 433 | "suggestions": [ 434 | { "display": ".moo", "image": "", "insert": "(${1:one}, ${2:one}, ${3:three}${4:, ${5:five}, ${6:six}})", "tool_tip": "moo(one, two, four[, five])\n This method does something or other maybe.\n Insert longer description of it here." }, 435 | { "display": "foo", "image": "", "insert": "(${1:one}, \"${2:one}\", ${3:three}${4:, ${5:five}, ${6:six}})", "tool_tip": "foo(one, two)\n This method does something or other maybe.\n Insert longer description of it here." }, 436 | { "display": "bar", "image": "", "insert": "(${1:one}, ${2:one}, \"${3:three}\"${4:, \"${5:five}\", ${6:six}})", "tool_tip": "bar(one, two[, three])\n This method does something or other maybe.\n Insert longer description of it here." } 437 | ], 438 | "images": { 439 | "String" : "String.png", 440 | "RegExp" : "RegExp.png", 441 | "Number" : "Number.png", 442 | "Array" : "Array.png", 443 | "Function": "Function.png", 444 | "Object" : "Object.png", 445 | "Node" : "Node.png", 446 | "NodeList": "NodeList.png" 447 | } 448 | } 449 | JSON 450 | 451 | ENV['TM_COMPLETIONS_SPLIT']='json' 452 | ENV['TM_COMPLETIONS'] = @json_raw 453 | fred = TextMate::Complete.new 454 | assert_equal(3, fred.choices.length) 455 | assert fred.choices.first['tool_tip'].match(/^prefix/) 456 | end 457 | # 458 | def test_should_show_tooltip_without_inserting_anything 459 | # This method passes if it shows a tooltip when selecting a menu-item 460 | # and DOESN'T insert anything or cause the document think anything has changed 461 | ENV.delete 'TM_COMPLETIONS' 462 | assert_nil(ENV['TM_COMPLETIONS']) 463 | ENV.delete 'TM_COMPLETIONS_SPLIT' 464 | assert_nil(ENV['TM_COMPLETIONS_SPLIT']) 465 | 466 | ENV['TM_COMPLETIONS_SPLIT']='json' 467 | ENV['TM_COMPLETIONS'] = @json_raw 468 | fred = TextMate::Complete.new 469 | assert_equal(3, fred.choices.length) 470 | 471 | TextMate::Complete.new.tip! 472 | end 473 | # 474 | def test_tip_should_look_for_the_current_word_and_then_try_the_closest_function_name 475 | ENV.delete 'TM_COMPLETIONS' 476 | assert_nil(ENV['TM_COMPLETIONS']) 477 | ENV.delete 'TM_COMPLETIONS_SPLIT' 478 | assert_nil(ENV['TM_COMPLETIONS_SPLIT']) 479 | 480 | ENV['TM_COMPLETIONS_SPLIT']='json' 481 | ENV['TM_COMPLETIONS'] = @json_raw 482 | fred = TextMate::Complete.new 483 | assert_equal(3, fred.choices.length) 484 | 485 | TextMate::Complete.new.tip! 486 | # 487 | # This test passes if, when run, you see the tooltip for closest function 488 | # Be sure to more your caret around and try a few times 489 | # Showing a menu is a fail 490 | # 491 | # foo( bar( ), '.moo' ) 492 | # ^ Caret here should give the tip for 'foo' 493 | # ^ Caret here should give the tip for 'bar' 494 | # ^ Caret here should give the tip for 'bar' 495 | # ^ Caret here should give the tip for '.moo' 496 | # foo( bar(one,two,foo), '.moo' ) 497 | # foo['bar'] 498 | end 499 | # 500 | end 501 | 502 | end#if 503 | -------------------------------------------------------------------------------- /Syntaxes/HTML 5.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | html 8 | htm 9 | shtml 10 | xhtml 11 | phtml 12 | php 13 | inc 14 | tmpl 15 | tpl 16 | 17 | firstLineMatch 18 | <!DOCTYPE\s+(?i:html)\s*> 19 | foldingStartMarker 20 | (?x) 21 | (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl|td)\b.*?> 22 | |<!--(?!.*--\s*>) 23 | |^<!--\ \#tminclude\ (?>.*?-->)$ 24 | |<\?(?:php)?.*\b(if|for(each)?|while)\b.+: 25 | |\{\{?(if|foreach|capture|literal|foreach|php|section|strip) 26 | |\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/))) 27 | ) 28 | foldingStopMarker 29 | (?x) 30 | (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl|td)> 31 | |^(?!.*?<!--).*?--\s*> 32 | |^<!--\ end\ tminclude\ -->$ 33 | |<\?(?:php)?.*\bend(if|for(each)?|while)\b 34 | |\{\{?/(if|foreach|capture|literal|foreach|php|section|strip) 35 | |^[^{]*\} 36 | ) 37 | keyEquivalent 38 | ^~H 39 | name 40 | HTML5 41 | patterns 42 | 43 | 44 | captures 45 | 46 | 1 47 | 48 | name 49 | entity.name.tag.html 50 | 51 | 52 | match 53 | <(script)[^>]*>\s*</script> 54 | name 55 | meta.tag.block.script.src.html 56 | 57 | 58 | begin 59 | (<\?)(xml) 60 | captures 61 | 62 | 1 63 | 64 | name 65 | punctuation.definition.tag.html 66 | 67 | 2 68 | 69 | name 70 | entity.name.tag.xml.html 71 | 72 | 73 | end 74 | (\?>) 75 | name 76 | meta.tag.preprocessor.xml.html 77 | patterns 78 | 79 | 80 | include 81 | #tag-generic-attribute 82 | 83 | 84 | include 85 | #string-double-quoted 86 | 87 | 88 | include 89 | #string-single-quoted 90 | 91 | 92 | 93 | 94 | begin 95 | <!-- 96 | captures 97 | 98 | 0 99 | 100 | name 101 | punctuation.definition.comment.html 102 | 103 | 104 | end 105 | --\s*> 106 | name 107 | comment.block.html 108 | patterns 109 | 110 | 111 | match 112 | --(?!-) 113 | name 114 | invalid.illegal.bad-comments-or-CDATA.html 115 | 116 | 117 | match 118 | -+(?=-->) 119 | name 120 | invalid.illegal.bad-comments-or-CDATA.html 121 | 122 | 123 | include 124 | #embedded-code 125 | 126 | 127 | 128 | 129 | begin 130 | <! 131 | captures 132 | 133 | 0 134 | 135 | name 136 | punctuation.definition.tag.html 137 | 138 | 139 | end 140 | > 141 | name 142 | meta.tag.sgml.html 143 | patterns 144 | 145 | 146 | begin 147 | (?i)(doctype) 148 | captures 149 | 150 | 1 151 | 152 | name 153 | entity.name.tag.doctype.html 154 | 155 | 156 | end 157 | (?=>) 158 | name 159 | meta.tag.sgml.doctype.html 160 | patterns 161 | 162 | 163 | match 164 | "[^">]*" 165 | name 166 | string.quoted.double.doctype.identifiers-and-DTDs.html 167 | 168 | 169 | 170 | 171 | begin 172 | \[CDATA\[ 173 | end 174 | ]](?=>) 175 | name 176 | constant.other.inline-data.html 177 | 178 | 179 | match 180 | (\s*)(?!--|>)\S(\s*) 181 | name 182 | invalid.illegal.bad-comments-or-CDATA.html 183 | 184 | 185 | 186 | 187 | include 188 | #embedded-code 189 | 190 | 191 | begin 192 | (?:^\s+)?(<)((?i:style))\b(?![^>]*/>) 193 | captures 194 | 195 | 1 196 | 197 | name 198 | punctuation.definition.tag.begin.html 199 | 200 | 2 201 | 202 | name 203 | entity.name.tag.style.html 204 | 205 | 3 206 | 207 | name 208 | punctuation.definition.tag.html 209 | 210 | 211 | end 212 | (</)((?i:style))(>)(?:\s*\n)? 213 | name 214 | source.css.embedded.html 215 | patterns 216 | 217 | 218 | include 219 | #tag-stuff 220 | 221 | 222 | begin 223 | (>) 224 | beginCaptures 225 | 226 | 1 227 | 228 | name 229 | punctuation.definition.tag.html 230 | 231 | 232 | end 233 | (?=</(?i:style)) 234 | patterns 235 | 236 | 237 | include 238 | #embedded-code 239 | 240 | 241 | include 242 | source.css 243 | 244 | 245 | 246 | 247 | 248 | 249 | begin 250 | (?i)\s*<script\s+type=(["'])text/jsx.*?\1[^>]*> 251 | end 252 | </script> 253 | name 254 | source.js.jsx.embedded.html 255 | patterns 256 | 257 | 258 | include 259 | source.js.jsx 260 | 261 | 262 | 263 | 264 | begin 265 | \s*<script\s+type=(["'])text/html.*?\1[^>]*> 266 | beginCaptures 267 | 268 | end 269 | </script> 270 | endCaptures 271 | 272 | name 273 | text.html.embedded.html 274 | patterns 275 | 276 | 277 | include 278 | $base 279 | 280 | 281 | 282 | 283 | begin 284 | (?:^\s+)?(<)((?i:script))\b(?![^>]*/>) 285 | beginCaptures 286 | 287 | 1 288 | 289 | name 290 | punctuation.definition.tag.html 291 | 292 | 2 293 | 294 | name 295 | entity.name.tag.script.html 296 | 297 | 298 | end 299 | (?<=</(script|SCRIPT))(>)(?:\s*\n)? 300 | endCaptures 301 | 302 | 2 303 | 304 | name 305 | punctuation.definition.tag.html 306 | 307 | 308 | name 309 | source.js.embedded.html 310 | patterns 311 | 312 | 313 | include 314 | #tag-stuff 315 | 316 | 317 | begin 318 | (?<!</(?:script|SCRIPT))(>) 319 | captures 320 | 321 | 1 322 | 323 | name 324 | punctuation.definition.tag.html 325 | 326 | 2 327 | 328 | name 329 | entity.name.tag.script.html 330 | 331 | 332 | end 333 | (</)((?i:script)) 334 | patterns 335 | 336 | 337 | captures 338 | 339 | 1 340 | 341 | name 342 | punctuation.definition.comment.js 343 | 344 | 345 | match 346 | (//).*?((?=</script)|$\n?) 347 | name 348 | comment.line.double-slash.js 349 | 350 | 351 | begin 352 | /\* 353 | captures 354 | 355 | 0 356 | 357 | name 358 | punctuation.definition.comment.js 359 | 360 | 361 | end 362 | \*/|(?=</script) 363 | name 364 | comment.block.js 365 | 366 | 367 | include 368 | #php 369 | 370 | 371 | include 372 | source.js 373 | 374 | 375 | 376 | 377 | 378 | 379 | begin 380 | (</?)((?i:body|head|html)\b) 381 | beginCaptures 382 | 383 | 1 384 | 385 | name 386 | punctuation.definition.tag.begin.html 387 | 388 | 2 389 | 390 | name 391 | entity.name.tag.structure.any.html 392 | 393 | 394 | end 395 | (>) 396 | endCaptures 397 | 398 | 1 399 | 400 | name 401 | punctuation.definition.tag.end.html 402 | 403 | 404 | name 405 | meta.tag.structure.any.html 406 | patterns 407 | 408 | 409 | include 410 | #tag-stuff 411 | 412 | 413 | 414 | 415 | begin 416 | (</?)((?i:article|aside|canvas|command|datalist|details|embed|figcaption|figure|footer|header|hgroup|keygen|mark|meter|nav|output|progress|ruby|rt|rp|section|time|video|audio|wbr)\b) 417 | beginCaptures 418 | 419 | 1 420 | 421 | name 422 | punctuation.definition.tag.begin.html 423 | 424 | 2 425 | 426 | name 427 | entity.name.tag.structure.any.html 428 | 429 | 430 | end 431 | (>) 432 | endCaptures 433 | 434 | 1 435 | 436 | name 437 | punctuation.definition.tag.end.html 438 | 439 | 440 | name 441 | meta.tag.special.html.5 442 | patterns 443 | 444 | 445 | include 446 | #tag-stuff 447 | 448 | 449 | 450 | 451 | begin 452 | (</?)((?i:form|label|button|select|optgroup)\b) 453 | beginCaptures 454 | 455 | 1 456 | 457 | name 458 | punctuation.definition.tag.begin.html 459 | 460 | 2 461 | 462 | name 463 | entity.name.tag.block.any.html 464 | 465 | 466 | end 467 | (>) 468 | endCaptures 469 | 470 | 1 471 | 472 | name 473 | punctuation.definition.tag.end.html 474 | 475 | 476 | name 477 | meta.tag.block.form.html 478 | patterns 479 | 480 | 481 | include 482 | #tag-stuff 483 | 484 | 485 | 486 | 487 | begin 488 | (</?)((?i:option)\b) 489 | beginCaptures 490 | 491 | 1 492 | 493 | name 494 | punctuation.definition.tag.begin.html 495 | 496 | 2 497 | 498 | name 499 | entity.name.tag.inline.any.html 500 | 501 | 502 | end 503 | (>) 504 | endCaptures 505 | 506 | 1 507 | 508 | name 509 | punctuation.definition.tag.end.html 510 | 511 | 512 | name 513 | meta.tag.inline.form.html 514 | patterns 515 | 516 | 517 | include 518 | #tag-stuff 519 | 520 | 521 | 522 | 523 | begin 524 | (</?)((?i:address|blockquote|dd|div|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\b) 525 | beginCaptures 526 | 527 | 1 528 | 529 | name 530 | punctuation.definition.tag.html 531 | 532 | 2 533 | 534 | name 535 | entity.name.tag.block.any.html 536 | 537 | 538 | end 539 | (>) 540 | endCaptures 541 | 542 | 1 543 | 544 | name 545 | punctuation.definition.tag.end.html 546 | 547 | 548 | name 549 | meta.tag.block.any.html 550 | patterns 551 | 552 | 553 | include 554 | #tag-stuff 555 | 556 | 557 | 558 | 559 | begin 560 | (<)((?i:input)\b) 561 | beginCaptures 562 | 563 | 1 564 | 565 | name 566 | punctuation.definition.tag.html 567 | 568 | 2 569 | 570 | name 571 | entity.name.tag.inline.any.void.html 572 | 573 | 574 | end 575 | (/?>) 576 | endCaptures 577 | 578 | 1 579 | 580 | name 581 | punctuation.definition.tag.end.html 582 | 583 | 584 | name 585 | meta.tag.form.any.void.html 586 | patterns 587 | 588 | 589 | include 590 | #tag-stuff 591 | 592 | 593 | 594 | 595 | begin 596 | (<)((?i:area|base|basefont|br|hr|img|input|link|meta)\b) 597 | beginCaptures 598 | 599 | 1 600 | 601 | name 602 | punctuation.definition.tag.html 603 | 604 | 2 605 | 606 | name 607 | entity.name.tag.inline.any.void.html 608 | 609 | 610 | end 611 | (/?>) 612 | endCaptures 613 | 614 | 1 615 | 616 | name 617 | punctuation.definition.tag.end.html 618 | 619 | 620 | name 621 | meta.tag.inline.any.void.html 622 | patterns 623 | 624 | 625 | include 626 | #tag-stuff 627 | 628 | 629 | 630 | 631 | begin 632 | (</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\b) 633 | beginCaptures 634 | 635 | 1 636 | 637 | name 638 | punctuation.definition.tag.html 639 | 640 | 2 641 | 642 | name 643 | entity.name.tag.inline.any.html 644 | 645 | 646 | end 647 | (>) 648 | endCaptures 649 | 650 | 1 651 | 652 | name 653 | punctuation.definition.tag.end.html 654 | 655 | 656 | name 657 | meta.tag.inline.any.html 658 | patterns 659 | 660 | 661 | include 662 | #tag-stuff 663 | 664 | 665 | 666 | 667 | begin 668 | (<)([a-zA-Z0-9][a-zA-Z0-9:-]*)(?=[^>]*></\2>) 669 | beginCaptures 670 | 671 | 1 672 | 673 | name 674 | punctuation.definition.tag.html 675 | 676 | 2 677 | 678 | name 679 | entity.name.tag.html 680 | 681 | 682 | end 683 | (>)(</)(\2)(>) 684 | endCaptures 685 | 686 | 1 687 | 688 | name 689 | punctuation.definition.tag.end.close.html 690 | 691 | 3 692 | 693 | name 694 | entity.name.tag.html 695 | 696 | 4 697 | 698 | name 699 | punctuation.definition.tag.begin.close.html 700 | 701 | 702 | name 703 | meta.tag.any.html 704 | patterns 705 | 706 | 707 | include 708 | #tag-stuff 709 | 710 | 711 | 712 | 713 | begin 714 | (</?)([a-zA-Z0-9][a-zA-Z0-9:-]*) 715 | beginCaptures 716 | 717 | 1 718 | 719 | name 720 | punctuation.definition.tag.html 721 | 722 | 2 723 | 724 | name 725 | entity.name.tag.other.html 726 | 727 | 728 | end 729 | (>) 730 | endCaptures 731 | 732 | 1 733 | 734 | name 735 | punctuation.definition.tag.end.html 736 | 737 | 738 | name 739 | meta.tag.other.html 740 | patterns 741 | 742 | 743 | include 744 | #tag-stuff 745 | 746 | 747 | 748 | 749 | include 750 | #entities 751 | 752 | 753 | match 754 | <> 755 | name 756 | invalid.illegal.incomplete.html 757 | 758 | 759 | match 760 | < 761 | name 762 | invalid.illegal.bad-angle-bracket.html 763 | 764 | 765 | repository 766 | 767 | embedded-code 768 | 769 | patterns 770 | 771 | 772 | include 773 | #ruby 774 | 775 | 776 | include 777 | #php 778 | 779 | 780 | include 781 | #smarty 782 | 783 | 784 | include 785 | #python 786 | 787 | 788 | 789 | entities 790 | 791 | patterns 792 | 793 | 794 | captures 795 | 796 | 1 797 | 798 | name 799 | punctuation.definition.entity.html 800 | 801 | 3 802 | 803 | name 804 | punctuation.definition.entity.html 805 | 806 | 807 | match 808 | (&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;) 809 | name 810 | constant.character.entity.html 811 | 812 | 813 | match 814 | &(?!$|[\s<]) 815 | name 816 | invalid.illegal.bad-ampersand.html 817 | 818 | 819 | 820 | php 821 | 822 | patterns 823 | 824 | 825 | captures 826 | 827 | 1 828 | 829 | name 830 | source.php.embedded.line.empty.whitespace.html 831 | 832 | 833 | match 834 | <\?(?i:php|=)?(\s*\?)> 835 | name 836 | source.php.embedded.line.empty.html 837 | 838 | 839 | applyEndPatternLast 840 | 1 841 | begin 842 | (?:^\s*)(?=<\?(?i:php|=)?(?!.*\?>)) 843 | comment 844 | match only multi-line PHP with leading whitespace 845 | end 846 | (?<=\?>)(?:\s*$\n)? 847 | name 848 | source.php.embedded.block.html 849 | patterns 850 | 851 | 852 | include 853 | source.php 854 | 855 | 856 | 857 | 858 | applyEndPatternLast 859 | 1 860 | begin 861 | (?=<\?(?i:php|=)?) 862 | end 863 | (?<=\?>) 864 | name 865 | source.php.embedded.line.html 866 | patterns 867 | 868 | 869 | include 870 | source.php 871 | 872 | 873 | 874 | 875 | 876 | python 877 | 878 | begin 879 | (?:^\s*)<\?python(?!.*\?>) 880 | end 881 | \?>(?:\s*$\n)? 882 | name 883 | source.python.embedded.html 884 | patterns 885 | 886 | 887 | include 888 | source.python 889 | 890 | 891 | 892 | ruby 893 | 894 | patterns 895 | 896 | 897 | begin 898 | <%+# 899 | captures 900 | 901 | 0 902 | 903 | name 904 | punctuation.definition.comment.erb 905 | 906 | 907 | end 908 | %> 909 | name 910 | comment.block.erb 911 | 912 | 913 | begin 914 | <%+(?!>)=? 915 | captures 916 | 917 | 0 918 | 919 | name 920 | punctuation.section.embedded.ruby 921 | 922 | 923 | end 924 | -?%> 925 | name 926 | source.ruby.embedded.html 927 | patterns 928 | 929 | 930 | captures 931 | 932 | 1 933 | 934 | name 935 | punctuation.definition.comment.ruby 936 | 937 | 938 | match 939 | (#).*?(?=-?%>) 940 | name 941 | comment.line.number-sign.ruby 942 | 943 | 944 | include 945 | source.ruby 946 | 947 | 948 | 949 | 950 | begin 951 | <\?r(?!>)=? 952 | captures 953 | 954 | 0 955 | 956 | name 957 | punctuation.section.embedded.ruby.nitro 958 | 959 | 960 | end 961 | -?\?> 962 | name 963 | source.ruby.nitro.embedded.html 964 | patterns 965 | 966 | 967 | captures 968 | 969 | 1 970 | 971 | name 972 | punctuation.definition.comment.ruby.nitro 973 | 974 | 975 | match 976 | (#).*?(?=-?\?>) 977 | name 978 | comment.line.number-sign.ruby.nitro 979 | 980 | 981 | include 982 | source.ruby 983 | 984 | 985 | 986 | 987 | 988 | smarty 989 | 990 | patterns 991 | 992 | 993 | begin 994 | (\{(literal)\}) 995 | captures 996 | 997 | 1 998 | 999 | name 1000 | source.smarty.embedded.html 1001 | 1002 | 2 1003 | 1004 | name 1005 | support.function.built-in.smarty 1006 | 1007 | 1008 | end 1009 | (\{/(literal)\}) 1010 | 1011 | 1012 | begin 1013 | {{|{ 1014 | disabled 1015 | 1 1016 | end 1017 | }}|} 1018 | name 1019 | source.smarty.embedded.html 1020 | patterns 1021 | 1022 | 1023 | include 1024 | source.smarty 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | string-double-quoted 1031 | 1032 | begin 1033 | " 1034 | beginCaptures 1035 | 1036 | 0 1037 | 1038 | name 1039 | punctuation.definition.string.begin.html 1040 | 1041 | 1042 | end 1043 | " 1044 | endCaptures 1045 | 1046 | 0 1047 | 1048 | name 1049 | punctuation.definition.string.end.html 1050 | 1051 | 1052 | name 1053 | string.quoted.double.html 1054 | patterns 1055 | 1056 | 1057 | include 1058 | #embedded-code 1059 | 1060 | 1061 | include 1062 | #entities 1063 | 1064 | 1065 | 1066 | string-single-quoted 1067 | 1068 | begin 1069 | ' 1070 | beginCaptures 1071 | 1072 | 0 1073 | 1074 | name 1075 | punctuation.definition.string.begin.html 1076 | 1077 | 1078 | end 1079 | ' 1080 | endCaptures 1081 | 1082 | 0 1083 | 1084 | name 1085 | punctuation.definition.string.end.html 1086 | 1087 | 1088 | name 1089 | string.quoted.single.html 1090 | patterns 1091 | 1092 | 1093 | include 1094 | #embedded-code 1095 | 1096 | 1097 | include 1098 | #entities 1099 | 1100 | 1101 | 1102 | tag-generic-attribute 1103 | 1104 | patterns 1105 | 1106 | 1107 | match 1108 | =(?=\s+[^"']|>) 1109 | name 1110 | invalid.illegal.attribute-value.html 1111 | 1112 | 1113 | match 1114 | (?<==)[-._:a-zA-Z0-9]+(?=\s|>) 1115 | name 1116 | string.unquoted.html 1117 | 1118 | 1119 | begin 1120 | (?<==)(?!\s|>|'|") 1121 | end 1122 | (?=\s|>) 1123 | name 1124 | string.unquoted.invalid.illegal.html 1125 | patterns 1126 | 1127 | 1128 | include 1129 | #entities 1130 | 1131 | 1132 | match 1133 | [^-._:a-zA-Z0-9] 1134 | name 1135 | invalid.illegal.html 1136 | 1137 | 1138 | 1139 | 1140 | match 1141 | \b([a-zA-Z\-:]+) 1142 | name 1143 | entity.other.attribute-name.html 1144 | 1145 | 1146 | 1147 | tag-id-attribute 1148 | 1149 | patterns 1150 | 1151 | 1152 | begin 1153 | \b(value)\b\s*(=)(?!\s|>|'|") 1154 | captures 1155 | 1156 | 1 1157 | 1158 | name 1159 | entity.other.attribute-name.value.html 1160 | 1161 | 2 1162 | 1163 | name 1164 | punctuation.separator.key-value.html 1165 | 1166 | 1167 | disabled 1168 | 1 1169 | end 1170 | (?=\s|>) 1171 | name 1172 | meta.attribute-with-value.value.html 1173 | patterns 1174 | 1175 | 1176 | begin 1177 | (?<==)(?!'|") 1178 | contentName 1179 | meta.property.value.html 1180 | end 1181 | (?=\s|>) 1182 | name 1183 | string.unquoted.html 1184 | patterns 1185 | 1186 | 1187 | include 1188 | #embedded-code 1189 | 1190 | 1191 | include 1192 | #entities 1193 | 1194 | 1195 | 1196 | 1197 | 1198 | 1199 | begin 1200 | \b(value)\b\s*(=)\s*(?='|") 1201 | captures 1202 | 1203 | 1 1204 | 1205 | name 1206 | entity.other.attribute-name.value.html 1207 | 1208 | 2 1209 | 1210 | name 1211 | punctuation.separator.key-value.html 1212 | 1213 | 1214 | disabled 1215 | 1 1216 | end 1217 | (?<='|") 1218 | name 1219 | meta.attribute-with-value.value.html 1220 | patterns 1221 | 1222 | 1223 | begin 1224 | " 1225 | beginCaptures 1226 | 1227 | 0 1228 | 1229 | name 1230 | punctuation.definition.string.begin.html 1231 | 1232 | 1233 | contentName 1234 | meta.property.value.html 1235 | end 1236 | " 1237 | endCaptures 1238 | 1239 | 0 1240 | 1241 | name 1242 | punctuation.definition.string.end.html 1243 | 1244 | 1245 | name 1246 | string.quoted.double.html 1247 | patterns 1248 | 1249 | 1250 | include 1251 | #embedded-code 1252 | 1253 | 1254 | include 1255 | #entities 1256 | 1257 | 1258 | 1259 | 1260 | begin 1261 | ' 1262 | beginCaptures 1263 | 1264 | 0 1265 | 1266 | name 1267 | punctuation.definition.string.begin.html 1268 | 1269 | 1270 | contentName 1271 | meta.property.value.html 1272 | end 1273 | ' 1274 | endCaptures 1275 | 1276 | 0 1277 | 1278 | name 1279 | punctuation.definition.string.end.html 1280 | 1281 | 1282 | name 1283 | string.quoted.single.html 1284 | patterns 1285 | 1286 | 1287 | include 1288 | #embedded-code 1289 | 1290 | 1291 | include 1292 | #entities 1293 | 1294 | 1295 | 1296 | 1297 | 1298 | 1299 | begin 1300 | \b(id)\b\s*(=)(?!\s|>|'|") 1301 | captures 1302 | 1303 | 1 1304 | 1305 | name 1306 | entity.other.attribute-name.id.html 1307 | 1308 | 2 1309 | 1310 | name 1311 | punctuation.separator.key-value.html 1312 | 1313 | 1314 | end 1315 | (?=\s|>) 1316 | name 1317 | meta.attribute-with-value.id.html 1318 | patterns 1319 | 1320 | 1321 | begin 1322 | (?<==)(?!'|") 1323 | contentName 1324 | meta.toc-list.id.html 1325 | end 1326 | (?=\s|>) 1327 | name 1328 | string.unquoted.html 1329 | patterns 1330 | 1331 | 1332 | include 1333 | #embedded-code 1334 | 1335 | 1336 | include 1337 | #entities 1338 | 1339 | 1340 | 1341 | 1342 | 1343 | 1344 | begin 1345 | \b(id)\b\s*(=)\s*(?='|") 1346 | captures 1347 | 1348 | 1 1349 | 1350 | name 1351 | entity.other.attribute-name.id.html 1352 | 1353 | 2 1354 | 1355 | name 1356 | punctuation.separator.key-value.html 1357 | 1358 | 1359 | end 1360 | (?<='|") 1361 | name 1362 | meta.attribute-with-value.id.html 1363 | patterns 1364 | 1365 | 1366 | begin 1367 | " 1368 | beginCaptures 1369 | 1370 | 0 1371 | 1372 | name 1373 | punctuation.definition.string.begin.html 1374 | 1375 | 1376 | contentName 1377 | meta.toc-list.id.html 1378 | end 1379 | " 1380 | endCaptures 1381 | 1382 | 0 1383 | 1384 | name 1385 | punctuation.definition.string.end.html 1386 | 1387 | 1388 | name 1389 | string.quoted.double.html 1390 | patterns 1391 | 1392 | 1393 | include 1394 | #embedded-code 1395 | 1396 | 1397 | include 1398 | #entities 1399 | 1400 | 1401 | 1402 | 1403 | begin 1404 | ' 1405 | beginCaptures 1406 | 1407 | 0 1408 | 1409 | name 1410 | punctuation.definition.string.begin.html 1411 | 1412 | 1413 | contentName 1414 | meta.toc-list.id.html 1415 | end 1416 | ' 1417 | endCaptures 1418 | 1419 | 0 1420 | 1421 | name 1422 | punctuation.definition.string.end.html 1423 | 1424 | 1425 | name 1426 | string.quoted.single.html 1427 | patterns 1428 | 1429 | 1430 | include 1431 | #embedded-code 1432 | 1433 | 1434 | include 1435 | #entities 1436 | 1437 | 1438 | 1439 | 1440 | 1441 | 1442 | 1443 | tag-js-attribute 1444 | 1445 | begin 1446 | \b(on\w+)\b\s*(=)(?='|") 1447 | captures 1448 | 1449 | 1 1450 | 1451 | name 1452 | entity.other.attribute-name.js.html 1453 | 1454 | 2 1455 | 1456 | name 1457 | punctuation.separator.key-value.html 1458 | 1459 | 1460 | end 1461 | (?<='|") 1462 | name 1463 | meta.attribute-with-value.js.html 1464 | patterns 1465 | 1466 | 1467 | begin 1468 | " 1469 | beginCaptures 1470 | 1471 | 0 1472 | 1473 | name 1474 | punctuation.definition.string.begin.html 1475 | 1476 | 1477 | contentName 1478 | source.js.embedded.html 1479 | end 1480 | " 1481 | endCaptures 1482 | 1483 | 0 1484 | 1485 | name 1486 | punctuation.definition.string.end.html 1487 | 1488 | 1489 | name 1490 | string.quoted.double.html 1491 | patterns 1492 | 1493 | 1494 | include 1495 | #embedded-code 1496 | 1497 | 1498 | include 1499 | #entities 1500 | 1501 | 1502 | include 1503 | source.js 1504 | 1505 | 1506 | 1507 | 1508 | begin 1509 | ' 1510 | beginCaptures 1511 | 1512 | 0 1513 | 1514 | name 1515 | punctuation.definition.string.begin.html 1516 | 1517 | 1518 | contentName 1519 | source.css.embedded.html 1520 | end 1521 | ' 1522 | endCaptures 1523 | 1524 | 0 1525 | 1526 | name 1527 | punctuation.definition.string.end.html 1528 | 1529 | 1530 | name 1531 | string.quoted.single.html 1532 | patterns 1533 | 1534 | 1535 | include 1536 | #embedded-code 1537 | 1538 | 1539 | include 1540 | #entities 1541 | 1542 | 1543 | include 1544 | source.js 1545 | 1546 | 1547 | 1548 | 1549 | 1550 | tag-stuff 1551 | 1552 | patterns 1553 | 1554 | 1555 | include 1556 | #tag-id-attribute 1557 | 1558 | 1559 | include 1560 | #tag-style-attribute 1561 | 1562 | 1563 | include 1564 | #tag-js-attribute 1565 | 1566 | 1567 | include 1568 | #tag-generic-attribute 1569 | 1570 | 1571 | include 1572 | #string-double-quoted 1573 | 1574 | 1575 | include 1576 | #string-single-quoted 1577 | 1578 | 1579 | include 1580 | #embedded-code 1581 | 1582 | 1583 | 1584 | tag-style-attribute 1585 | 1586 | begin 1587 | \b(style)\b\s*(=)(?='|") 1588 | captures 1589 | 1590 | 1 1591 | 1592 | name 1593 | entity.other.attribute-name.style.html 1594 | 1595 | 2 1596 | 1597 | name 1598 | punctuation.separator.key-value.html 1599 | 1600 | 1601 | end 1602 | (?<='|") 1603 | name 1604 | meta.attribute-with-value.style.html 1605 | patterns 1606 | 1607 | 1608 | begin 1609 | " 1610 | beginCaptures 1611 | 1612 | 0 1613 | 1614 | name 1615 | punctuation.definition.string.begin.html 1616 | 1617 | 1618 | contentName 1619 | source.css.embedded.html 1620 | end 1621 | " 1622 | endCaptures 1623 | 1624 | 0 1625 | 1626 | name 1627 | punctuation.definition.string.end.html 1628 | 1629 | 1630 | name 1631 | string.quoted.double.html 1632 | patterns 1633 | 1634 | 1635 | include 1636 | #embedded-code 1637 | 1638 | 1639 | include 1640 | #entities 1641 | 1642 | 1643 | include 1644 | source.css.rules 1645 | 1646 | 1647 | 1648 | 1649 | begin 1650 | ' 1651 | beginCaptures 1652 | 1653 | 0 1654 | 1655 | name 1656 | punctuation.definition.string.begin.html 1657 | 1658 | 1659 | contentName 1660 | source.css.embedded.html 1661 | end 1662 | ' 1663 | endCaptures 1664 | 1665 | 0 1666 | 1667 | name 1668 | punctuation.definition.string.end.html 1669 | 1670 | 1671 | name 1672 | string.quoted.single.html 1673 | patterns 1674 | 1675 | 1676 | include 1677 | #embedded-code 1678 | 1679 | 1680 | include 1681 | #entities 1682 | 1683 | 1684 | include 1685 | source.css.rules 1686 | 1687 | 1688 | 1689 | 1690 | 1691 | 1692 | scopeName 1693 | text.html.5 1694 | uuid 1695 | 8659E9F6-30F9-4B26-AD9F-2F849B513E61 1696 | 1697 | 1698 | -------------------------------------------------------------------------------- /Support/HTML5.attribute.completions.json: -------------------------------------------------------------------------------- 1 | { "tool_tip_prefix":"" 2 | , "suggestions": 3 | [ {"tool_tip":"","display":"Global id","match":"id","insert":"=${0:id}"} 4 | , {"tool_tip":"","display":"Global class","match":"class","insert":"=\"${0:class list}\""} 5 | , {"match":"charset","display":"meta charset","tag":"meta","insert":"=\"${0:}\"","tool_tip":"The charset\n attribute specifies the character encoding used by the\n document. This is a character encoding declaration. If\n the attribute is present in an XML\n document, its value must be an ASCII\n case-insensitive match for the string \"UTF-8\" (and the document is therefore forced to use\n UTF-8 as its encoding)."} 6 | , {"match":"content","display":"meta content","tag":"meta","insert":"=\"${0:}\"","tool_tip":"The content\n attribute gives the value of the document metadata or pragma\n directive when the element is used for those purposes. The allowed\n values depend on the exact context, as described in subsequent\n sections of this specification."} 7 | , {"match":"Encoding declaration state","display":"meta Encoding declaration state","tag":"meta","insert":"=\"${0:}\""} 8 | , {"match":"href","display":"base href","tag":"base","insert":"=\"${0:}\"","tool_tip":"The href content\n attribute, if specified, must contain a valid URL potentially\n surrounded by spaces."} 9 | , {"match":"href","display":"link href","tag":"link","insert":"=\"${0:}\"","tool_tip":"The href content\n attribute, if specified, must contain a valid URL potentially\n surrounded by spaces."} 10 | , {"match":"hreflang","display":"link hreflang","tag":"link","insert":"=\"${0:}\"","tool_tip":"The hreflang\n attribute on the link element has the same semantics as\n the hreflang\n attribute on a and area\n elements."} 11 | , {"match":"http-equiv","display":"meta http-equiv","tag":"meta","insert":"=\"${0:}\"","tool_tip":"When the http-equiv attribute\n is specified on a meta element, the element is a pragma\n directive."} 12 | , {"match":"manifest","display":"html manifest","tag":"html","insert":"=\"${0:}\"","tool_tip":"The manifest\n attribute gives the address of the document's application\n cache manifest, if there is\n one. If the attribute is present, the attribute's value must be a\n valid non-empty URL potentially surrounded by\n spaces."} 13 | , {"match":"media","display":"link media","tag":"link","insert":"=\"${0:}\"","tool_tip":"The media\n attribute says which media the resource applies to. The value must\n be a valid media query."} 14 | , {"match":"media","display":"style media","tag":"style","insert":"=\"${0:}\"","tool_tip":"The media\n attribute says which media the resource applies to. The value must\n be a valid media query."} 15 | , {"match":"name","display":"meta name","tag":"meta","insert":"=\"${0:}\"","tool_tip":"If a meta element has a name attribute, it sets\n document metadata. Document metadata is expressed in terms of\n name/value pairs, the name\n attribute on the meta element giving the name, and the\n content attribute on the same\n element giving the value. The name specifies what aspect of metadata\n is being set; valid names and the meaning of their values are\n described in the following sections. If a meta element\n has no content attribute,\n then the value part of the metadata name/value pair is the empty\n string."} 16 | , {"match":"rel","display":"link rel","tag":"link","insert":"=\"${0:}\"","tool_tip":"The types of link indicated (the relationships) are given by the\n value of the rel\n attribute, which, if present, must have a value that is a set\n of space-separated tokens. The allowed\n keywords and their meanings are defined in a later\n section. If the rel attribute is absent, has no\n keywords, or if none of the keywords used are allowed according to\n the definitions in this specification, then the element does not\n create any links."} 17 | , {"match":"scoped","display":"style scoped","tag":"style","insert":"","tool_tip":"The scoped\n attribute is a boolean attribute. If set, it indicates\n that the styles are intended just for the subtree rooted at the\n style element's parent element, as opposed to the whole\n Document."} 18 | , {"match":"sizes","display":"link sizes","tag":"link","insert":"=\"${0:}\"","tool_tip":"The IDL attributes href, rel, media, hreflang, and type, and sizes each must\n reflect the respective content attributes of the same\n name."} 19 | , {"match":"srcdoc","display":"head srcdoc","tag":"head","insert":"=\"${0:}\""} 20 | , {"match":"target","display":"base target","tag":"base","insert":"=\"${0:}\"","tool_tip":"The target\n attribute, if specified, must contain a valid browsing context\n name or keyword, which specifies which browsing\n context is to be used as the default when hyperlinks and forms in the Document cause navigation."} 21 | , {"match":"title","display":"link title","tag":"link","insert":"=\"${0:}\"","tool_tip":"The title\n attribute gives the title of the link. With one exception, it is\n purely advisory. The value is text. The exception is for style sheet\n links, where the title\n attribute defines alternative style sheet sets."} 22 | , {"match":"title","display":"style title","tag":"style","insert":"=\"${0:}\"","tool_tip":"The title\n attribute gives the title of the link. With one exception, it is\n purely advisory. The value is text. The exception is for style sheet\n links, where the title\n attribute defines alternative style sheet sets."} 23 | , {"match":"type","display":"link type","tag":"link","insert":"=\"${0:}\"","tool_tip":"The type attribute\n gives the MIME type of the linked resource. It is\n purely advisory. The value must be a valid MIME\n type."} 24 | , {"match":"type","display":"style type","tag":"style","insert":"=\"${0:}\"","tool_tip":"The type attribute\n gives the MIME type of the linked resource. It is\n purely advisory. The value must be a valid MIME\n type."} 25 | 26 | , {"tag":"script","display":"script async","match":"async","insert":"","tool_tip":"The async and defer attributes are boolean attributes that indicate how the script should be executed. The defer and async attributes must not be specified if the src attribute is not present."} 27 | , {"tag":"script","display":"script charset","match":"charset","insert":"=\"${0:}\"","tool_tip":"The charset attribute gives the character encoding of the external script resource. The attribute must not be specified if the src attribute is not present. If the attribute is set, its value must be a valid character encoding name, must be an ASCII case-insensitive match for the preferred MIME name for that encoding, and must match the encoding given in the charset parameter of the Content-Type metadata of the external file, if any. [IANACHARSET]"} 28 | , {"tag":"script","display":"script defer","match":"defer","insert":"","tool_tip":"The async and defer attributes are boolean attributes that indicate how the script should be executed. The defer and async attributes must not be specified if the src attribute is not present."} 29 | , {"tag":"script","display":"script src","match":"src","insert":"=\"${0:}\"","tool_tip":"The src attribute, if specified, gives the address of the external script resource to use. The value of the attribute must be a valid non-empty URL potentially surrounded by spaces identifying a script resource of the type given by the type attribute, if the attribute is present, or of the type \"text/javascript\", if the attribute is absent. A resource is a script resource of a given type if that type identifies a scripting language and the resource conforms with the requirements of that language's specification."} 30 | , {"tag":"script","display":"script type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute gives the language of the script or format of the data. If the attribute is present, its value must be a valid MIME type. The charset parameter must not be specified. The default, which is used if the attribute is absent, is \"text/javascript\"."} 31 | 32 | , {"tag":"blockquote","display":"blockquote cite","match":"cite","insert":"=\"${0:}\"","tool_tip":"Content inside a blockquote must be quoted from another source, whose address, if it has one, may be cited in the cite attribute."} 33 | , {"tag":"ol","display":"ol reversed","match":"reversed","insert":"","tool_tip":"The reversed attribute is a boolean attribute. If present, it indicates that the list is a descending list (..., 3, 2, 1). If the attribute is omitted, the list is an ascending list (1, 2, 3, ...)."} 34 | , {"tag":"ol","display":"ol start","match":"start","insert":"=\"${0:}\"","tool_tip":"The start attribute, if present, must be a valid integer giving the ordinal value of the first list item."} 35 | , {"tag":"ol","display":"ol type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute can be used to specify the kind of marker to use in the list, in the cases where that matters (e.g. because items are to be referened by their number/letter). The attribute, if specified, must have a value that is a case-sensitive match for one of the characters given in the first cell of one of the rows of the following table. The type attribute represents the state given in the cell in the second column of the row whose first cell matches the attribute's value; if none of the cells match, or if the attribute is omitted, then the attribute represents the decimal state."} 36 | , {"tag":"li","display":"li value","match":"value","insert":"=\"${0:}\"","tool_tip":"If the parent element is an ol element, then the li element has an ordinal value."} 37 | 38 | , {"tag":"a","display":"a href","match":"href","insert":"=\"${0:}\"","tool_tip":"The IDL attributes href, target, rel, media, hreflang, and type, must reflect the respective content attributes of the same name."} 39 | , {"tag":"a","display":"a target","match":"target","insert":"=\"${0:}\"","tool_tip":"The IDL attributes href, target, rel, media, hreflang, and type, must reflect the respective content attributes of the same name."} 40 | , {"tag":"a","display":"a rel","match":"rel","insert":"=\"${0:}\"","tool_tip":"The IDL attributes href, target, rel, media, hreflang, and type, must reflect the respective content attributes of the same name."} 41 | , {"tag":"a","display":"a media","match":"media","insert":"=\"${0:}\"","tool_tip":"The IDL attributes href, target, rel, media, hreflang, and type, must reflect the respective content attributes of the same name."} 42 | , {"tag":"a","display":"a hreflang","match":"hreflang","insert":"=\"${0:}\"","tool_tip":"The IDL attributes href, target, rel, media, hreflang, and type, must reflect the respective content attributes of the same name."} 43 | , {"tag":"a","display":"a type","match":"type","insert":"=\"${0:}\"","tool_tip":"The IDL attributes href, target, rel, media, hreflang, and type, must reflect the respective content attributes of the same name."} 44 | , {"tag":"q","display":"q cite","match":"cite","insert":"=\"${0:}\"","tool_tip":"Content inside a q element must be quoted from another source, whose address, if it has one, may be cited in the cite attribute. The source may be fictional, as when quoting characters in a novel or screenplay."} 45 | , {"tag":"dfn","display":"dfn title","match":"title","insert":"=\"${0:}\"","tool_tip":"Defining term: If the dfn element has a title attribute, then the exact value of that attribute is the term being defined. Otherwise, if it contains exactly one element child node and no child text nodes, and that child element is an abbr element with a title attribute, then the exact value of that attribute is the term being defined. Otherwise, it is the exact textContent of the dfn element that gives the term being defined."} 46 | , {"tag":"abbr","display":"abbr title","match":"title","insert":"=\"${0:}\"","tool_tip":"Defining term: If the dfn element has a title attribute, then the exact value of that attribute is the term being defined. Otherwise, if it contains exactly one element child node and no child text nodes, and that child element is an abbr element with a title attribute, then the exact value of that attribute is the term being defined. Otherwise, it is the exact textContent of the dfn element that gives the term being defined."} 47 | , {"tag":"time","display":"time datetime","match":"datetime","insert":"=\"${0:}\"","tool_tip":"The datetime attribute, if present, gives the date or time being specified. Otherwise, the date or time is given by the element's contents."} 48 | , {"tag":"time","display":"time pubdate","match":"pubdate","insert":"","tool_tip":"The pubdate attribute is a boolean attribute. If specified, it indicates that the date and time given by the element is the publication date and time of the nearest ancestor article element, or, if the element has no ancestor article element, of the document as a whole. If the element has a pubdate attribute specified, then the element needs a date. For each article element, there must be no more than one time element with a pubdate attribute whose nearest ancestor is that article element. Furthermore, for each Document, there must be no more than one time element with a pubdate attribute that does not have an ancestor article element."} 49 | , {"tag":"bdo","display":"bdo dir","match":"dir","insert":"=\"${0:}\""} 50 | 51 | , {"tag":"ins","display":"ins cite","match":"cite","insert":"=\"${0:}\"","tool_tip":"The cite attribute may be used to specify the address of a document that explains the change. When that document is long, for instance the minutes of a meeting, authors are encouraged to include a fragment identifier pointing to the specific part of that document that discusses the change."} 52 | , {"tag":"ins","display":"ins datetime","match":"datetime","insert":"=\"${0:}\"","tool_tip":"The datetime attribute may be used to specify the time and date of the change."} 53 | , {"tag":"del","display":"del cite","match":"cite","insert":"=\"${0:}\"","tool_tip":"The cite attribute may be used to specify the address of a document that explains the change. When that document is long, for instance the minutes of a meeting, authors are encouraged to include a fragment identifier pointing to the specific part of that document that discusses the change."} 54 | , {"tag":"del","display":"del datetime","match":"datetime","insert":"=\"${0:}\"","tool_tip":"The datetime attribute may be used to specify the time and date of the change."} 55 | 56 | , {"tag":"img","display":"img usemap","match":"usemap","insert":"=\"${0:}\"","tool_tip":"The IDL attributes alt, src, useMap, and isMap each must reflect the respective content attributes of the same name."} 57 | , {"tag":"img","display":"img alt","match":"alt","insert":"=\"${0:}\"","tool_tip":"The image given by the src attribute is the embedded content, and the value of the alt attribute is the img element's fallback content."} 58 | , {"tag":"img","display":"img src","match":"src","insert":"=\"${0:}\"","tool_tip":"The image given by the src attribute is the embedded content, and the value of the alt attribute is the img element's fallback content."} 59 | , {"tag":"img","display":"img usemap","match":"usemap","insert":"=\"${0:}\"","tool_tip":"The IDL attributes alt, src, useMap, and isMap each must reflect the respective content attributes of the same name."} 60 | , {"tag":"img","display":"img ismap","match":"ismap","insert":"=\"${0:}\"","tool_tip":"The ismap attribute, when used on an element that is a descendant of an a element with an href attribute, indicates by its presence that the element provides access to a server-side image map. This affects how events are handled on the corresponding a element."} 61 | , {"tag":"img","display":"img width","match":"width","insert":"=\"${0:}\"","tool_tip":"The IDL attributes width and height must return the rendered width and height of the image, in CSS pixels, if the image is being rendered, and is being rendered to a visual medium; or else the intrinsic width and height of the image, in CSS pixels, if the image is available but not being rendered to a visual medium; or else 0, if the image is not available. [CSS]"} 62 | , {"tag":"img","display":"img height","match":"height","insert":"=\"${0:}\"","tool_tip":"The IDL attributes width and height must return the rendered width and height of the image, in CSS pixels, if the image is being rendered, and is being rendered to a visual medium; or else the intrinsic width and height of the image, in CSS pixels, if the image is available but not being rendered to a visual medium; or else 0, if the image is not available. [CSS]"} 63 | , {"tag":"null","display":"null src","match":"src","insert":"=\"${0:}\"","tool_tip":"The src attribute gives the address of a page that the nested browsing context is to contain. The attribute, if present, must be a valid non-empty URL potentially surrounded by spaces."} 64 | , {"tag":"null","display":"null srcdoc","match":"srcdoc","insert":"=\"${0:}\"","tool_tip":"The srcdoc attribute gives the content of the page that the nested browsing context is to contain. The value of the attribute in is an iframe srcdoc document."} 65 | , {"tag":"null","display":"null name","match":"name","insert":"=\"${0:}\"","tool_tip":"The name attribute, if present, must be a valid browsing context name. The given value is used to name the nested browsing context. When the browsing context is created, if the attribute is present, the browsing context name must be set to the value of this attribute; otherwise, the browsing context name must be set to the empty string."} 66 | , {"tag":"null","display":"null sandbox","match":"sandbox","insert":"=\"${0:}\"","tool_tip":"The sandbox attribute, when specified, enables a set of extra restrictions on any content hosted by the iframe. Its value must be an unordered set of unique space-separated tokens that are ASCII case-insensitive. The allowed values are allow-same-origin, allow-top-navigation, allow-forms, and allow-scripts. When the attribute is set, the content is treated as being from a unique origin, forms and scripts are disabled, links are prevented from targeting other browsing contexts, and plugins are disabled. The allow-same-origin keyword allows the content to be treated as being from the same origin instead of forcing it into a unique origin, the allow-top-navigation keyword allows the content to navigate its top-level browsing context, and the allow-forms and allow-scripts keywords re-enable forms and scripts respectively (though scripts are still prevented from creating popups)."} 67 | , {"tag":"null","display":"null seamless","match":"seamless","insert":"","tool_tip":"The seamless attribute is a boolean attribute. When specified, it indicates that the iframe element's browsing context is to be rendered in a manner that makes it appear to be part of the containing document (seamlessly included in the parent document). Specifically, when the attribute is set on an iframe element whose owner Document's browsing context did not have the sandboxed seamless iframes flag set when that Document was created, and while either the browsing context's active document has the same origin as the iframe element's document, or the browsing context's active document's address has the same origin as the iframe element's document, the following requirements apply:"} 68 | , {"tag":"null","display":"null width","match":"width","insert":"=\"${0:}\""} 69 | , {"tag":"null","display":"null height","match":"height","insert":"=\"${0:}\""} 70 | , {"tag":"embed","display":"embed src","match":"src","insert":"=\"${0:}\"","tool_tip":"The src attribute gives the address of a page that the nested browsing context is to contain. The attribute, if present, must be a valid non-empty URL potentially surrounded by spaces."} 71 | , {"tag":"embed","display":"embed type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute, if present, gives the MIME type by which the plugin to instantiate is selected. The value must be a valid MIME type. If both the type attribute and the src attribute are present, then the type attribute must specify the same type as the explicit Content-Type metadata of the resource given by the src attribute."} 72 | , {"tag":"embed","display":"embed width","match":"width","insert":"=\"${0:}\""} 73 | , {"tag":"embed","display":"embed height","match":"height","insert":"=\"${0:}\""} 74 | , {"tag":"object","display":"object usemap","match":"usemap","insert":"=\"${0:}\"","tool_tip":"The IDL attributes data, type, name, and useMap each must reflect the respective content attributes of the same name."} 75 | , {"tag":"object","display":"object data","match":"data","insert":"=\"${0:}\"","tool_tip":"The data attribute, if present, specifies the address of the resource. If present, the attribute must be a valid non-empty URL potentially surrounded by spaces."} 76 | , {"tag":"object","display":"object type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute, if present, gives the MIME type by which the plugin to instantiate is selected. The value must be a valid MIME type. If both the type attribute and the src attribute are present, then the type attribute must specify the same type as the explicit Content-Type metadata of the resource given by the src attribute."} 77 | , {"tag":"object","display":"object name","match":"name","insert":"=\"${0:}\"","tool_tip":"The name attribute, if present, must be a valid browsing context name. The given value is used to name the nested browsing context. When the browsing context is created, if the attribute is present, the browsing context name must be set to the value of this attribute; otherwise, the browsing context name must be set to the empty string."} 78 | , {"tag":"object","display":"object usemap","match":"usemap","insert":"=\"${0:}\"","tool_tip":"The IDL attributes data, type, name, and useMap each must reflect the respective content attributes of the same name."} 79 | , {"tag":"object","display":"object form","match":"form","insert":"=\"${0:}\""} 80 | , {"tag":"object","display":"object width","match":"width","insert":"=\"${0:}\""} 81 | , {"tag":"object","display":"object height","match":"height","insert":"=\"${0:}\""} 82 | , {"tag":"param","display":"param name","match":"name","insert":"=\"${0:}\"","tool_tip":"The name attribute, if present, must be a valid browsing context name. The given value is used to name the nested browsing context. When the browsing context is created, if the attribute is present, the browsing context name must be set to the value of this attribute; otherwise, the browsing context name must be set to the empty string."} 83 | , {"tag":"param","display":"param value","match":"value","insert":"=\"${0:}\"","tool_tip":"The value attribute gives the value of the parameter."} 84 | , {"tag":"null","display":"null controls","match":"controls","insert":"","tool_tip":"The controls attribute is a boolean attribute. If present, it indicates that the author has not provided a scripted controller and would like the user agent to provide its own set of controls."} 85 | , {"tag":"null","display":"null src","match":"src","insert":"=\"${0:}\"","tool_tip":"The src attribute gives the address of the media resource. The value must be a valid non-empty URL potentially surrounded by spaces. This attribute must be present."} 86 | , {"tag":"null","display":"null src","match":"src","insert":"=\"${0:}\"","tool_tip":"The src attribute gives the address of the media resource. The value must be a valid non-empty URL potentially surrounded by spaces. This attribute must be present."} 87 | , {"tag":"null","display":"null src","match":"src","insert":"=\"${0:}\"","tool_tip":"The src attribute gives the address of the media resource. The value must be a valid non-empty URL potentially surrounded by spaces. This attribute must be present."} 88 | , {"tag":"null","display":"null poster","match":"poster","insert":"=\"${0:}\"","tool_tip":"The poster attribute gives the address of an image file that the user agent can show while no video data is available. The attribute, if present, must contain a valid non-empty URL potentially surrounded by spaces. If the specified resource is to be used, then, when the element is created or when the poster attribute is set, if its value is not the empty string, its value must be resolved relative to the element, and if that is successful, the resulting absolute URL must be fetched, from the element's Document's origin; this must delay the load event of the element's document. The poster frame is then the image obtained from that resource, if any."} 89 | , {"tag":"null","display":"null preload","match":"preload","insert":"=\"${0:}\"","tool_tip":"The preload attribute is an enumerated attribute. The following table lists the keywords and states for the attribute — the keywords in the left column map to the states in the cell in the second column on the same row as the keyword."} 90 | , {"tag":"null","display":"null autoplay","match":"autoplay","insert":"","tool_tip":"The autoplay attribute is a boolean attribute. When present, the user agent (as described in the algorithm described herein) will automatically begin playback of the media resource as soon as it can do so without stopping."} 91 | , {"tag":"null","display":"null loop","match":"loop","insert":"","tool_tip":"The loop attribute is a boolean attribute that, if specified, indicates that the media element is to seek back to the start of the media resource upon reaching the end."} 92 | , {"tag":"null","display":"null controls","match":"controls","insert":"","tool_tip":"The controls attribute is a boolean attribute. If present, it indicates that the author has not provided a scripted controller and would like the user agent to provide its own set of controls."} 93 | , {"tag":"null","display":"null width","match":"width","insert":"=\"${0:}\"","tool_tip":"The intrinsic width and intrinsic height of the media resource are the dimensions of the resource in CSS pixels after taking into account the resource's dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If an anamorphic format does not define how to apply the aspect ratio to the video data's dimensions to obtain the \"correct\" dimensions, then the user agent must apply the ratio by increasing one dimension and leaving the other unchanged."} 94 | , {"tag":"null","display":"null height","match":"height","insert":"=\"${0:}\"","tool_tip":"The intrinsic width and intrinsic height of the media resource are the dimensions of the resource in CSS pixels after taking into account the resource's dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If an anamorphic format does not define how to apply the aspect ratio to the video data's dimensions to obtain the \"correct\" dimensions, then the user agent must apply the ratio by increasing one dimension and leaving the other unchanged."} 95 | , {"tag":"audio","display":"audio controls","match":"controls","insert":"","tool_tip":"The controls attribute is a boolean attribute. If present, it indicates that the author has not provided a scripted controller and would like the user agent to provide its own set of controls."} 96 | , {"tag":"audio","display":"audio src","match":"src","insert":"=\"${0:}\"","tool_tip":"The src attribute gives the address of the media resource. The value must be a valid non-empty URL potentially surrounded by spaces. This attribute must be present."} 97 | , {"tag":"audio","display":"audio src","match":"src","insert":"=\"${0:}\"","tool_tip":"The src attribute gives the address of the media resource. The value must be a valid non-empty URL potentially surrounded by spaces. This attribute must be present."} 98 | , {"tag":"audio","display":"audio src","match":"src","insert":"=\"${0:}\"","tool_tip":"The src attribute gives the address of the media resource. The value must be a valid non-empty URL potentially surrounded by spaces. This attribute must be present."} 99 | , {"tag":"audio","display":"audio preload","match":"preload","insert":"=\"${0:}\"","tool_tip":"The preload attribute is an enumerated attribute. The following table lists the keywords and states for the attribute — the keywords in the left column map to the states in the cell in the second column on the same row as the keyword."} 100 | , {"tag":"audio","display":"audio autoplay","match":"autoplay","insert":"","tool_tip":"The autoplay attribute is a boolean attribute. When present, the user agent (as described in the algorithm described herein) will automatically begin playback of the media resource as soon as it can do so without stopping."} 101 | , {"tag":"audio","display":"audio loop","match":"loop","insert":"","tool_tip":"The loop attribute is a boolean attribute that, if specified, indicates that the media element is to seek back to the start of the media resource upon reaching the end."} 102 | , {"tag":"audio","display":"audio controls","match":"controls","insert":"","tool_tip":"The controls attribute is a boolean attribute. If present, it indicates that the author has not provided a scripted controller and would like the user agent to provide its own set of controls."} 103 | , {"tag":"source","display":"source src","match":"src","insert":"=\"${0:}\"","tool_tip":"The src attribute gives the address of the media resource. The value must be a valid non-empty URL potentially surrounded by spaces. This attribute must be present."} 104 | , {"tag":"source","display":"source type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute gives the type of the media resource, to help the user agent determine if it can play this media resource before fetching it. If specified, its value must be a valid MIME type. The codecs parameter, which certain MIME types define, might be necessary to specify exactly how the resource is encoded. [RFC4281]"} 105 | , {"tag":"source","display":"source media","match":"media","insert":"=\"${0:}\"","tool_tip":"The media attribute gives the intended media type of the media resource, to help the user agent determine if this media resource is useful to the user before fetching it. Its value must be a valid media query."} 106 | , {"tag":"null","display":"null width","match":"width","insert":"=\"${0:}\"","tool_tip":"The canvas element has two attributes to control the size of the coordinate space: width and height. These attributes, when specified, must have values that are valid non-negative integers. The rules for parsing non-negative integers must be used to obtain their numeric values. If an attribute is missing, or if parsing its value returns an error, then the default value must be used instead. The width attribute defaults to 300, and the height attribute defaults to 150."} 107 | , {"tag":"null","display":"null height","match":"height","insert":"=\"${0:}\"","tool_tip":"The canvas element has two attributes to control the size of the coordinate space: width and height. These attributes, when specified, must have values that are valid non-negative integers. The rules for parsing non-negative integers must be used to obtain their numeric values. If an attribute is missing, or if parsing its value returns an error, then the default value must be used instead. The width attribute defaults to 300, and the height attribute defaults to 150."} 108 | , {"tag":"map","display":"map name","match":"name","insert":"=\"${0:}\"","tool_tip":"The name attribute gives the map a name so that it can be referenced. The attribute must be present and must have a non-empty value with no space characters. The value of the name attribute must not be a compatibility-caseless match for the value of the name attribute of another map element in the same document. If the id attribute is also specified, both attributes must have the same value."} 109 | , {"tag":"area","display":"area alt","match":"alt","insert":"=\"${0:}\"","tool_tip":"If the area element has an href attribute, then the area element represents a hyperlink. In this case, the alt attribute must be present. It specifies the text of the hyperlink. Its value must be text that, when presented with the texts specified for the other hyperlinks of the image map, and with the alternative text of the image, but without the image itself, provides the user with the same kind of choice as the hyperlink would when used without its text but with its shape applied to the image. The alt attribute may be left blank if there is another area element in the same image map that points to the same resource and has a non-blank alt attribute."} 110 | , {"tag":"area","display":"area coords","match":"coords","insert":"=\"${0:}\"","tool_tip":"The coords attribute must, if specified, contain a valid list of integers. This attribute gives the coordinates for the shape described by the shape attribute. The processing for this attribute is described as part of the image map processing model."} 111 | , {"tag":"area","display":"area shape","match":"shape","insert":"=\"${0:}\"","tool_tip":"The shape attribute is an enumerated attribute. The following table lists the keywords defined for this attribute. The states given in the first cell of the rows with keywords give the states to which those keywords map. Some of the keywords are non-conforming, as noted in the last column."} 112 | , {"tag":"area","display":"area href","match":"href","insert":"=\"${0:}\"","tool_tip":"The IDL attributes alt, coords, href, target, rel, media, hreflang, and type, each must reflect the respective content attributes of the same name."} 113 | , {"tag":"area","display":"area target","match":"target","insert":"=\"${0:}\"","tool_tip":"The IDL attributes alt, coords, href, target, rel, media, hreflang, and type, each must reflect the respective content attributes of the same name."} 114 | , {"tag":"area","display":"area rel","match":"rel","insert":"=\"${0:}\"","tool_tip":"The IDL attributes alt, coords, href, target, rel, media, hreflang, and type, each must reflect the respective content attributes of the same name."} 115 | , {"tag":"area","display":"area media","match":"media","insert":"=\"${0:}\"","tool_tip":"The IDL attributes alt, coords, href, target, rel, media, hreflang, and type, each must reflect the respective content attributes of the same name."} 116 | , {"tag":"area","display":"area hreflang","match":"hreflang","insert":"=\"${0:}\"","tool_tip":"The IDL attributes alt, coords, href, target, rel, media, hreflang, and type, each must reflect the respective content attributes of the same name."} 117 | , {"tag":"area","display":"area type","match":"type","insert":"=\"${0:}\"","tool_tip":"The IDL attributes alt, coords, href, target, rel, media, hreflang, and type, each must reflect the respective content attributes of the same name."} 118 | , {"tag":"null","display":"null summary","match":"summary","insert":"=\"${0:}\"","tool_tip":"The summary attribute on table elements was suggested in earlier versions of the language as a technique for providing explanatory text for complex tables for users of screen readers. One of the techniques described above should be used instead. "} 119 | , {"tag":"colgroup","display":"colgroup span","match":"span","insert":"=\"${0:}\"","tool_tip":"If the colgroup element contains no col elements, then the element may have a span content attribute specified, whose value must be a valid non-negative integer greater than zero."} 120 | , {"tag":"colgroup","display":"colgroup span","match":"span","insert":"=\"${0:}\"","tool_tip":"If the colgroup element contains no col elements, then the element may have a span content attribute specified, whose value must be a valid non-negative integer greater than zero."} 121 | , {"tag":"colgroup","display":"colgroup span","match":"span","insert":"=\"${0:}\"","tool_tip":"If the colgroup element contains no col elements, then the element may have a span content attribute specified, whose value must be a valid non-negative integer greater than zero."} 122 | , {"tag":"col","display":"col span","match":"span","insert":"=\"${0:}\"","tool_tip":"If the colgroup element contains no col elements, then the element may have a span content attribute specified, whose value must be a valid non-negative integer greater than zero."} 123 | , {"tag":"col","display":"col span","match":"span","insert":"=\"${0:}\"","tool_tip":"If the colgroup element contains no col elements, then the element may have a span content attribute specified, whose value must be a valid non-negative integer greater than zero."} 124 | , {"tag":"td","display":"td colspan","match":"colspan","insert":"=\"${0:}\"","tool_tip":"The td and th elements may have a colspan content attribute specified, whose value must be a valid non-negative integer greater than zero."} 125 | , {"tag":"td","display":"td rowspan","match":"rowspan","insert":"=\"${0:}\"","tool_tip":"The td and th elements may also have a rowspan content attribute specified, whose value must be a valid non-negative integer."} 126 | , {"tag":"td","display":"td headers","match":"headers","insert":"=\"${0:}\"","tool_tip":"The td and th element may have a headers content attribute specified. The headers attribute, if specified, must contain a string consisting of an unordered set of unique space-separated tokens that are case-sensitive, each of which must have the value of an ID of a th element taking part in the same table as the td or th element (as defined by the table model)."} 127 | , {"tag":"th","display":"th colspan","match":"colspan","insert":"=\"${0:}\"","tool_tip":"The td and th elements may have a colspan content attribute specified, whose value must be a valid non-negative integer greater than zero."} 128 | , {"tag":"th","display":"th rowspan","match":"rowspan","insert":"=\"${0:}\"","tool_tip":"The td and th elements may also have a rowspan content attribute specified, whose value must be a valid non-negative integer."} 129 | , {"tag":"th","display":"th headers","match":"headers","insert":"=\"${0:}\"","tool_tip":"The td and th element may have a headers content attribute specified. The headers attribute, if specified, must contain a string consisting of an unordered set of unique space-separated tokens that are case-sensitive, each of which must have the value of an ID of a th element taking part in the same table as the td or th element (as defined by the table model)."} 130 | , {"tag":"th","display":"th scope","match":"scope","insert":"=\"${0:}\"","tool_tip":"The th element may have a scope content attribute specified. The scope attribute is an enumerated attribute with five states, four of which have explicit keywords:"} 131 | 132 | , {"tag":"form","display":"form accept-charset","match":"accept-charset","insert":"=\"${0:}\"","tool_tip":"The accept-charset attribute gives the character encodings that are to be used for the submission. If specified, the value must be an ordered set of unique space-separated tokens that are ASCII case-insensitive, and each token must be an ASCII case-insensitive match for the preferred MIME name of an ASCII-compatible character encoding. [IANACHARSET]"} 133 | , {"tag":"form","display":"form action","match":"action","insert":"=\"${0:}\""} 134 | , {"tag":"form","display":"form autocomplete","match":"autocomplete","insert":"=\"${0:}\"","tool_tip":"The autocomplete attribute is an enumerated attribute. The attribute has two states. The on keyword maps to the on state, and the off keyword maps to the off state. The attribute may also be omitted. The missing value default is the on state. The off state indicates that by default, input elements in the form will have their resulting autocompletion state set to off; the on state indicates that by default, input elements in the form will have their resulting autocompletion state set to on."} 135 | , {"tag":"form","display":"form enctype","match":"enctype","insert":"=\"${0:}\""} 136 | , {"tag":"form","display":"form method","match":"method","insert":"=\"${0:}\""} 137 | , {"tag":"form","display":"form name","match":"name","insert":"=\"${0:}\"","tool_tip":"The name attribute represents the form's name within the forms collection. The value must not be the empty string, and the value must be unique amongst the form elements in the forms collection that it is in, if any."} 138 | , {"tag":"form","display":"form novalidate","match":"novalidate","insert":"=\"${0:}\""} 139 | , {"tag":"form","display":"form target","match":"target","insert":"=\"${0:}\""} 140 | , {"tag":"fieldset","display":"fieldset disabled","match":"disabled","insert":"=\"${0:}\"","tool_tip":"The disabled attribute, when specified, causes all the form control descendants of the fieldset element, excluding those that are descendants of the fieldset element's first legend element child, if any, to be disabled."} 141 | , {"tag":"fieldset","display":"fieldset form","match":"form","insert":"=\"${0:}\"","tool_tip":"The form IDL attribute's behavior depends on whether the legend element is in a fieldset element or not. If the legend has a fieldset element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that fieldset element. Otherwise, it must return null."} 142 | , {"tag":"fieldset","display":"fieldset name","match":"name","insert":"=\"${0:}\"","tool_tip":"The name attribute represents the form's name within the forms collection. The value must not be the empty string, and the value must be unique amongst the form elements in the forms collection that it is in, if any."} 143 | , {"tag":"label","display":"label form","match":"form","insert":"=\"${0:}\"","tool_tip":"The form IDL attribute's behavior depends on whether the legend element is in a fieldset element or not. If the legend has a fieldset element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that fieldset element. Otherwise, it must return null."} 144 | , {"tag":"label","display":"label for","match":"for","insert":"=\"${0:}\"","tool_tip":"The for attribute may be specified to indicate a form control with which the caption is to be associated. If the attribute is specified, the attribute's value must be the ID of a labelable form-associated element in the same Document as the label element. If the attribute is specified and there is an element in the Document whose ID is equal to the value of the for attribute, and the first such element is a labelable form-associated element, then that element is the label element's labeled control."} 145 | 146 | 147 | , {"tag":"input","display":"input type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute controls the data type (and associated control) of the element. It is an enumerated attribute. The following table lists the keywords and states for the attribute — the keywords in the left column map to the states in the cell in the second column on the same row as the keyword."} 148 | 149 | , {"tag":"input","display":"input type=hidden","match":"type=hidden","insert":"","tool_tip":"Hidden An arbitrary string"} 150 | , {"tag":"input","display":"input type=text","match":"type=text","insert":"","tool_tip":"Text Text with no line breaks Text field"} 151 | , {"tag":"input","display":"input type=search","match":"type=search","insert":"","tool_tip":"Search Text with no line breaks Search field"} 152 | , {"tag":"input","display":"input type=tel","match":"type=tel","insert":"","tool_tip":"Telephone Text with no line breaks A text field"} 153 | , {"tag":"input","display":"input type=url","match":"type=url","insert":"","tool_tip":"URL An absolute IRI A text field"} 154 | , {"tag":"input","display":"input type=email","match":"type=email","insert":"","tool_tip":"E-mail An e-mail address or list of e-mail addresses A text field"} 155 | , {"tag":"input","display":"input type=password","match":"type=password","insert":"","tool_tip":"Password Text with no line breaks (sensitive information) Text field that obscures data entry"} 156 | , {"tag":"input","display":"input type=datetime","match":"type=datetime","insert":"","tool_tip":"Date and Time A date and time (year, month, day, hour, minute, second, fraction of a second) with the time zone set to UTC A date and time control"} 157 | , {"tag":"input","display":"input type=date","match":"type=date","insert":"","tool_tip":"Date A date (year, month, day) with no time zone A date control"} 158 | , {"tag":"input","display":"input type=month","match":"type=month","insert":"","tool_tip":"Month A date consisting of a year and a month with no time zone A month control"} 159 | , {"tag":"input","display":"input type=week","match":"type=week","insert":"","tool_tip":"Week A date consisting of a week-year number and a week number with no time zone A week control"} 160 | , {"tag":"input","display":"input type=time","match":"type=time","insert":"","tool_tip":"Time A time (hour, minute, seconds, fractional seconds) with no time zone A time control"} 161 | , {"tag":"input","display":"input type=datetime-local","match":"type=datetime","insert":"","tool_tip":"Local Date and Time A date and time (year, month, day, hour, minute, second, fraction of a second) with no time zone A date and time control"} 162 | , {"tag":"input","display":"input type=number","match":"type=number","insert":"","tool_tip":"Number A numerical value A text field or spinner control"} 163 | , {"tag":"input","display":"input type=range","match":"type=range","insert":"","tool_tip":"Range A numerical value, with the extra semantic that the exact value is not important A slider control or similar"} 164 | , {"tag":"input","display":"input type=color","match":"type=color","insert":"","tool_tip":"Color An sRGB color with 8-bit red, green, and blue components A color well"} 165 | , {"tag":"input","display":"input type=checkbox","match":"type=checkbox","insert":"","tool_tip":"Checkbox A set of zero or more values from a predefined list A checkbox"} 166 | , {"tag":"input","display":"input type=radio","match":"type=radio","insert":"","tool_tip":"Radio Button An enumerated value A radio button"} 167 | , {"tag":"input","display":"input type=file","match":"type=file","insert":"","tool_tip":"File Upload Zero or more files each with a MIME type and optionally a file name A label and a button"} 168 | , {"tag":"input","display":"input type=submit","match":"type=submit","insert":"","tool_tip":"Submit Button An enumerated value, with the extra semantic that it must be the last value selected and initiates form submission A button"} 169 | , {"tag":"input","display":"input type=image","match":"type=image","insert":"","tool_tip":"Image Button A coordinate, relative to a particular image's size, with the extra semantic that it must be the last value selected and initiates form submission Either a clickable image, or a button"} 170 | , {"tag":"input","display":"input type=reset","match":"type=reset","insert":"","tool_tip":"Reset Button A button"} 171 | , {"tag":"input","display":"input type=button","match":"type=button","insert":"","tool_tip":"Button A button"} 172 | 173 | 174 | , {"tag":"input","display":"input type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute controls the data type (and associated control) of the element. It is an enumerated attribute. The following table lists the keywords and states for the attribute — the keywords in the left column map to the states in the cell in the second column on the same row as the keyword."} 175 | , {"tag":"input","display":"input Hidden","match":"Hidden","insert":"=\"${0:}\""} 176 | , {"tag":"input","display":"input type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute controls the data type (and associated control) of the element. It is an enumerated attribute. The following table lists the keywords and states for the attribute — the keywords in the left column map to the states in the cell in the second column on the same row as the keyword."} 177 | , {"tag":"input","display":"input Hidden","match":"Hidden","insert":"=\"${0:}\""} 178 | , {"tag":"input","display":"input type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute controls the data type (and associated control) of the element. It is an enumerated attribute. The following table lists the keywords and states for the attribute — the keywords in the left column map to the states in the cell in the second column on the same row as the keyword."} 179 | , {"tag":"input","display":"input Hidden","match":"Hidden","insert":"=\"${0:}\""} 180 | , {"tag":"input","display":"input accept","match":"accept","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 181 | , {"tag":"input","display":"input alt","match":"alt","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 182 | , {"tag":"input","display":"input autocomplete","match":"autocomplete","insert":"=\"${0:}\"","tool_tip":"The autocomplete and type IDL attributes must reflect the respective content attributes of the same name, limited to only known values. The maxLength IDL attribute must reflect the maxlength content attribute, limited to only non-negative numbers."} 183 | , {"tag":"input","display":"input autofocus","match":"autofocus","insert":"=\"${0:}\""} 184 | , {"tag":"input","display":"input checked","match":"checked","insert":"","tool_tip":"The checked content attribute is a boolean attribute that gives the default checkedness of the input element. When the checked content attribute is added, if the control does not have dirty checkedness, the user agent must set the checkedness of the element to true; when the checked content attribute is removed, if the control does not have dirty checkedness, the user agent must set the checkedness of the element to false."} 185 | , {"tag":"input","display":"input disabled","match":"disabled","insert":"=\"${0:}\""} 186 | , {"tag":"input","display":"input form","match":"form","insert":"=\"${0:}\""} 187 | , {"tag":"input","display":"input formaction","match":"formaction","insert":"=\"${0:}\""} 188 | , {"tag":"input","display":"input formenctype","match":"formenctype","insert":"=\"${0:}\""} 189 | , {"tag":"input","display":"input formmethod","match":"formmethod","insert":"=\"${0:}\""} 190 | , {"tag":"input","display":"input formnovalidate","match":"formnovalidate","insert":"=\"${0:}\""} 191 | , {"tag":"input","display":"input formtarget","match":"formtarget","insert":"=\"${0:}\""} 192 | , {"tag":"input","display":"input height","match":"height","insert":"=\"${0:}\""} 193 | , {"tag":"input","display":"input list","match":"list","insert":"=\"${0:}\""} 194 | , {"tag":"input","display":"input max","match":"max","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 195 | , {"tag":"input","display":"input maxlength","match":"maxlength","insert":"=\"${0:}\"","tool_tip":"The autocomplete and type IDL attributes must reflect the respective content attributes of the same name, limited to only known values. The maxLength IDL attribute must reflect the maxlength content attribute, limited to only non-negative numbers."} 196 | , {"tag":"input","display":"input min","match":"min","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 197 | , {"tag":"input","display":"input multiple","match":"multiple","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 198 | , {"tag":"input","display":"input name","match":"name","insert":"=\"${0:}\""} 199 | , {"tag":"input","display":"input pattern","match":"pattern","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 200 | , {"tag":"input","display":"input placeholder","match":"placeholder","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 201 | , {"tag":"input","display":"input readonly","match":"readonly","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 202 | , {"tag":"input","display":"input required","match":"required","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 203 | , {"tag":"input","display":"input size","match":"size","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 204 | , {"tag":"input","display":"input src","match":"src","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 205 | , {"tag":"input","display":"input step","match":"step","insert":"=\"${0:}\"","tool_tip":"The accept, alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must reflect the respective content attributes of the same name. The readOnly IDL attribute must reflect the readonly content attribute. The defaultChecked IDL attribute must reflect the checked content attribute. The defaultValue IDL attribute must reflect the value content attribute."} 206 | , {"tag":"input","display":"input type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute controls the data type (and associated control) of the element. It is an enumerated attribute. The following table lists the keywords and states for the attribute — the keywords in the left column map to the states in the cell in the second column on the same row as the keyword."} 207 | , {"tag":"input","display":"input value","match":"value","insert":"=\"${0:}\"","tool_tip":"The value content attribute gives the default value of the input element. When the value content attribute is added, set, or removed, if the control's dirty value flag is false, the user agent must set the value of the element to the value of the value content attribute, if there is one, or the empty string otherwise, and then run the current value sanitization algorithm, if one is defined."} 208 | , {"tag":"input","display":"input width","match":"width","insert":"=\"${0:}\""} 209 | 210 | , {"tag":"button","display":"button autofocus","match":"autofocus","insert":"=\"${0:}\""} 211 | , {"tag":"button","display":"button disabled","match":"disabled","insert":"","tool_tip":"The disabled attribute is a boolean attribute and can be used to disable a group of option elements together."} 212 | , {"tag":"button","display":"button form","match":"form","insert":"=\"${0:}\"","tool_tip":"The form IDL attribute's behavior depends on whether the option element is in a select element or not. If the option has a select element as its parent, or has a colgroup element as its parent and that colgroup element has a select element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that select element. Otherwise, it must return null."} 213 | , {"tag":"button","display":"button formaction","match":"formaction","insert":"=\"${0:}\""} 214 | , {"tag":"button","display":"button formenctype","match":"formenctype","insert":"=\"${0:}\""} 215 | , {"tag":"button","display":"button formmethod","match":"formmethod","insert":"=\"${0:}\""} 216 | , {"tag":"button","display":"button formnovalidate","match":"formnovalidate","insert":"=\"${0:}\""} 217 | , {"tag":"button","display":"button formtarget","match":"formtarget","insert":"=\"${0:}\""} 218 | , {"tag":"button","display":"button name","match":"name","insert":"=\"${0:}\""} 219 | , {"tag":"button","display":"button type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute controls the behavior of the button when it is activated. It is an enumerated attribute. The following table lists the keywords and states for the attribute — the keywords in the left column map to the states in the cell in the second column on the same row as the keyword."} 220 | , {"tag":"button","display":"button value","match":"value","insert":"=\"${0:}\"","tool_tip":"The value attribute gives the element's value for the purposes of form submission. The element's value is the value of the element's value attribute, if there is one, or the empty string otherwise."} 221 | , {"tag":"select","display":"select autofocus","match":"autofocus","insert":"=\"${0:}\""} 222 | , {"tag":"select","display":"select disabled","match":"disabled","insert":"","tool_tip":"The disabled attribute is a boolean attribute and can be used to disable a group of option elements together."} 223 | , {"tag":"select","display":"select form","match":"form","insert":"=\"${0:}\"","tool_tip":"The form IDL attribute's behavior depends on whether the option element is in a select element or not. If the option has a select element as its parent, or has a colgroup element as its parent and that colgroup element has a select element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that select element. Otherwise, it must return null."} 224 | , {"tag":"select","display":"select multiple","match":"multiple","insert":"","tool_tip":"The multiple attribute is a boolean attribute. If the attribute is present, then the select element represents a control for selecting zero or more options from the list of options. If the attribute is absent, then the select element represents a control for selecting a single option from the list of options."} 225 | , {"tag":"select","display":"select name","match":"name","insert":"=\"${0:}\""} 226 | , {"tag":"select","display":"select required","match":"required","insert":"","tool_tip":"The required attribute is a boolean attribute. When specified, the user will be required to select a value before submitting the form."} 227 | , {"tag":"select","display":"select size","match":"size","insert":"=\"${0:}\"","tool_tip":"The size attribute gives the number of options to show to the user. The size attribute, if specified, must have a value that is a valid non-negative integer greater than zero. If the multiple attribute is present, then the size attribute's default value is 4. If the multiple attribute is absent, then the size attribute's default value is 1."} 228 | , {"tag":"optgroup","display":"optgroup disabled","match":"disabled","insert":"","tool_tip":"The disabled attribute is a boolean attribute and can be used to disable a group of option elements together."} 229 | , {"tag":"optgroup","display":"optgroup label","match":"label","insert":"=\"${0:}\"","tool_tip":"The label attribute must be specified. Its value gives the name of the group, for the purposes of the user interface. User agents should use this attribute's value when labelling the group of option elements in a select element."} 230 | , {"tag":"option","display":"option disabled","match":"disabled","insert":"","tool_tip":"The disabled attribute is a boolean attribute and can be used to disable a group of option elements together."} 231 | , {"tag":"option","display":"option label","match":"label","insert":"=\"${0:}\"","tool_tip":"The label attribute must be specified. Its value gives the name of the group, for the purposes of the user interface. User agents should use this attribute's value when labelling the group of option elements in a select element."} 232 | , {"tag":"option","display":"option selected","match":"selected","insert":"=\"${0:}\"","tool_tip":"The selected attribute represents the default selectedness of the element."} 233 | , {"tag":"option","display":"option value","match":"value","insert":"=\"${0:}\"","tool_tip":"The value attribute gives the element's value for the purposes of form submission. The element's value is the value of the element's value attribute, if there is one, or the empty string otherwise."} 234 | , {"tag":"textarea","display":"textarea autofocus","match":"autofocus","insert":"=\"${0:}\""} 235 | , {"tag":"textarea","display":"textarea cols","match":"cols","insert":"=\"${0:}\"","tool_tip":"The cols attribute specifies the expected maximum number of characters per line. If the cols attribute is specified, its value must be a valid non-negative integer greater than zero. If applying the rules for parsing non-negative integers to the attribute's value results in a number greater than zero, then the element's character width is that value; otherwise, it is 20."} 236 | , {"tag":"textarea","display":"textarea disabled","match":"disabled","insert":"","tool_tip":"The disabled attribute is a boolean attribute and can be used to disable a group of option elements together."} 237 | , {"tag":"textarea","display":"textarea form","match":"form","insert":"=\"${0:}\"","tool_tip":"The form IDL attribute's behavior depends on whether the option element is in a select element or not. If the option has a select element as its parent, or has a colgroup element as its parent and that colgroup element has a select element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that select element. Otherwise, it must return null."} 238 | , {"tag":"textarea","display":"textarea maxlength","match":"maxlength","insert":"=\"${0:}\"","tool_tip":"The maxlength attribute is a form control maxlength attribute controlled by the textarea element's dirty value flag."} 239 | , {"tag":"textarea","display":"textarea name","match":"name","insert":"=\"${0:}\""} 240 | , {"tag":"textarea","display":"textarea placeholder","match":"placeholder","insert":"=\"${0:}\"","tool_tip":"The placeholder attribute represents a hint (a word or short phrase) intended to aid the user with data entry. A hint could be a sample value or a brief description of the expected format. The attribute, if specified, must have a value that contains no U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) characters."} 241 | , {"tag":"textarea","display":"textarea readonly","match":"readonly","insert":"","tool_tip":"The readonly attribute is a boolean attribute used to control whether the text can be edited by the user or not."} 242 | , {"tag":"textarea","display":"textarea required","match":"required","insert":"","tool_tip":"The required attribute is a boolean attribute. When specified, the user will be required to select a value before submitting the form."} 243 | , {"tag":"textarea","display":"textarea rows","match":"rows","insert":"=\"${0:}\"","tool_tip":"The rows attribute specifies the number of lines to show. If the rows attribute is specified, its value must be a valid non-negative integer greater than zero. If applying the rules for parsing non-negative integers to the attribute's value results in a number greater than zero, then the element's character height is that value; otherwise, it is 2."} 244 | , {"tag":"textarea","display":"textarea wrap","match":"wrap","insert":"=\"${0:}\"","tool_tip":"The wrap attribute is an enumerated attribute with two keywords and states: the soft keyword which maps to the Soft state, and the hard keyword which maps to the Hard state. The missing value default is the Soft state."} 245 | , {"tag":"keygen","display":"keygen autofocus","match":"autofocus","insert":"=\"${0:}\""} 246 | , {"tag":"keygen","display":"keygen challenge","match":"challenge","insert":"=\"${0:}\"","tool_tip":"The challenge attribute may be specified. Its value will be packaged with the submitted key."} 247 | , {"tag":"keygen","display":"keygen disabled","match":"disabled","insert":"","tool_tip":"The disabled attribute is a boolean attribute and can be used to disable a group of option elements together."} 248 | , {"tag":"keygen","display":"keygen form","match":"form","insert":"=\"${0:}\"","tool_tip":"The form IDL attribute's behavior depends on whether the option element is in a select element or not. If the option has a select element as its parent, or has a colgroup element as its parent and that colgroup element has a select element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that select element. Otherwise, it must return null."} 249 | , {"tag":"keygen","display":"keygen keytype","match":"keytype","insert":"=\"${0:}\"","tool_tip":"The keytype attribute is an enumerated attribute. The following table lists the keywords and states for the attribute — the keywords in the left column map to the states listed in the cell in the second column on the same row as the keyword. User agents are not required to support these values, and must only recognize values whose corresponding algorithms they support."} 250 | , {"tag":"keygen","display":"keygen name","match":"name","insert":"=\"${0:}\""} 251 | , {"tag":"output","display":"output for","match":"for","insert":"=\"${0:}\"","tool_tip":"The for content attribute allows an explicit relationship to be made between the result of a calculation and the elements that represent the values that went into the calculation or that otherwise influenced the calculation. The for attribute, if specified, must contain a string consisting of an unordered set of unique space-separated tokens that are case-sensitive, each of which must have the value of an ID of an element in the same Document."} 252 | , {"tag":"output","display":"output form","match":"form","insert":"=\"${0:}\"","tool_tip":"The form IDL attribute's behavior depends on whether the option element is in a select element or not. If the option has a select element as its parent, or has a colgroup element as its parent and that colgroup element has a select element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that select element. Otherwise, it must return null."} 253 | , {"tag":"output","display":"output name","match":"name","insert":"=\"${0:}\""} 254 | , {"tag":"progress","display":"progress value","match":"value","insert":"=\"${0:}\"","tool_tip":"The value attribute gives the element's value for the purposes of form submission. The element's value is the value of the element's value attribute, if there is one, or the empty string otherwise."} 255 | , {"tag":"progress","display":"progress max","match":"max","insert":"=\"${0:}\"","tool_tip":"There are two attributes that determine the current task completion represented by the element. The value attribute specifies how much of the task has been completed, and the max attribute specifies how much work the task requires in total. The units are arbitrary and not specified."} 256 | , {"tag":"progress","display":"progress form","match":"form","insert":"=\"${0:}\"","tool_tip":"The form IDL attribute's behavior depends on whether the option element is in a select element or not. If the option has a select element as its parent, or has a colgroup element as its parent and that colgroup element has a select element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that select element. Otherwise, it must return null."} 257 | , {"tag":"meter","display":"meter value","match":"value","insert":"=\"${0:}\"","tool_tip":"The value attribute gives the element's value for the purposes of form submission. The element's value is the value of the element's value attribute, if there is one, or the empty string otherwise."} 258 | , {"tag":"meter","display":"meter min","match":"min","insert":"=\"${0:}\"","tool_tip":"The min attribute specifies the lower bound of the range, and the max attribute specifies the upper bound. The value attribute specifies the value to have the gauge indicate as the \"measured\" value."} 259 | , {"tag":"meter","display":"meter max","match":"max","insert":"=\"${0:}\"","tool_tip":"There are two attributes that determine the current task completion represented by the element. The value attribute specifies how much of the task has been completed, and the max attribute specifies how much work the task requires in total. The units are arbitrary and not specified."} 260 | , {"tag":"meter","display":"meter low","match":"low","insert":"=\"${0:}\"","tool_tip":"The other three attributes can be used to segment the gauge's range into \"low\", \"medium\", and \"high\" parts, and to indicate which part of the gauge is the \"optimum\" part. The low attribute specifies the range that is considered to be the \"low\" part, and the high attribute specifies the range that is considered to be the \"high\" part. The optimum attribute gives the position that is \"optimum\"; if that is higher than the \"high\" value then this indicates that the higher the value, the better; if it's lower than the \"low\" mark then it indicates that lower values are better, and naturally if it is in between then it indicates that neither high nor low values are good."} 261 | , {"tag":"meter","display":"meter high","match":"high","insert":"=\"${0:}\"","tool_tip":"The other three attributes can be used to segment the gauge's range into \"low\", \"medium\", and \"high\" parts, and to indicate which part of the gauge is the \"optimum\" part. The low attribute specifies the range that is considered to be the \"low\" part, and the high attribute specifies the range that is considered to be the \"high\" part. The optimum attribute gives the position that is \"optimum\"; if that is higher than the \"high\" value then this indicates that the higher the value, the better; if it's lower than the \"low\" mark then it indicates that lower values are better, and naturally if it is in between then it indicates that neither high nor low values are good."} 262 | , {"tag":"meter","display":"meter optimum","match":"optimum","insert":"=\"${0:}\"","tool_tip":"The other three attributes can be used to segment the gauge's range into \"low\", \"medium\", and \"high\" parts, and to indicate which part of the gauge is the \"optimum\" part. The low attribute specifies the range that is considered to be the \"low\" part, and the high attribute specifies the range that is considered to be the \"high\" part. The optimum attribute gives the position that is \"optimum\"; if that is higher than the \"high\" value then this indicates that the higher the value, the better; if it's lower than the \"low\" mark then it indicates that lower values are better, and naturally if it is in between then it indicates that neither high nor low values are good."} 263 | , {"tag":"meter","display":"meter form","match":"form","insert":"=\"${0:}\"","tool_tip":"The form IDL attribute's behavior depends on whether the option element is in a select element or not. If the option has a select element as its parent, or has a colgroup element as its parent and that colgroup element has a select element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that select element. Otherwise, it must return null."} 264 | 265 | , {"tag":"details","display":"details open","match":"open","insert":"","tool_tip":"The open content attribute is a boolean attribute. If present, it indicates that the details are to be shown to the user. If the attribute is absent, the details are not to be shown."} 266 | , {"tag":"command","display":"command type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute indicates the kind of command: either a normal command with an associated action, or a state or option that can be toggled, or a selection of one item from a list of items."} 267 | , {"tag":"command","display":"command label","match":"label","insert":"=\"${0:}\"","tool_tip":"The label attribute gives the name of the command, as shown to the user. The label attribute must be specified and must have a value that is not the empty string."} 268 | , {"tag":"command","display":"command icon","match":"icon","insert":"=\"${0:}\"","tool_tip":"The icon attribute gives a picture that represents the command. If the attribute is specified, the attribute's value must contain a valid non-empty URL potentially surrounded by spaces. To obtain the absolute URL of the icon when the attribute's value is not the empty string, the attribute's value must be resolved relative to the element. When the attribute is absent, or its value is the empty string, or resolving its value fails, there is no icon."} 269 | , {"tag":"command","display":"command disabled","match":"disabled","insert":"=\"${0:}\"","tool_tip":"The d...kbox state or the Radio state."} 270 | , {"tag":"command","display":"command radiogroup","match":"radiogroup","insert":"=\"${0:}\"","tool_tip":"The radiogroup attribute gives the name of the group of commands that will be toggled when the command itself is toggled, for commands whose type attribute has the value \"radio\". The scope of the name is the child list of the parent element. The attribute must be omitted unless the type attribute is in the Radio state."} 271 | , {"tag":"command","display":"command title","match":"title","insert":"=\"${0:}\"","tool_tip":"The title attribute gives a hint describing the command, which might be shown to the user to help him."} 272 | , {"tag":"menu","display":"menu type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute indicates the kind of command: either a normal command with an associated action, or a state or option that can be toggled, or a selection of one item from a list of items."} 273 | , {"tag":"menu","display":"menu type","match":"type","insert":"=\"${0:}\"","tool_tip":"The type attribute indicates the kind of command: either a normal command with an associated action, or a state or option that can be toggled, or a selection of one item from a list of items."} 274 | , {"tag":"menu","display":"menu label","match":"label","insert":"=\"${0:}\"","tool_tip":"The label attribute gives the name of the command, as shown to the user. The label attribute must be specified and must have a value that is not the empty string."} 275 | 276 | 277 | , {"tool_tip":"","display":"Global style","match":"style","insert":"=\"$0\""} 278 | , {"tool_tip":"","display":"Global title","match":"title","insert":"=\"${0:title}\""} 279 | , {"tool_tip":"","display":"Global data-","match":"data-","insert":"${1:key}=$0"} 280 | 281 | 282 | , {"tool_tip":"","display":"Global tabindex","match":"tabindex","insert":"=${0:0}"} 283 | , {"tool_tip":"","display":"Global accesskey","match":"accesskey","insert":"=${0:a}"} 284 | , {"tool_tip":"","display":"Global contextmenu","match":"contextmenu","insert":"=${0:menu_id}"} 285 | , {"tool_tip":"","display":"Global contenteditable","match":"contenteditable","insert":"=${0:true}"} 286 | , {"tool_tip":"","display":"Global draggable","match":"draggable","insert":"=${0:true}"} 287 | , {"tool_tip":"","display":"Global spellcheck","match":"spellcheck","insert":"=${0:true}"} 288 | , {"tool_tip":"","display":"Global hidden","match":"hidden","insert":"$0"} 289 | , {"tool_tip":"","display":"Global dir","match":"dir","insert":"=${0:ltr}"} 290 | , {"tool_tip":"","display":"Global lang","match":"lang","insert":"=${0:en}"} 291 | , {"tool_tip":"","display":"Global xml:lang","match":"xml:lang","insert":"=${0:en}"} 292 | , {"tool_tip":"","display":"Global xml:base","match":"xml:base","insert":"=\"$0\""} 293 | ] 294 | } 295 | --------------------------------------------------------------------------------