GithubHelp home page GithubHelp logo

moonshine-ide / moonshine-feathersui-text-editor Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 1.0 950 KB

A text editor component with syntax highlighting and code intelligence features for Feathers UI

License: Other

Haxe 99.83% HTML 0.17%
feathers-ui haxe openfl

moonshine-feathersui-text-editor's Introduction

Text Editor component for Feathers UI

The text editor UI component used by Moonshine IDE, written in Haxe, and built on Feathers UI and OpenFL.

Minimum Requirements

  • Haxe 4.1
  • OpenFL 8.9.7
  • Feathers UI 1.0.0-rc.1

Installation

This library is not yet available on Haxelib. To install, run the following command in a terminal:

haxelib git moonshine-feathersui-text-editor https://github.com/Moonshine-IDE/moonshine-feathersui-text-editor.git

Project Configuration

After installing the library above, add it to your OpenFL project.xml file:

<haxelib name="moonshine-feathersui-text-editor" />

Documentation

moonshine-feathersui-text-editor's People

Contributors

joshtynjala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

longde123

moonshine-feathersui-text-editor's Issues

TextEditorChanges must not overlap - exception

When I'm using Command + Shift + I to clean up imports I'm getting following stacktrace in console.

MoonshineDevelopment version 3.3.0 Build 2222 MacOS Monterey Version 12.0.1

: TextEditorChanges must not overlap. { startLine: 2, startChar: 0, endLine: 19, endChar: 64 } overlaps with { startLine: 2, startChar: 0, endLine: 2, endChar: 0}.
: ArgumentError: TextEditorChanges must not overlap. { startLine: 2, startChar: 0, endLine: 19, endChar: 64 } overlaps with { startLine: 2, startChar: 0, endLine: 2, endChar: 0}.
: 	at moonshine.editor.text.managers::EditManager/mergeChanges()
: 	at moonshine.editor.text.managers::EditManager/editManager_textEditor_textChangePriorityHandler()
: 	at flash.events::EventDispatcher/dispatchEvent()
: 	at global/actionScripts.utils::applyTextEditsToTextEditor()
: 	at global/actionScripts.utils::applyTextEditsToFile()
: 	at Function/applyWorkspaceEdit.as$805:applyTextEditsToURI()
: 	at global/actionScripts.utils::applyWorkspaceEdit()
: 	at actionScripts.languageServer::ActionScriptLanguageServerManager/languageClient_applyEditHandler()
: 	at flash.events::EventDispatcher/dispatchEvent()
: 	at moonshine.lsp::LanguageClient/workspace__applyEdit()
: 	at moonshine.lsp::LanguageClient/parseRequestMessage()
: 	at moonshine.lsp::LanguageClient/parseMessage()
: 	at moonshine.lsp::LanguageClient/parseMessageBuffer()
: 	at moonshine.lsp::LanguageClient/languageClient_input_onData()
:

Editor displays line numbers in the middle

In Apache Royale project when I jump to the source code of framework by clicking attribute in component like HGroup, VGroup (ex. gap, itemsVerticalAlign) line numbers are bing displayed in the middle of editor. Note that issue is not always reproducible.

Screenshot 2023-09-14 at 15 22 21

Moonshine IDE™ (Development)
Version 3.3.4, Build 3083, Player: 33.1(Harman)
Running on: Mac OS 13.5.2

Cursor jumps to import section when new import is added

There is quite annoying issue in editor where cursor after adding import is jumps to the added line. Below recording describes whole issue:

Screen.Recording.2021-11-23.at.17.20.20.mov

Version Moonshine Development: 3.3.0 Build 2233

Opening Editor Do Not Auto-scrolls To Given Line Number

I see the an opening editor do not auto-scrolls to given line number in following scenarios:

  1. Opening an editor caused by jump-to-definition activity (CMD/Ctrl+Click on definition) from any other editor
  2. Project > Search > Result line double-click
    image

Editor "Dark Mode"

Justin requested to have at some point that feature. If you could @joshtynjala comment on that how difficult it could be to implement.

Right-Click Context Menu

A Prominic developer pointed out that the right-click context menu is missing in the updated editor in Moonshine-IDE 3.2.0. This mostly included basic Edit menu features.
image

I remember seeing some language-server features in this menu (for managing imports?) but I couldn't find this with a quick review in Moonshine 3.3.0.

I'd like to bring this menu back, since it may be more convenient for some developers.

Pressing Delete Key Makes Cursor To Jump Multiple Character Indexes

I tried to comment-off an XML's tag in Moonshine editor:

  1. Previously, I had something like <filename>filenameToBeReplacedByANT</filename>
  2. To start comment-off I added !-- in <filename - I see the editor immediately closed the comment tag by its own intelligence and construct the string as this <!---->filename>filenameToBeReplacedByANT</filename>
  3. Cursor at this point stays between <!-- and -->filename>
  4. To delete the unwanted --> characters, if I press Delete key cursor starts jumping multiple indexes each time [Bug]

