Abstract

The object of research in the paper is a built-in refactoring mechanism in the Swift programming language. Swift has gained a lot of popularity recently, which is why there are many new challenges associated with the need to support and modify the source code written in this programming language. The problem is that the more powerful refactoring mechanism that can be applied to Swift is proprietary and cannot be used by other software. Moreover, even closed-source refactoring software tools are not capable of performing more complex queries. To explore the possibilities of expanding the built-in refactoring, it is suggested to investigate the software implementation of the sourcekit component of the Swift programming language, which is responsible for working with «raw» source code, and to implement new refactoring action in practice. To implement the research plan, one refactoring activity that was not present in the refactoring utilities (adding an implementation of the Equatable protocol) was chosen. Its implementation was developed using the components and resources provided within the sourcekit component. To check the correctness and compliance with the development conditions, several tests were created and conducted. It has been discovered that both refactoring mechanisms supported by the Swift programming language have a limited context and a limited scope and application. That is why the possibility of expanding the functionality should not be based on the local level of code processing, but on the upper level, where it is possible to combine several source files, which often happens in projects. The work was directed to the development of the own refactoring action to analyze and obtain a perfect representation of the advantages and disadvantages of the existing component. As a result, a new approach to refactoring was proposed, which will allow solving the problems described above.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call