decorator and base class can sometimes be not selected at all! argument inside decorators can also not be selected unless we are already inside the decorator, dedicated subindexing commands work!
Response To Command
[x] the command fails/nothing happens at all
[ ] the command select/operates on a wrong result,
[ ] that did not match your positional description (e.g. grabs an ROI one line above or below the one you wanted)
[ ] did not match the type of result you are looking for(e.g. you wanted an assertion message but you got assertion condition)
[ ] or maybe the result was of the correct type and position but it was selected improperly(e.g. you asked for the parameter list of function but the last parameter was not selected)
[ ] or maybe things are working fine when trying to select a region as a whole but start breaking when you try access smaller pieces of it
[ ] or perhaps the command did find the correct result but perhaps the alternatives included regions they should not or vice versa. (for instance because the command searched the entire code instead of just the current function or vice versa)
[ ] somehow the whole preserving the current state(alternatives,origin,initial_origin and so on) was messed up by the command! For instance,
[ ] track was lost of initial originand things were pasted back onto the wrong position
[ ] alternatives were changed when they were supposed not to!(for instance prefix operations are not supposed to do this)
[ ] the command seems to select/operates on a random result
[ ] the command has some other unintended behavior
Context In Which It Appears
Does the problem seem to appear or disappear only some of the time? Does there seem to be
[x] spatial context/correlation with the cursor? for instance
[x] is it affected by adjustments to the cursor position?()
[ ] does it make a difference whether you have selected some text or not?
[ ] does the problem appear only when you're going in one direction?
[ ] does it have to only do with multiple cursors?
[ ] or perhaps when switching back-and-forth between single and multiple cursors?
[ ] a temporal context?
[ ] does it appear only right after selection query was executed?
[ ] does it appear only if no one other selection query was executed since the last edit?
[ ] does it appear only after executing an operation(paste,delete,swap)?
[ ] does it appear when you perform manual editing between commands?
[x] correlation with a pattern in the code? Such a pattern might be structural, sometimes lexical,in some cases even some piece of incomplete code that was not handled properly. A strong indicator for such a case when introducing small changes to the code has things from working perfectly into breaking. In case you have identified(or you have any suspicion about) this pattern(or maybe patterns), does the error occure when it appears
[ ] on the target of the query? (For instance there was a bug at some point that sometimes prevented you from selecting arguments from function calls inside with statements)
[ ] on the origin of the query?
[ ] in between them perhaps?
[x] somewhere inside to the current function/class/indentation block/...
@mark_as_snippet_grammar(big_big_stream = "beautiful")
class CppSnippetMoreExampleExperimental(MappingRule):
pronunciation = "sublime snippet"
mapping = {
"<snippet>":
R(Snippet("%(snippet)s")),
"<snippet_variants> [<n>]":
R(Snippet("%(snippet_variants)s")),
"<big_big_stream> <thing> [<n>] [with <delimiter>]":
R(Snippet(lambda stream,thing,n,delimiter:
stream[0] + stream[1].format(delimiter).join([thing(x) for x in range(1,n + 1)]) + stream[2]
,remap_data = {"big_big_stream":"stream"})
),
}
With a little bit of experimenting, it seems that removing the argument from the decorator has no effect where is removing the third dictionary value with the lambda solves the problem!
It should be noted, that for selecting the decorator or the base class positional description or point of origin seem to have no effect, whereas for argument queries, things are actually working if we are already within the function call! also dedicated sub index and commands work fine!
Error Message
[ ] error message appears in a pop-up
[x] an exception trace back is printed in the sublime console(Ctrl + `)
[ ] the command fails silently
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\application\application.py", line 76, in respond_to_query
s(view_information,query_description,extra)
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\queries\abstract\selection_query.py", line 80, in __call__
self.result ,self.alternatives = self.handle_single(view_information,query_description, extra)
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\queries\big_roi.py", line 30, in handle_single
return possibilities[f](view_information,query_description, extra)
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\queries\big_roi.py", line 171, in case_one
candidates = tiebreak_on_lca(definition_node,origin,find_all_nodes(definition_node, selector = selector))
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\library\traverse.py", line 31, in find_all_nodes
return sorted([node for node in reachable(root) if node_wanted(node) and hasattr(node,"first_token")],
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\library\traverse.py", line 31, in <listcomp>
return sorted([node for node in reachable(root) if node_wanted(node) and hasattr(node,"first_token")],
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\queries\big_roi.py", line 170, in <lambda>
selector = lambda x:match_node(x,targets,exclusions) and generic_fix(x,build[1])
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\library\info.py", line 1187, in generic_fix
fixer(root,atok)
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\library\info.py", line 1040, in fix_argument_list
if already_fixed(root) or fix_definition(root.parent,atok):
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\library\info.py", line 1078, in fix_definition
token = atok.find_token(token,tokenize.NAME,i.arg)
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\third_party\asttokens\asttokens.py", line 164, in find_token
while not match_token(t, tok_type, tok_str) and not token.ISEOF(t.type):
File "C:\Users\Admin\AppData\Roaming\Sublime Text 3\Packages\PythonVoiceCodingPlugin\third_party\asttokens\util.py", line 47, in match_token
return token.type == tok_type and (tok_str is None or token.string == tok_str)
AttributeError: 'NoneType' object has no attribute 'type'
Description
General Information
Plug-In Version: v0.1.2 , develop
Queries Affected
[x] Argument
[x] Big Roi
[ ] Sub Indexing
[ ] Operations
[ ] Collections
decorator
andbase class
can sometimes be not selected at all! argument inside decorators can also not be selected unless we are already inside the decorator, dedicated subindexing commands work!Response To Command
[x] the command fails/nothing happens at all
[ ] the command select/operates on a wrong result,
[ ] somehow the whole preserving the current state(alternatives,origin,initial_origin and so on) was messed up by the command! For instance,
[ ] the command seems to select/operates on a random result
[ ] the command has some other unintended behavior
Context In Which It Appears
Does the problem seem to appear or disappear only some of the time? Does there seem to be
[x] spatial context/correlation with the cursor? for instance
[ ] a temporal context?
[x] correlation with a pattern in the code? Such a pattern might be structural, sometimes lexical,in some cases even some piece of incomplete code that was not handled properly. A strong indicator for such a case when introducing small changes to the code has things from working perfectly into breaking. In case you have identified(or you have any suspicion about) this pattern(or maybe patterns), does the error occure when it appears
code snippet when things are working
Code snippet where things are not working
With a little bit of experimenting, it seems that removing the argument from the decorator has no effect where is removing the third dictionary value with the lambda solves the problem!
It should be noted, that for selecting the decorator or the base class positional description or point of origin seem to have no effect, whereas for argument queries, things are actually working if we are already within the function call! also dedicated sub index and commands work fine!
Error Message
[ ] error message appears in a pop-up
[x] an exception trace back is printed in the sublime console(Ctrl + `)
[ ] the command fails silently