TypeScript Refactorings

Heilmann, Giovanni and Thanabalasingam, Arooran (2018) TypeScript Refactorings. Bachelor thesis, HSR Hochschule für Technik Rapperswil.

[thumbnail of HS 2018 2019-BA-EP-THANABALASINGAM-Heilmann-TypeScript Refactorings.pdf]
Preview
Text
HS 2018 2019-BA-EP-THANABALASINGAM-Heilmann-TypeScript Refactorings.pdf - Supplemental Material

Download (1MB) | Preview

Abstract

Visual Studio Code is a text editor written in TypeScript, which is a superset of JavaScript with strong typing. Language support and other features can be added via extensions. Both TypeScript and VS Code are open-source and maintained by Microsoft. The current TypeScript implementation has in-built language features like auto-complete, reference lookup, etc. Two such features are refactorings and quick-fixes. Refactorings are behavior-preserving code changes that make code clearer and more maintainable. Quick-fixes are code changes that change external behavior. They fix mistakes or extend existing behavior.
Currently, VS Code lacks a lot of the basic refactorings and quick-fixes for TypeScript like inline variable or inline function. Some of the few refactorings it supports, are Extract symbol and Move to new file. The goal of this bachelor thesis is to contribute some of the missing refactorings and quick-fixes to the TypeScript repository.
In total, four refactorings have been implemented. First, Inline local replaces one or all references of a local variable with its value. Inline function is similar to the first, but it inlines a function declaration. Third, Convert lambda to function converts an arrow function to a function or vice-versa without changing external behavior. Lastly, Convert string concatenation to template literal converts a concatenated string like "hello "+ world to a template literal like ‘hello ${world}‘ . Furthermore, one quick-fix named Interface stubbing has also been implemented. It implements missing object literal properties similar to how method stubs can be created for classes that do not correctly implement an interface. At the time of writing this document, the pull-request for Convert lambda to function has been reviewed and approved by Microsoft.

Item Type: Thesis (Bachelor)
Subjects: Topics > Software > Refactoring
Technologies > Programming Languages > Java Script
Brands > Microsoft
Divisions: Bachelor of Science FHO in Informatik > Bachelor Thesis
Depositing User: OST Deposit User
Contributors:
Contribution
Name
Email
Thesis advisor
Corbat, Thomas
UNSPECIFIED
Thesis advisor
Morgner, Felix
UNSPECIFIED
Date Deposited: 26 Mar 2019 06:45
Last Modified: 26 Mar 2019 06:45
URI: https://eprints.ost.ch/id/eprint/728

Actions (login required)

View Item
View Item