Giter Club home page Giter Club logo

packagedev's Introduction

PackageDev - The Sublime Text Meta Package

PackageDev provides syntax highlighting and other helpful utility for Sublime Text resource files.

Resource files are ways of configuring the Sublime Text text editor to various extends, including but not limited to: custom syntax definitions, context menus (and the main menu), and key bindings.

Thus, this package is ideal for package developers, but even normal users of Sublime Text who want to configure it to their liking should find it very useful.

Installation

Install the package using Package Control. The package's name is PackageDev.

PackageDev was made for Sublime Text 3. An older unmaintained version can still be installed for Sublime Text 2, however.

Getting Started

Syntax highlighting for various resource files is available immediately.

Various commands, for example creating a new resource, are made available through the command palette (Primary+Shift+P) with the "PackageDev:" prefix and in the main menu under Tools → Packages → Package Development,

Note: The Primary key refers to Ctrl on Windows and Linux and Command () on macOS.

Documentation

Detailed documentation is available at the repository's wiki.

Features Overview

  • Syntax definitions for:

    • Build System files
    • Color Scheme files
    • Commands files
    • Completions files
    • Keymap files
    • Macro files
    • Menu files
    • Mousemap files
    • Project files
    • Settings files
    • Snippet files
    • Syntax definition files (both Sublime Text and TextMate)
    • TextMate Preferences (.tmPreferences)
  • Static and dynamic completions for all the above, where sensible.

    Dynamic completions are provided for all files expecting command names, syntax definitions, color schemes, and settings files.

  • Snippets for some of the above.

    In files holding multiple "entries", snippets are available with the trigger e and ee for a short and a long entry, respectively.

  • Commands to create (or open) a package and various resource files with standard templates.

  • Checking for unknown settings keys.

  • Hover popups for setting keys with a description and their default value.

  • And more!

packagedev's People

Contributors

amjadhd avatar calculuswhiz avatar deathaxe avatar ehuss avatar fichtefoll avatar fjl avatar guillermooo avatar jfcherng avatar jrappen avatar keith-hall avatar mataha avatar mattdmo avatar r-stein avatar ratijas avatar rchl avatar seancodes avatar sspkmnd avatar thom1729 avatar ultra-instinct-05 avatar vmuriart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

packagedev's Issues

AAAPackageDev does not resolve symlinks correctly when adding Lib directory to sys.path

I have set up my package directories to sync across my computers by setting up symlinks in my sublime directory which relocate my Packages, Pristine Packages and Installed Packages directories into my dropbox folder.

Upon installing AAAPackageDev all of the menu options under Tools > Packages > Package Development are grated out. Inspecting the sublime console reveals the following messages:

Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/AAA.py
[AAAPackageDev] Added sublime_lib to sys.path.
Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/build_sys_dev.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./build_sys_dev.py", line 6, in <module>
    from sublime_lib.path import root_at_packages
ImportError: No module named sublime_lib.path
Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/commands_file_dev.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./commands_file_dev.py", line 6, in <module>
    from sublime_lib import path
ImportError: No module named sublime_lib
Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/completions_dev.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./completions_dev.py", line 6, in <module>
    from sublime_lib.path import root_at_packages
ImportError: No module named sublime_lib.path
Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/file_conversion.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./file_conversion.py", line 6, in <module>
    from sublime_lib import WindowAndTextCommand
ImportError: No module named sublime_lib
Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/package_dev.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./package_dev.py", line 8, in <module>
    from sublime_lib.path import root_at_packages
ImportError: No module named sublime_lib.path
Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/scope_data.py
Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/settings_dev.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./settings_dev.py", line 6, in <module>
    from sublime_lib.path import root_at_packages
ImportError: No module named sublime_lib.path
Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/setup.py
Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/snippet_dev.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./snippet_dev.py", line 4, in <module>
    from sublime_lib.view import has_file_ext
ImportError: No module named sublime_lib.view
Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/sublime_inspect.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./sublime_inspect.py", line 3, in <module>
    import sublime_lib
