Git Product home page Git Product logo

vscode-haxe's Introduction

vscode-haxe

Haxe language extension for Visual Studio Code by Patrick Le Clec'h, Jeff Ward, and Dan Korostelev

This extension provides:

  • Syntax highlighting for .hx and .hxml files
  • Code completion (work in progress)
  • Function signature completion
  • Jump / peek definition (ctrl-click / ctrl-hover)
Code Completion Peek Definition

#Install the Extension

For the stable version of this plugin, it is availble in the VSCode Marketplace. From within VSCode, press F1, type ext install and press enter, type haxe and it will be listed under publisher Haxe Devs.

For development versions, place the vscode-haxe directory in your .vscode/extensions directory:

  • Windows: %USERPROFILE%\.vscode\extensions
  • Linux / Mac: ~/.vscode/extensions

#Project setup

Code completion and other features require an .hxml file in your project. Various frameworks (OpenFL, Snow, Kha, etc) can generate the .hxml file for you -- see the Framework notes section below.

By default the extension looks for a build.hxml in the root of the project, but you can set the location in your project's settings under File -> Preferences -> Workspace Settings. Add the following setting locating your .hxml file relative to the project directory:

{
    "haxe.haxeDefaultBuildFile": "path/to/build.hxml"
}

#Framework notes: Some frameworks support the creation of .hxml files, which is necessary to run the Haxe code completion engine. Below is a list of how you can get an .hxml file from various frameworks.

Framework How to get .hxml Example usage
OpenFL openfl display <platform> openfl display linux > build.hxml
Snow haxelib run flow info --hxml haxelib run flow info --hxml > build.hxml
Kha See build/project-<platform>.hxml Set location in Workspace Settings
Flambe flambe haxe-flags flambe haxe-flags > build.hxml

Feel free to file an issue with details for other frameworks.

#Other notes and status

##Code completion status: BETA The code completion in this extension is currently in beta. There are bugs, limitations, and requirements that still need to be worked out. There's an effort to standardize Haxe IDE support over at snowkit/Tides. When this is ready, we'll integrate it (no need to duplicate effort and provide divergent experiences.)

##Current limitations: Some features may require a forthcoming version of the Haxe compiler.

##Troubleshooting the completion features You can start the haxe completion server by hand in verbose mode in a separate terminal. First, kill any existing Haxe completion servers, start it with haxe -v --wait 6000, and open your project in code. Here's an example in Linux:

>pkill haxe
>haxe -v --wait 6000

After starting my project, the console spits out the arguments and results of the completion server, e.g.:

Client connected
Waiting for data...
Reading 203 bytes
Processing Arguments [-D,display-details,--cwd,/home/jward/dev/test openfl,vscode-project.hxml,--no-output,--display,/home/jward/dev/test openfl/Source/Main.hx@485]
Parsed /home/jward/dev/test openfl/Source/Main.hx
Completion Response =
<list>
...
</list>

Stats = 1 files, 507 classes, 927 methods, 29 macros
Time spent : 0.210s

vscode-haxe's People

Contributors

pleclech avatar jcward avatar

Watchers

James Cloos avatar  avatar

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.