Giter VIP home page Giter VIP logo

ide-development's Introduction

Editor for IDELang

team: Kseniia Simanova and Mikhail Rodionychev

How to build and run

Run Main.kt file in your IDE or use this gradle command:

./gradlew run

Speeded-up video of editor

YAIDE.mp4

Technical decisions

Data structure used for text - gap buffer.

Editor supports lexical and semantic highlighting (errors). Highlightings are not incremental, and we are using just sorted list for their display.

Lexical analysis is implemented by finite automaton, syntax with recursive descent parser that builds Abstract Syntax Tree and semantic analysis with type inference is implemented with visitor pattern. Grammar rules for IDELang

Technical description

The editor utilizes files as Documents -- in-memory objects that contain the in-editor representation of a text file. This includes text stored as a text buffer (at the moment, we support trivial SimpleArrayTextBuffer and a bit more effective GapBuffer implementations) and a caret state. It also provides an interface to interact with the text.

On the backend, there is a VirtualFileSystem -- abstraction aiming to ease working with various filesystems. Unfortunately, it is not integrated in the project as much as we would like, but still it provides an interface to work with various types of files defined by VirtualFile interface: it creates, moves, copies, deletes, loads, and updates them. It also provides a WatchService to watch changes coming from the OS to notify user about them.

All events and some of the calculations happen in the background -- events are dispatched to the background thread using UiEventProcessor. Concurrency is implemented in a very schematic way: there is no correct usage of scopes yet and, unfortunately, exceptions coming from the background can blow something up.

The editor itself provides some of the common functionalities: file opening, file creation, editing, highlighting, several windows (controlled by OPENED_DOCUMENTS_LIMIT parameter in Constants). It also features lazy file explorer that updates when new files are added.

What can be easily added

Unfortunately, we did not add all the functionality we would like in time, but there is a skeleton that supports ( questionably) easy extension, at least for some features:

  • File management (create, delete, move, rename, ...): all operations are supported in the VFS, but not linked to the interface. As an example, there is a Create File option in the top menu.
  • Storing project info: it is quite easy to add some Project model functionality, at least to maintain, for example, state of editors, opened files, etc.
  • Performance: proper viewport, background processing improvements, advanced data structures can be added relatively simple, as the overall structure was built with this in mind.
  • IDE language features: with minor adjustments to the language services, we can add more advanced features, such as go-to definitions and refactoring.

IDELang specification

IDELang-specification.md

List of supported errors that may occur in code on IDELang

Supported-errors.md

ide-development's People

Contributors

retran avatar simkes avatar simkesst avatar taifin avatar

Stargazers

 avatar

Forkers

taifin

ide-development's Issues

Failing to insert new line

When inserting new line between braces, puts caret on next line, adds new line after braces, but not between
image
image

Out of bounds error

How to reproduce: open file with text, put caret in the end, press backspace for a few seconds.

image

Handle exceptions from background thread

Exceptions from background thread now kill event processor and makes usage of the app impossible. Need to have proper way of handling them without killing the app and show to user

Tab insertion

Insering tab between parentheses
image

Also seems like tab = space, better to make tab = 2 spaces

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.