LS: smart indentation

Implementation of smart indentation that uses new syntax trees
Should be in parser.ts. I feel it is of sufficiently general utility