A screen-recording shared to elaborate the problem:

Screen.Recording.mov

Code completion should react on already typed words

When I type the beginning of name of some classes and launch CC it doesn't help me with finalizing sentence. Video below shows the issue:

Screen.Recording.2021-11-24.at.17.07.05.mov

Moonshine Development version: 3.3.0 Build 2236

Not able type in editor closing curly bracket

Following recording describes small bug in editor:

Screen.Recording.2021-12-24.at.12.35.48.mov

When I go to the next line I'm trying to type closing curly brackets } - cursor jumping to the beginning of line, but curly brackets doesn't show up.

Moonshine Version 3.3.0, Build 2289, Player: 33.1(Harman)

Running On: Mac OS 12.1.0

Java Block Comment Completion

I mentioned this in #12, but in Eclipse or VSCode, I can complete JavaDoc comments (/**) like this:

  1. Type /*. VSCode only: This automatically appends */. I personally don't love this behavior, because it means I have to move my hands off of home row in order to get out of the comment when I am done. We can discuss this if you have other preferences, though.
  2. Hit Enter. The comment is automatically formatted like below. Note: This automatically adds @param, @throws, and @return for method comments, but this may be outside the scope of this issue. I know Eclipse allows you to specify templates for the comments.
  3. Hit Enter again. The new line is prefixed with a leading * to match the rest of the comment.
/**
 * <cursor here>
 */

Currently the comment block is not completed for Moonshine, and this causes some problems:

  • The language server can report errors for missing lines in the file, depending on where the next */ is.
  • Completion (see #12) does not work in an unclosed JavaDoc comment.

Code Completion in Javadoc Comments

I see some strange behavior for code completion in JavaDoc (/**) comments. @JustinProminic reported similar issues for /* and // comments, but I couldn't reproduce this.

image

I think this is intentional, though. You can see that it gives me an option to generate an @link, which is something I use in Eclipse. Completing the class name could potentially be nice when writing the documentation as well.

However, it does feel a little strange when the auto-complete triggers at the end of a sentence like this. Also, I see it won't allow me to complete methods.

Here are some Javadoc actions I do in Eclipse.

  1. Create a JavaDoc comment. A closing */ is automatically added when you hit Enter
  2. Type "Syste" and hit CTRL-Space. I have options to complete this as a plain class name or a @link
  3. Continue typing "m.". This automatically completes as an @link, changes the '.' to a '#' and starts to complete the method.
  4. On a new line, type "System.". Completion does not trigger.
  5. Type '#' on a new line. Completion opens for methods and properties

In Moonshine, I see:

  1. Create a JavaDoc comment. Moonshine does not automatically complete the comment, so add the closing tag manually. I prefix new lines in the comment with " * ".
  2. Type "Syste" and hit CTRL-Space. I have options to complete this as a plain class name or a @link. This works the same as Eclipse
  3. Continue typing "m.". Moonshine starts completion again, but shows nested classes, not methods or properties.
  4. On a new line, type "System.". Completion triggers.
  5. Type '#' on a new line. Completion opens for methods and properties

Here is the behavior I see for Visual Studio Code (which uses the same language server, right?).

  1. Create a JavaDoc comment. A closing */ is automatically added when you hit Enter
  2. Type "Syste" and hit CTRL-Space. I have options to complete this as a plain class name or a @link
  3. Continue typing "m.". Completion closes. You can use CTRL-Space again to trigger text-only completion
  4. On a new line, type "System.". Completion does not trigger.
  5. Type '#' on a new line. Completion opens for methods and properties

I'm fine with matching either behavior. Note that the procedure for VS Code also involves text-only completion and comment completion. We can ignore the text-only completion for now to avoid confusion with the language servers, and I'll plan to create a separate issue for comment completion.

This is a moderate priority. I can work around the issue pretty easily, but it does cause frustration when it triggers at the end of sentences.

Make code completion more smart on case sensitivity

One of the most annoying things in our code completion is not "being" smart and search among available options without case sensitivity. I would like to request if possible that code completion would work as it is for example in JetBrains Intellij. Following screenshot shows completion drop down list:

As you can see when I type "ce" I'm getting what I wanted to. I don't have to type whole word "create" as it would be right now in Moonshine's editor. What's more if I type in Moonshine "crEate" - it definitely close code completion completely because it won't find the right options.

Screenshot 2023-03-23 at 15 17 10

Cannot edit file after using find/search feature

Duplicate of: Moonshine-IDE/Moonshine-IDE/issues/988

Today I reproduced this issue using search instead of find feature

Steps:

  1. Use the search feature (Ctrl+Shift+F).

  2. Click on the changeset to go to the file (not just on a file name)
    image

  3. Try editing the file. The caret is trapped on the first line of the file.

  4. The editor is not listening for mouse events, but it is listening for keyboard events. If you manage to edit the file you will regain full control with your mouse.

Additional circumstances:

  • My find result returned around 70 files and this is happening only for one of them
  • It keeps happening for the same file even after Moonshine restart

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.