Added function for selectLeadingSpaces, fixed bug which was reporting the wrong line number on some functions, added window focusing to most of the functions
Added Senior Design Day Spring 2022 suggestion of selecting the leading whitespace characters. Had to refactor getLeadingWhitespace to include a helper function. Also added imports for vscode. Finally shifted helper functions together and added comments.
Name improvements:
- runLineContext changed to "Get Line Scope".
- runCursorContext changed to "Get Words Under Cursor".
New tokens:
- STATEMENT: Replaces INDENT. Stores entire line of python statement, not including comments, in attr.
- COMMENT: Stores entire comment line in attr.
- INVALID: Invalid token, used when parser can't figure out a line. Should never be seen.
New behavior:
- Get Line Scope now reads out the comment your cursor is in.
- Implemented fractional indentation notifications (disabled)
Added new logic to pl.Lexer to find number of leading spaces by either arithmetic or by finding the index position of the first non-whitespace character. Also added a boolean flag to switch easily between the two methods using ternary logic. Added comments explaining functionality. Fixed code spacing to be more uniform in style.
Added an alternative method for calculating the leading spaces instead of taking the index of the first non-whitespace character. Leaving it commented out, but still there as an alternative in-case something goes wrong w/ the index method.
added helper function fetchLineNumber(editor) to return the line number that the cursor is on and refactored the code to make use of this helper function in various places. Also added function getLineNumber() which will output the current line number the cursor is on.
Further separate commands so that each category of command is in it's
own file. The goal is to keep the number of callbacks defined for each
command to a reasonable amount per file.