From 6ad8dc2ce125a8673ad5916cef5929d15c6b4262 Mon Sep 17 00:00:00 2001 From: Iristyle Date: Mon, 15 Apr 2013 08:28:35 -0400 Subject: [PATCH] chore(ST2.WebPackages): bump CoffeeComplete --- .../CoffeeComplete Plus.sublime-settings | 8 +--- .../README.md | 40 +++++++++++-------- .../coffee_utils.py | 6 +-- .../package-metadata.json | 2 +- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/CoffeeComplete Plus.sublime-settings b/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/CoffeeComplete Plus.sublime-settings index da7c7a0..9727ee7 100644 --- a/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/CoffeeComplete Plus.sublime-settings +++ b/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/CoffeeComplete Plus.sublime-settings @@ -40,11 +40,5 @@ // OBSOLETE // Aliases for "this", like "that" and "self". // CA+ assignment detection is now able to detect that = this assignments. - "coffee_autocomplete_plus_this_aliases": ["that", "self"], - - // The triggers for autocompletion - "auto_complete_triggers": - [ - {"characters": ".@", "selector": "source.coffee, source.litcoffee, source.coffee.md"} - ] + "coffee_autocomplete_plus_this_aliases": ["that", "self"] } \ No newline at end of file diff --git a/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/README.md b/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/README.md index 0343c13..ca5ff42 100644 --- a/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/README.md +++ b/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/README.md @@ -33,9 +33,11 @@ Usage ### Autocomplete -Autocomplete can be triggered in coffee files by typing the dot `.` operator or the `@` symbol (which is shorthand for `this`). You can also press `ctrl+space` to trigger autocompletions manually. The plugin will then try to figure out what you're doing and propose a list of suggestions. +Autocomplete can be triggered in coffee files by typing the dot `.` operator or the `@` symbol (which is shorthand for `this`) and then by pressing `ctrl+space`. The plugin will then try to figure out what you're doing and propose a list of suggestions. -Example usage: Inside a class, you type `this.`. A list of the available methods and properties is presented. +It is also possible to configure Sublime Text to trigger autocomplete automatically, without having to press `ctrl+space`. This is not part of the plugin as there may be other triggers from other plugins that might be overwritten, but it's easy to add! See [Customizing Autocomplete Trigger](#customizing-autocomplete-trigger) for how to do this. + +Example usage: Inside a class, you type `this.` and press `ctrl+space`. A list of the available methods and properties is presented. ### Goto Definition @@ -267,7 +269,26 @@ Configuration CoffeeComplete Plus has the following configurable settings: -### General Settings +### User Settings + +These settings are accessible via `Preferences -> Settings — User`. + +#### Customizing Autocomplete Trigger + +* `auto_complete_triggers` — Characters that trigger the autocomplete menu. + + - Sublime allows for context-specific triggers for the autocompletion menus. This allows the menu to show as soon as `.` or `@` are pressed. To add triggers for CoffeeScript autocompletions, open `Preferences -> Settings — User` and use the following to make the desired changes: + +``` + "auto_complete_triggers": + [ + {"characters": ".@", "selector": "source.coffee, source.litcoffee, source.coffee.md"} + ] +``` + + - Note that other `auto_complete_triggers` settings may be present in `Preferences -> Settings — Default`. If this is the case, simply copy the `auto_complete_triggers` from the default file into your user settings, add a comma inside the square brackets, and paste the curly brace section above. + +### General CoffeeComplete Settings In `CoffeeComplete Plus.sublime-settings`: @@ -304,19 +325,6 @@ In `CoffeeComplete Plus.sublime-settings`: "coffee_autocomplete_plus_member_exclusion_regexes": ["^_"] // Excludes members prefixed with underscore ``` -#### Customizing Autocomplete Trigger - -* `auto_complete_triggers` — Characters that trigger the autocomplete menu. - - - Sublime allows for context-specific triggers for the autocompletion menus. This allows the menu to show as soon as `.` or `@` are pressed, which are enabled by default. To customize these, use the following in settings and make the desired changes: - -``` - "auto_complete_triggers": - [ - {"characters": ".@", "selector": "source.coffee"} - ] -``` - #### Aliases For `this` * `coffee_autocomplete_plus_this_aliases` — Aliases for `this` keyword diff --git a/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/coffee_utils.py b/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/coffee_utils.py index 9493f89..7ecb524 100644 --- a/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/coffee_utils.py +++ b/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/coffee_utils.py @@ -28,7 +28,7 @@ FUNCTION_RETURN_TYPE_FUNCTION_NAMES_KEY = "function_names" COFFEESCRIPT_SYNTAX = r"CoffeeScript" COFFEE_EXTENSION_WITH_DOT = "\.coffee|\.litcoffee|\.coffee\.md" -CONSTRUCTOR_KEYWORD = "constructor" +CONSTRUCTOR_KEYWORDS = ["constructor", "initialize", "init"] THIS_SUGAR_SYMBOL = "@" THIS_KEYWORD = "this" PERIOD_OPERATOR = "." @@ -55,7 +55,7 @@ PARAM_REGEX = r"\(\s*(({name})|({name}\s*=?.*?[,].*?)|(.*?[,]\s*{name}\s*=?.*?[, # Regex for finding a variable declared in a for loop. FOR_LOOP_REGEX = r"for\s*.*?[^a-zA-Z0-9_$]%s[^a-zA-Z0-9_$]" # Regex for constructor @ params, used for type hinting. -CONSTRUCTOR_SELF_ASSIGNMENT_PARAM_REGEX = r"constructor\s*[:]\s*\(\s*((@{name})|(@{name}\s*[,].*?)|(.*?[,]\s*@{name}\s*[,].*?)|(.*?[,]\s*@{name}))\s*\)\s*[=\-]>\s*$" +CONSTRUCTOR_SELF_ASSIGNMENT_PARAM_REGEX = r"(?:(?:constructor)|(?:initialize)|(?:init))\s*[:]\s*\(\s*((@{name})|(@{name}\s*[,].*?)|(.*?[,]\s*@{name}\s*[,].*?)|(.*?[,]\s*@{name}))\s*\)\s*[=\-]>\s*$" # Assignment with the value it's being assigned to. Matches: # blah = new Dinosaur() @@ -901,7 +901,7 @@ def collect_instance_completions_from_file(file_lines, class_name, is_inherited, function_name = match.group(2) function_args_string = match.group(5) if show_private or not is_member_excluded(function_name, member_exclusion_regexes): - if function_name != CONSTRUCTOR_KEYWORD: + if not function_name in CONSTRUCTOR_KEYWORDS: function_args_list = [] if function_args_string: function_args_list = function_args_string.split(",") diff --git a/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/package-metadata.json b/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/package-metadata.json index 6edb4ef..92c9844 100644 --- a/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/package-metadata.json +++ b/EthanBrown.SublimeText2.WebPackages/tools/PackageCache/CoffeeComplete Plus (Autocompletion)/package-metadata.json @@ -1 +1 @@ -{"url": "https://github.com/justinmahar/SublimeCSAutocompletePlus", "version": "2013.03.20.10.00.10", "description": "CoffeeScript autocompletions and more!"} \ No newline at end of file +{"url": "https://github.com/justinmahar/SublimeCSAutocompletePlus", "version": "2013.04.05.11.19.57", "description": "CoffeeScript autocompletions and more!"} \ No newline at end of file