Merge branch 'vmg/tmscopes' into cache-bustin

Conflicts:
	lib/linguist/version.rb
This commit is contained in:
Arfon Smith
2014-10-13 20:21:31 -05:00
4 changed files with 32 additions and 1 deletions

View File

@@ -321,6 +321,11 @@ module Linguist
language ? language.lexer : Pygments::Lexer.find_by_name('Text only')
end
# Internal: Get the TextMate compatible scope for the blob
def tm_scope
language && language.tm_scope
end
# Public: Highlight syntax of blob
#
# options - A Hash of options (defaults to {})

View File

@@ -290,6 +290,16 @@ module Linguist
@lexer = Pygments::Lexer.find_by_name(attributes[:lexer] || name) ||
raise(ArgumentError, "#{@name} is missing lexer")
@tm_scope = attributes[:tm_scope] || begin
context = case @type
when :data, :markup, :prose
'text'
when :programming, nil
'source'
end
"#{context}.#{@name.downcase}"
end
@ace_mode = attributes[:ace_mode]
@wrap = attributes[:wrap] || false
@@ -363,6 +373,11 @@ module Linguist
# Returns the Lexer
attr_reader :lexer
# Public: Get the name of a TextMate-compatible scope
#
# Returns the scope
attr_reader :tm_scope
# Public: Get Ace mode
#
# Examples
@@ -564,6 +579,7 @@ module Linguist
:type => options['type'],
:aliases => options['aliases'],
:lexer => options['lexer'],
:tm_scope => options['tm_scope'],
:ace_mode => options['ace_mode'],
:wrap => options['wrap'],
:group_name => options['group'],

View File

@@ -83,6 +83,7 @@ ATS:
ActionScript:
type: programming
lexer: ActionScript 3
tm_scope: source.actionscript.3
color: "#e3491a"
search_term: as3
aliases:
@@ -282,6 +283,7 @@ C:
C#:
type: programming
ace_mode: csharp
tm_scope: source.cs
search_term: csharp
color: "#178600"
aliases:
@@ -411,6 +413,7 @@ Clojure:
CoffeeScript:
type: programming
tm_scope: source.coffee
ace_mode: coffee
color: "#244776"
aliases:
@@ -453,6 +456,7 @@ ColdFusion CFC:
Common Lisp:
type: programming
tm_scope: source.lisp
color: "#3fb68b"
aliases:
- lisp
@@ -648,6 +652,7 @@ Elm:
Emacs Lisp:
type: programming
lexer: Common Lisp
tm_scope: source.lisp
color: "#c065db"
aliases:
- elisp
@@ -932,6 +937,7 @@ Groovy Server Pages:
HTML:
type: markup
tm_scope: text.html.basic
ace_mode: html
aliases:
- xhtml
@@ -1158,6 +1164,7 @@ Java Server Pages:
JavaScript:
type: programming
tm_scope: source.js
ace_mode: javascript
color: "#f1e05a"
aliases:
@@ -1569,6 +1576,7 @@ ObjDump:
Objective-C:
type: programming
tm_scope: source.objc
color: "#438eff"
aliases:
- obj-c
@@ -1669,6 +1677,7 @@ PAWN:
PHP:
type: programming
tm_scope: text.html.php
ace_mode: php
color: "#4F5D95"
extensions:
@@ -2089,6 +2098,7 @@ SQF:
SQL:
type: data
tm_scope: source.sql
ace_mode: sql
extensions:
- .sql

View File

@@ -1,3 +1,3 @@
module Linguist
VERSION = "3.2.2b1"
VERSION = "3.3.0.b2"
end