ImportError: No module named sublime_lib
Reloading plugin /Users/dancowell/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/syntax_def_dev.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./syntax_def_dev.py", line 5, in <module>
    import yaml
ImportError: No module named yaml

Executing "sys.path" in the console reveals:

'/Users/dancowell/Library/Application Support/Sublime Text 2/Packages/Users/dancowell/Dropbox/Settings/Sublime Text 2/Packages/AAAPackageDev/Lib'

The correct path (which other plugins are resolving) is:

'Users/dancowell/Dropbox/Settings/Sublime Text 2/Packages/AAAPackageDev/Lib'

OS: OSX 10.9 (Mavericks)
Sublime Text: 2.0.2
AAAPackageDev: 2013.09.18.14.57.14

Perform data type checks before conversion

This syntax looks mostly right and builds fine using AAAPackageDev.

# [PackageDev] target_format: plist, ext: tmLanguage

---
name: MySyntax
fileTypes: [txt]
scopeName: text.mysyntax
uuid: 7ce133ea-e34b-47d9-a03c-341293337c88

patterns:
    name: keyword.mysyntax
    match: (.*)

But when loaded in ST3, it gives this obscure error:

Error loading syntax file "Packages/Sublime-Text-3-CSV-Plugin/AdvancedCSV.tmLanguage": boost::bad_any_cast: failed conversion using boost::any_cast

The issue is the missing - before the name keyword in patterns. The plist is generated without an <array> node enclosing the patterns, leading to the obscure error message.

Would it be possible to validate the YAML for proper structure when compiling tmLanguage files?

error handling in json-to-plist for regexp escaping errors

I'm a total sublime and python n00b, but I just had an interesting adventure with building a tmlanguage plist from json with AAAPackageDev.

My json file contained the following line:

{ "match": "\b(N|S)" }

This apparently parses correctly as json, but throws an exception in the plist writer ("strings can't contains control characters; use plistlib.Data instead'). Unfortunately, that exception wasn't being handled/displayed/etc anywhere. the plist writer was silently failing and leaving my plist file half-written (it aborts as soon as it gets to that key-value pair)

There might be an easier way to troubleshoot this, but I wound up modifying syntax_def_dev.py to put a try..except self.output_view.insert() around the plistlib.writePlist call in order to find out what was going wrong. As it turns out, I just needed more string escaping ("\b" instead of "\b").

I'm sure there is a clean, elegant, pythonesque way to handle this particular type of user error on my part, but I have no idea what it is. Just figured I'd let you know about my experience :)

Cheers.

AAAPackageDev causes ST2 Traceback with Command Palette

Having console open and calling up the Command Palette results in:

Traceback (most recent call last):
  File ".\sublime_plugin.py", line 272, in is_enabled_
  File ".\syntax_def_dev.py", line 70, in is_enabled
  File ".\syntax_def_dev.py", line 73, in get_file_ext
TypeError: expected string or buffer

It's failing on the empty file in tests. The question is whether this is a fault of AAAPackageDev or whether ST2 is at fault. Since the file is empty in the repo, I guess I better log it here. It seems ST2 scans for this file in packages and expects something.

More build configuration options – making grammar packages work with Atom

I'm trying to make my Sublime package work with Atom, which should be a fairly straightforward thing as Atom takes the exact same JSON format as I got generated by AAAPackageDev to avoid having to edit the XML directly.

The only problem is, Atom expects the extension to be .json, however if I rename the file (from .JSON-tmLanguage) then the build system will generate a .plist instead of .tmLanguage.

I can make it work by adding the override comment as instructed by the readme, but then I'm left with an invalid JSON file which Atom will choke on.

I guess there are many ways to make it work, but wanted to put the use case forward and see if maybe you have something in mind already which could address it?

[PackageDev] File conversion unsuccessful. (yaml -> plist) but conversion was success

