Skip to content

Commit

Permalink
change build command to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bsmith-n4 committed May 18, 2017
2 parents 3b9654d + 68d7f98 commit 198bcd5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .sublime-build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"working_dir": "${project_path}",
"cmd": ["ruby", "requirements.rb"]
"working_dir": "${packages}/asciispec-sublime/script",
"cmd": ["./test"]
}
8 changes: 5 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ This package provides more complete and up-to-date syntax highlighting, snippets
| Name | Trigger

| Button | btn kbd:[Tab]
| Comment Block | ++//++ kbd:[Tab]
| Comment Block | ++//++ kbd:[Tab]
| Definition Block | def kbd:[Tab]
| Document Title | h0 kbd:[Tab]
| Example Block | ++==++ kbd:[Tab]
| Footnote Reference | fnr kbd:[Tab]
| Footnote | fn kbd:[Tab]
| Image | img kbd:[Tab]
| Keyboard Shortcut | kbd kbd:[Tab]
| Listing Block | -- kbd:[Tab]
| Listing Block | -- kbd:[Tab]
| Math Block | math kbd:[Tab]
| Passthrough Block | pass:[++] kbd:[Tab]
| Quote Block | __ kbd:[Tab]
| Quote Block | pass:[__] kbd:[Tab]
| Requirement Block | req kbd:[Tab]
| Section Title 1–5 | h1 kbd:[Tab], …, h5 kbd:[Tab]
| Sidebar block | pass:[**] kbd:[Tab]
Expand Down
27 changes: 16 additions & 11 deletions completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from sublime import Region
from sublime_plugin import EventListener
import time
import datetime

stamp = 'timestemp = ' +str(datetime.datetime.now())
import datetime

stamp = 'timestamp = ' + str(datetime.datetime.now())

MAX_VIEWS = 20
# String that must be found in the syntax setting of the current view
# to active this plugin.
SYNTAX = 'Asciidoc'
Expand Down Expand Up @@ -101,14 +101,19 @@ def on_query_completions(self, view, prefix, locations):

for v in views:
if len(locations) > 0 and v.id == view.id:
anchors = zip(find_by_scope(v, ANCHOR_SCOPE), repeat('anchor'))
titles = zip(find_by_scope(v, SEC_TITLE_SCOPE), repeat('title'))
reqs = zip(find_by_scope(v, REQ_ID_SCOPE), repeat('reqs'))
print(stamp)
print('view = ' + str(view) + ' v = ' + str(v),' v.id = ' + str(v.id))
print('anchor = ' + str(anchors) + ' titles = ' + str(titles),' reqs = ' + str(v.id))

return sorted(filter_completions(prefix, anchors, titles, reqs),key=lambda t: t[0].lower())
anchors = zip(find_by_scope(view, ANCHOR_SCOPE), repeat('anchor'))
titles = zip(find_by_scope(view, SEC_TITLE_SCOPE), repeat('title'))
# Refactor needed...
reqs = list(find_by_scope(view, REQ_ID_SCOPE))
prefixed_reqs = zip(('Req-' + r for r in reqs), repeat('reqs'))

# Console Logging
print(stamp)
print('view = ' + str(view) + ' v = ' + str(v), ' v.id = ' + str(v.id))
print('titles = ' + str(titles), ' reqs = ' + str(v.id))

return sorted(filter_completions(prefix, anchors, titles, prefixed_reqs),
key=lambda t: t[0].lower())

def should_trigger(self, view, point):
""" Return True if completions should be triggered at the given point. """
Expand Down

0 comments on commit 198bcd5

Please sign in to comment.