Skip to content

Commit

Permalink
Pythonise 'assign'
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiaFregola committed Jul 29, 2023
1 parent 55ec7d4 commit 9c49149
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/language-python/src/nodes/python_assignment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const PYTHON_ASSIGNMENT = 'PYTHON_ASSIGNMENT'
class AssignmentGenerator implements SuggestionGenerator {
constantSuggestions(): SuggestedNode[] {
const sampleNode = new PythonAssignment(null)
const suggestedNode = new SuggestedNode(sampleNode, 'assign', '= assign set', true, 'assign a value to a variable')
const suggestedNode = new SuggestedNode(sampleNode, 'assign', '= assign set', true, 'Assign a value to a variable')
return [suggestedNode]
}

Expand All @@ -52,7 +52,7 @@ class AssignmentGenerator implements SuggestionGenerator {
identifier + '=',
'= assign set',
true,
'assign a value to a variable'
'Assign a value to a variable'
)
return [suggestedNode]
}
Expand Down Expand Up @@ -91,7 +91,7 @@ export class AssignmentWrapGenerator implements SuggestionGenerator {
const node = new PythonAssignment(null)
const suggestedNode = new SuggestedNode(
node,
'assign',
'',
'= assign set',
true,
'assign this expression to a variable'
Expand All @@ -118,7 +118,7 @@ export class AssignmentWrapGenerator implements SuggestionGenerator {
identifier + '=',
'= assign set',
true,
'assign a value to a variable'
'Assign a value to a variable'
)
suggestedNode.setOverrideLocation(grandParent.getStatement(), 0, 'right')
return [suggestedNode]
Expand Down Expand Up @@ -264,8 +264,8 @@ export class PythonAssignment extends PythonNode {
right: NodeCategory.PythonExpression,
}
typeRegistration.layout = new NodeLayout(HighlightColorCategory.VARIABLE_DECLARATION, [
new LayoutComponent(LayoutComponentType.KEYWORD, 'assign'),
new LayoutComponent(LayoutComponentType.CHILD_SET_TOKEN_LIST, 'left', ['variable']),
new LayoutComponent(LayoutComponentType.KEYWORD, ''),
new LayoutComponent(LayoutComponentType.CHILD_SET_TOKEN_LIST, 'left', ['variable name']),
new LayoutComponent(LayoutComponentType.KEYWORD, '='),
new LayoutComponent(LayoutComponentType.CHILD_SET_ATTACH_RIGHT, 'right', ['value']),
])
Expand Down

0 comments on commit 9c49149

Please sign in to comment.