I'm using your package to develop syntax highlighting, and when i convert yaml to plist using build system of the package it puts that message to Sublime console

[PackageDev] File conversion unsuccessful. (yaml -> plist)

but conversion was success. Then I find out in the package source following line of code which can produce that message I think.

https://github.com/SublimeText/AAAPackageDev/blob/b1e61d9c404d101c86aef0744d5c3b7a773c684a/file_conversion.py#L242-L243

So, is it feature of the package to print unsuccess message when convertion was success?

auto_complete_trigger missing quote in README

In the README the section for the auto_complete_triggers has the following currently:

{ characters": ".", "selector": "source.yaml-tmlanguage - comment" }

It should be:

{ "characters": ".", "selector": "source.yaml-tmlanguage - comment" }

Poor Comment Support in Json Settings Files

It seems this plugin has very poor, and inconsistent support for comments.

sublime-settings have support for single line comments, but not support for block comments. sublime-commands shows comments as invalid. I have not gone further than these two.

Also, there seems to be no Comments.tmPreferences file to allow support for commenting out lines via "ctrl+/".

A comments.tmPreferences file is pretty easy to add. The one from the javascript package can literally be used in this package since all of these settings files are just json; all it would require is targeted source.sublimecommands and source.sublime-settings. A matter of fact, the comment syntax highlighting can literally be taken from the JSON.tmLanguage file in ST2 and placed in the tmLanguages for all these json type settings files. I think support for comments can fairly easily be added, yet it hasn't which brings up the question of why?

It seems that this package is meant to make plugin and package development easier, but leaving out support like this seems to be counter-productive.

Is there a reason comment support was left out that I just haven't though of?

make_tmlanguage.py fails under latest python (3.2)

I had to change the except line and the print line to get it to run (Note, this is my first time using python ;)

except ValueError as e:

print("Writing tmLanguage... (%s)" % target)

import json
import plistlib
import os
import sys

def make_tmlanguage_grammar(json_grammar):
path, fname = os.path.split(json_grammar)
grammar_name, ext = os.path.splitext(fname)

try:
    with open(json_grammar) as grammar_in_json:
        tmlanguage = json.load(grammar_in_json)
except ValueError as e:
    # Avoid DeprecationWarning by not calling e.message.
    sys.stderr.write("Error: '%s' %s" % (json_grammar, str(e)))
else:
    target = os.path.join(path, grammar_name + '.tmLanguage')
    print("Writing tmLanguage... (%s)" % target)
    plistlib.writePlist(tmlanguage, target)

if name == 'main':
path = sys.argv[1]
make_tmlanguage_grammar(path)

xml.sax._exceptions.SAXReaderNotAvailable: No parsers found

I am unable to convert a plist to yaml using your plugin. 'Convert to YAML and Rearrange Syntax Definition' outputs the following:

Input type not specified, auto-detecting... Property List

Parsing Property List... (/home/matt/.config/sublime-text-2/Packages/Fruity/Fruity.tmLanguage)

No other messages appear anywhere, nothing happens.

Support Sublime Text 3

Do you have a road map when AAAPackageDev will be work for Sublime Text 3 and will be accessible in Package Control?

Rename to "PackageDev"

Apart from adding several stuff to the path (yaml, ordereddict and sublime_lib), there is no reason for the package to start with the obnoxious "AAA" to make it load earlier.

Since nobody uses these anyway, besides me for local package dev I guess and I can always switch back to from PackageDev import yaml if I need to, we should be safe to remove that "functionality" in the near future.

I don't feel like doing that now though, just adding an issue.

Can I unbuild a tmLanguage file to YAML-tmLanguage?

The readme explains how to build a tmLanguage from YAML-tmLanguage. Is it possible to do the reverse, ie. unbuild the tmLanguage file?

I want to write a syntax highlighting based on XML.tmLanguage, but the json format is really tedious, so I'd rather work with a yaml version.

Can't highlight multiple lines and ?si issue

Hi there, first thanks for creating this tool, it's super useful. I am trying to write a syntax package for myself, here is the tmLanguage file: https://gist.github.com/a01379aa77c176df409b.git, but for some reason, I can't do highlighting on multiple lines. I am having issue with the section has the comment "kz part on select * from xxx"

If you use this package on this line:
SELECT *
FROM all_KZ
LIMIT 10;

You will see that the table name after "FROM" is not highlighted as I wanted as "entity.name.function.pgsql," is this an issue for the package or am I doing something wrong? I tried to use "\n","\r\n" to replace "\s", but still didn't work...then I tried to change:

(?i:^\s*(select)\s+(\*)\s+(from)\s+([a-zA-Z+\_]+)\s+(limit)\s+(\d+))

to

(?si:^\s*(select)\s+(\*)\s+(from)\s+([a-zA-Z+\_]+)\s+(limit)\s+(\d+))

so that I can use "." to represent new line symbol, but then Sublime keep saying there is an error and won't let me do it...

Thank you so much!

Json to tmLanguage not working

Hi, I'm doing everything as explained in README but it doesn't work.

Creating a New Syntax Definition
Create new template (through Tools | Packages | Package Development) or the Command Palette
Select Json to tmLanguage build system from Tools | Build System
Press F7

Build just doesn't work, I don't get any information from Sublime Text: no popups, no message in status bar, nothing.
Sublime version 2163, Mac OS X 10.7.2.

New Syntax Definition Compile Error

I am running v2.0.2 on Ubuntu 12.04 fully updated.

Following issue #19 I have the enhanced version installed so that "new syntax definition" is not greyed out.

I get the following error when trying to convert my file from JSON.

OpenSCAD.JSON-tmLanguage:

// [PackageDev] target_format: plist, ext: tmLanguage
    { "name": "OpenSCAD",
  "scopeName": "source.scad",
  "fileTypes": ["scad"],
  "uuid": "837e26cc-44e6-49bb-9011-9d145939c930",

  "patterns": [

  ]
}

ERROR:

error: Error trying to parse build system: No data in ~/.config/sublime-text-2/Packages/AAAPackageDev/Support/JSON to Property List.sublime-build:1:1

I would like to have .scad files auto recognized so I can add auto completion. Where should the tmLanguage and sublime-completions files live? I currently have them in "~/.config/sublime-text-2/Packages/OpenSCAD"

syntax highlight with newline

I have the following code:


 comment: general eolian class
  begin: (class|mixin|interface|abstract) ([A-Za-z0-9._]+)[ \n]*[\(]*[[A-Za-z0-9._]+, \n]+[\)]*[ \n]*\{
  beginCaptures:
      '1': {name: "keyword.other"}
  end: \}
  patterns:
  - include: '#methods_block'
  - include: '#implements'
  - include: '#events'
  - include: '#comments'

I can enter as many " " as I want, but no newline between class(..) and {
Is the rule wrong here ? or is this a bug?

Cannot format regex into multiline.

I have to add a regex that matches dozens of keywords like this:

\b(my|keyword)\b

In order to make it maintainable, I want to split it into multiline like this:

\b(
    my|
    keyword
)\b

To do this I have tried:

match: >
   \b(
   my|
   keyword
   )\b

But after conversation, it adds spaces to around my| and keyword.

SAXReaderNotAvailable: No parsers found when converting PList

When trying to convert an existing PList to YAML format, I get the following traceback:

[AAAPackageDev] Using plist_parser
Traceback (most recent call last):
  File "./file_conversion.py", line 186, in on_select
  File "./file_conversion.py", line 210, in run
  File "./fileconv/loaders.py", line 277, in load
  File "./fileconv/loaders.py", line 351, in parse
  File "/home/paul/.config/sublime-text-2/Packages/AAAPackageDev/Lib/plist_parser.py", line 303, in parse_string
    return XmlPropertyListParser().parse(io_or_string)
  File "/home/paul/.config/sublime-text-2/Packages/AAAPackageDev/Lib/plist_parser.py", line 297, in parse
    return self._parse_using_sax_parser(xml_input)
  File "/home/paul/.config/sublime-text-2/Packages/AAAPackageDev/Lib/plist_parser.py", line 274, in _parse_using_sax_parser
    reader = make_parser()
  File ".\xml\sax\__init__.py", line 93, in make_parser
xml.sax._exceptions.SAXReaderNotAvailable: No parsers found

Interestingly, when I tried to convert to JSON to see if that makes a difference, I get this instead:

[AAAPackageDev] Using plist_parser
Traceback (most recent call last):
  File "./file_conversion.py", line 186, in on_select
  File "./file_conversion.py", line 210, in run
  File "./fileconv/loaders.py", line 277, in load
  File "./fileconv/loaders.py", line 351, in parse
  File "/home/paul/.config/sublime-text-2/Packages/AAAPackageDev/Lib/plist_parser.py", line 303, in parse_string
    return XmlPropertyListParser().parse(io_or_string)
  File "/home/paul/.config/sublime-text-2/Packages/AAAPackageDev/Lib/plist_parser.py", line 294, in parse
    return self._parse_using_etree(xml_input)
  File "/home/paul/.config/sublime-text-2/Packages/AAAPackageDev/Lib/plist_parser.py", line 253, in _parse_using_etree
    for action, element in parser:
  File "<string>", line 58, in __iter__
RuntimeError: cannot load dispatch table from pyexpat

Both problems seem to be related to Python 2.6 not being installed on this system.

Transition to Python 3

@FichteFoll How do you want to deal with this?

I've got no experience in maintaining Python 2.0/3.0 compatible projects, so any ideas/suggestions?

Can we simply have a branch for each and let PC handle it?

I will probably do the same as for other projects of mine and put up files to download somewhere else too, but that's secondary and shouldn't affect the general approach.

target json_to_plist not working on ubuntu

The target json_to_plist is not found when trying to convert JSON-tmLanguage to xml.

  • Console: Unable to find target command: json_to_plist
  • Menu: Tools > Packages > Package development > New Syntax definition {, from Buffer} are in grey.

I tried a fresh install of the packages directory. And same error.

The error occurs only on ubuntu 12.10, with the same project it works on windows and mac os X.
Is there a way to activate verbose so I can track potential errors, such as missing python libraries or error in the plugin load? I don't see any from console.

New Package does not work

When I try to do Tools | Packages | Package Developement | New Package... I get the following message in the console:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 526, in run_
    return self.run()
  File "package_dev in C:\Users\Norbert\AppData\Roaming\Sublime Text 3\Installed Packages\AAAPackageDev.sublime-package", line 61, in run
TypeError: show_input_panel() missing 2 required positional arguments: 'on_change' and 'on_cancel'

distutils not found

Reloading plugin [...]\Packages\AAAPackageDev\setup.py
Traceback (most recent call last):
  File ".\sublime_plugin.py", line 62, in reload_plugin
  File ".\setup.py", line 9, in <module>
    from distutils import log, dir_util, dep_util, file_util, archive_util
ImportError: No module named distutils

Windows 7x64, ST2 Build: 2195
I don't know enough about distutils or this package's structure to fix this myself but I do think it is weird.
If it is not compatible with Windows, probably disable it.

Btw, this happens when loading.

Error 2 - The system cannot find the file specified.

Using Windows, trying to build blade.JSON-tmLanguage to XML.

From the console:
Running python D:\work\apps\sublimetext2\Data\Packages/AAAPackageDev/Support/make_tmlanguage.py D:\work\apps\sublimetext2\Data\Packages\User\Blade.JSON-tmLanguage

Popped up after F7 is hit:
[Error 2] The system cannot find the file specified
[Finished]

ST2 -- OSX (Mountain Lion) -- Error loading setup.py on startup, at line 588.

Reloading plugin /Users/HOME/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/setup.py
Traceback (most recent call last):
File "./sublime_plugin.py", line 62, in reload_plugin
File "./setup.py", line 588, in
url='http://sublimetext.info',
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 106, in setup
AttributeError: 'module' object has no attribute 'argv'

Also, the language setup template is not a plist format -- OSX uses the plist format. Perhaps the developer of this plugin could please add a template for language files using an OSX plist format.

New Package does not work

Files are missing

Traceback (most recent call last):
File "./package_dev.py", line 60, in on_done
File "./package_dev.py", line 115, in create_new
IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: u'/home/thierry/.config/sublime-text-2/Packages/AAAPackageDev/data/hgignore.txt'

Deprecate sublime_lib

I could imagine not many people are using it, including myself. It's just too much to ask users to install this package solely for a few helpers. If having a shared library for packages is a good idea, there must be a better way of implementing it.

So I propose deprecating the library and eventually dropping the aaa.py stuff altogether. The helpers sould remain visible for this package only.

One side-effect is also desirable: because we wouldn't need to gurantee that certain modules are always imported first, we could drop the AAA from the name.

Allow for parsing of .tmTheme files to YAML

I've gotten really used to using .YAML-tmLanguage files for editing or just analyzing language syntaxes, and I'd love to do the same with .tmTheme color scheme files as well. I've been using @facelessuser's ColorSchemeEditor for a while, and internally he parses the XML to JSON, but YAML is a lot more compact visually and I'd love to be able to do that with (AAA)PackageDev. I've started writing a .YAML-tmTheme syntax highlighting definition, based off of the .YAML-tmLanguage one, and since it'll be a lot less complicated it shouldn't take me too long.

I converted Neon to YAML last night, and found one thing that needs to be addressed so far:

  • The Command Palette item z:AAAPackageDev: Convert to YAML and rearrange syntax definition was duplicated and altered as follows:
{ "caption": "z:AAAPackageDev: Convert to YAML and Rearrange Color Scheme", "command": "convert_file", "args": {
    "target_format": "yaml",
    "ext": "YAML-tmTheme",
    "open_new_file": true,
    "rearrange_yaml_syntax_def": true
    }
}

but the auto-generated comment at the top of the file still said:

# [PackageDev] target_format: plist, ext: tmLanguage

even though the actual extension of the file was YAML-tmTheme.

So that needs to get fixed, I just haven't tracked it down yet. This doesn't look like it'll be too hard to implement, and I can even do most of the legwork myself. Please let me know your comments or questions. I'll submit a pull request when I'm ready!

Matt

Error loading syntax file

Not sure when it started but for a couple of weeks now everytime I start ST I get the following 4 error messages in both popup dialogs and in the console:

error: Error loading syntax file "Packages/AAAPackageDev/Support/Sublime Commands.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/AAAPackageDev/Support/Sublime Commands.tmLanguage"

error: Error loading syntax file "Packages/AAAPackageDev/Support/Sublime Completions.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/AAAPackageDev/Support/Sublime Completions.tmLanguage"

error: Error loading syntax file "Packages/AAAPackageDev/Support/Sublime Settings.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/AAAPackageDev/Support/Sublime Settings.tmLanguage"

error: Error loading syntax file "Packages/AAAPackageDev/Support/Sublime Key Map.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/AAAPackageDev/Support/Sublime Key Map.tmLanguage"

Unable to run "Convert To..." build

Fresh install of AAAPackageDev through Package Control:Install Package on OS X 10.10.1, Sublime 2.0.2 and Python 2.7.9.

Attempting to convert simple test.YAML-tmLanguage syntax definition to test.tmLanguage and getting following error in the when inspecting console:

Traceback (most recent call last):
  File "/Users/sergeym/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/Lib/sublime_lib/__init__.py", line 62, in run_
    self.typ.run_(self, *args)
  File "./sublime_plugin.py", line 339, in run_
  File "./file_conversion.py", line 128, in run
  File "/Users/sergeym/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/Lib/sublime_lib/view/output_panel.py", line 120, in __init__
    self.set_path(path, file_regex, line_regex)
  File "/Users/sergeym/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/Lib/sublime_lib/view/output_panel.py", line 131, in set_path
    self.set_regex(file_regex, line_regex)
  File "/Users/sergeym/Library/Application Support/Sublime Text 2/Packages/AAAPackageDev/Lib/sublime_lib/view/output_panel.py", line 155, in set_regex
    self.view.sel().add_all(sel)
Boost.Python.ArgumentError: Python argument types in
    RegionSet.add_all(RegionSet, list)
did not match C++ signature:
    add_all(SelectionSet {lvalue}, SelectionSet)

Have tried to search for the solution but couldn't find anything. Any help on the matter is appreciated.

Syntax highlighting issues

I recently converted the C Improved language into YAML using AAAPackageDev and found out some highlighting issues.
I'm reporting this because you mentioned you can't fix what you don't know.

And thanks for an amazing tool, buddy!

cimpyaml

Sublime Text Syntax Def (YAML) incorrectly handles brackets inside match string

- comment: foo
  name: foo2
  match: "\\["
- comment: bar
  name: bar2
  match: "."

the open bracket here causes the close quote to not be recognized, and the remainder of the file is stuck in the meta.value.yaml-tmlanguge string.regexp.set scopes. I think the problem is that meta.value.yaml-tmlanguage includes source.oniregexp which tries to parse the contents of the quotes as an oni regex, but it's actually got one more level of YAML string escapes on top of it. \\[ as a YAML string represents \[ as a regex which represents a literal [. The YAML escaping step seems to be skipped in the syntax recognition.

Split the conversion thing from PackageDev?

So, today as I was thinking about how I could get back at making this ST3-compatible I kinda questioned if this part of the plugin actually belongs to here. Here is what I ended up with:

  • AAAPackageDev is for modifying existing or templating configuration files for ST (syntax definitions, snippets ...)
  • There are several other plugins that ease the creation of configuration files for ST so they kinda clash with PackageDev itself (example: SaneSnippets)
  • PackageDev does not actually provide easy ways to edit all kinds of settings. Even though the "Convert to ..." build system supports any data file type, including tmPreferences, tmThemes ..., it officially only supports tmLanguage files because it's the only one with syntax highlighting.
  • PackageDev itself is a pretty huge package with many languages to handle
  • I think it would be easier to maintain the split packages (for me) because I would have direct access to the file conversion stuff

Thoughts?

FYI, I will try to integrate the complete package into ST2 and 3 as my next task.
Edit: ST2 and ST3 compatability is done. Just need to test a few things and create reasonable commits.

New Syntax Definition greyed out

The New Syntax Definition option referenced in the documentation for creating new syntax is grayed out always.

OS : GNU/Linux
Python2 version : 2.7.5
Python3 version : 3.3.2
Sublime-Text 2 Build 2217
AAAPackageDev : Installed from package control

Please let me know if I can provide further information.

Thanks

Support new sublime-build capabilities [enhancement]

Currently, when using the syntax definition for sublime-build files, the "variant" option is highlighted as invalid. Perhaps the syntax definition could use a little overhaul. Also, when using custom targets (and therefore custom options), those custom options are flagged as invalid too (which is probably wanted since otherwise having a special syntax definition for sublime-build would be kind of pointless). In the meantime, I'll just use the "Sublime Settings" syntax.

Keymap shows error if command before keys

Within a keymap file, if you have the "command" before the "keys", the end of the "keys" is marked as illegal:

{
  "command": "do_something",
  "keys": ["ctrl-q"]
}

Shows the "] \n}" as illegal, but:

{
  "keys": ["ctrl-q"],
  "command": "do_something"
}

shows it as valid.

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.