Code Monkey home page Code Monkey logo

atom-language-livecode's Introduction

LiveCode language package for Atom

LiveCode Community Logo

This is a language package that lets you edit LiveCode source code in the Atom editor. It adds support for:

  • LiveCode Builder source code (.lcb)
  • LiveCode server source code (.lc and .irev)
  • LiveCode script-only stacks (.livecodescript)

Installing

Using the Atom package manager:

  • Visit Atom's "Settings" view, and go to the "Install" tab
  • Use the search field to search for the language-livecode package
  • Click "Install"

See also the Atom Packages section in the Atom Flight Manual for more info, including how to install packages from the command line.

Configuration

The settings for LiveCode integration can also be modified using Atom's "Settings" view. Go to the "Packages" tab, find the language-livecode package, and click its "Settings" button.

See also the Package Settings section in the Atom Flight Manual.

Usage

language-livecode integrates LiveCode editing into the Atom editor. Note that it doesn't make Atom behave like the LiveCode IDE, and it doesn't integrate with or replace the LiveCode IDE's script editor.

Syntax highlighting and indentation

The package adds automatic syntax highlighting and indentation for all of the supported LiveCode language types.

The optional revigniter-syntax can be installed to provide a colour theme that's tailored for LiveCode source code.

Autocompletion

The package also includes autocompletion support for symbols in the current file, along with snippets for many common LiveCode Builder and LiveCode Script syntax elements.

Script error checking ("linting")

If you have the linter package installed, you can enable script error checking support. This highlights and describes script compilation errors as you work.

Linter in action

LiveCode Script linting

You will need to download LiveCode server and install (by unzipping it somewhere appropriate). LiveCode Server 7.1.0 or later is required.

Next, go to the package settings and put the full path to the LiveCode server program that you just extracted (e.g. /path/to/livecode-community-server) into the "LiveCode Server Engine Path" setting.

It's often useful to enable the "Explicit Variables" setting to get an error when you use a variable name that you haven't declared with local or global.

Note: When checking LiveCode Server source files, the linter will only check for errors in the file currently being edited. If, for example, the file you're editing includes another file and that inclusion causes a variable re-declaration error, the linter will not detect it.

LiveCode Builder linting

Warning: Linting for LiveCode Builder source code is experimental.

You need LiveCode 8 installed to use LiveCode Builder linting. The LiveCode IDE's installation location contains the LiveCode Builder compiler, called lc-compile. In the package settings, set the "Compiler Path for LiveCode Builder" to the full path to the compiler (e.g. /path/to/lc-compile).

The LiveCode Builder compiler also needs to know where to find the .lci interface files which provide the built-in modules' interface information. These are usually located in a modules directory near the lc-compile program in the LiveCode IDE's installation location. You should put this path in the "Module Paths For LiveCode Builder" setting.

If you are working on a complex project and you need lc-compile to look for .lci files in multiple places, you can put multiple paths in the "Module Paths for LiveCode Builder" setting, separated by ; characters.

Notes: The linting step will automatically create a .lci working directory in the directory where the LCB file is located. The linter puts the interface files for the files that are being linted in that directory. You may get dependency errors if you edit an LCB module which has dependencies before editing the module that it depends on, because the .lci working directory will have missing interface files.

Authors

  • Ralf Bitter
  • Peter Brett
  • Monte Goulding
  • Adam Robertson

The LiveCode server syntax and revIgniter snippets were converted from the TextMate bundles available from the revIgniter website.

Reporting bugs and contributing

Please report any problems to the GitHub issues tracker.

atom-language-livecode's People

Contributors

berndn avatar bwmilby avatar macmikey avatar peter-b avatar revig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atom-language-livecode's Issues

The documentation should be structured better

The top-level README file (which is also shown on the package page) needs to be more helpful. Specifically:

  • Installation instructions need to be more prominent, and need to link to the Atom documentation for "how to install packages". Optional dependency packages need to be listed with links to the appropriate packages' pages.
  • Add links to the package pages and/or documentation for Atom features that the package integrates with, including indentation, auto-completion, snippets, and linting.
  • Provide very basic instructions for downloading/extracting LiveCode Server for LCS linting support.

Misleading message when opening LCB files

When opening an LCB file without setting a valid path to lc-compile, an error pop-up appears recommending to install and set up LiveCode Server (which won't actually solve the problem!)

Allow linting using the standalone engine

The standalone engine can be run with a script-only stack as its argument. If we could use the standalone engine for linting instead of the server engine, it would make it easier to set up linting without having to download and install the LiveCode server (which most users probably won't be familiar with).

Colorize keywords by value not class

For example, when defining a handler, it can be "public" or "private". Perhaps the private keyword could have a hilite color, or be a different shade so it stands out when I'm staring at code.

"Auto Indent" doesn't work for .livecodescript files

For LiveCode Builder source code, the "Edit->Auto Indent" command ("Editor: Auto Indent" via the command palette) properly re-indents source code, including if/repeat/handler etc.

This doesn't seem to work properly for LiveCode Script source code (.livecodescript files).

Linter: Handle missing livecode-server more gracefully

Currently, if there's no livecode-server in the $PATH and the user hasn't configured package, opening a .livecodescript file triggers a scary uncaught exception error.

The exception should be caught and an informational warning should be shown, directing users to the settings.

Probably another one for @montegoulding?

Highlight doc comments distinctively

LCB doc comment blocks are distinguished from normal comment blocks by an extra initial star, i.e. /** ... */.

It would be good to highlight doc comment blocks in a distinctive way to show that they're not just normal comments.

Suggested by @macMikey.

// Doesn't seem recognized as a comment in LCB scripts by Atom editor

The BBEdit language files recognize // as an LCB comment, but the Atom lcb.cson file does not.
I tried to modify the lcb.cson file to add this feature - hoping to make a useful contribution. But I haven't been successful - maybe I need to add some escaping?

Here is the code I tried:
Lines 13-15
{
'include': '#comment.double-slash'
}

Lines 101-107:
'comment-double-slash':
'begin': '//'
'beginCaptures':
'0':
'name': 'punctuation.definition.comment.double-slash.lcb'
'end': '\n'
'name': 'comment.line.lcb'

LiveCode Script auto-completion doesn't offer local symbols

In LiveCode Script mode, the autocomplete settings don't result in useful suggestions.


In LiveCode Builder mode:

handler TestHandler()
    variable tTempVar

end handler

Put the cursor on the blank line and type tte. The first suggestion is tTempVar.


In LiveCode Script mode:

on mouseUp
   local tTempVar

end mouseUp

Put the cursor on the blank line and type tte. The first suggestion is templateEPS and tTempVar doesn't appear anywhere in the suggested completions.

Improved Emacs mode line detection

In a file opened with Emacs, having -*-Makefile-*- in the first line of the file will select Makefile editing mode. There's no need to have a mode: specifier, so it would be nice not to have to include mode: in language-livecode's detection regexp.

Also, we don't currently have any options for how to specify LiveCode Builder vs LiveCode Script mode.

What about case-insensitively using -*-livecode-*- or -*-livecode[script]-*- for LCS mode, -*-livecode[server]-*- for LiveCode Server / revIgniter mode, and -*-livecode[builder]-*- for LCB mode?

Atom Mac: autocomplete Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

I'm having a autocomplete error after typing 3 letters while using .livecode files. Everything seems to work. I just get a wall of error messages every time I type anything. Other then that, it's pretty great. Is there anything I can do to stop these messages?

Stack Trace for error.

/Users/myName/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/symbol-store.js:228
Hide Stack Trace
TypeError: Cannot read property 'toLowerCase' of undefined
at SymbolStore.fuzzyMatchScore (/Users/myName/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/symbol-store.js:228:68)
at SymbolStore.scoreSymbol (/Users/myName/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/symbol-store.js:214:27)
at SymbolStore.symbolsForConfig (/Users/myName/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/symbol-store.js:91:41)
at SymbolProvider.getSuggestions (/Users/myName/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/symbol-provider.js:364:47)
at providers.forEach.provider (/Users/myName/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:286:58)
at Array.forEach (native)
at AutocompleteManager.getSuggestionsFromProviders (/Users/myName/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:262:21)
at AutocompleteManager.findSuggestions (/Users/myName/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:254:23)

Symbols Not Recognized

Trevor has the linter in Sublime Text working. As part of that, I can look up handler and function names, or symbols. It seems that even though Atom supports symbols, we aren't able to get them. The shortcuts in Atom are command-R or command-shift-R.
from sublimetext

Add grammar for livecode "scripts" themselves

Although there's no common extension, the scripts of LiveCode objects have similar but distinct grammars from the two you provide. Could you add their grammar as well? For now, it would probably be the job of the user to specify a custom file extension for this grammar, or else to manually select it, but it would be a huge improvement over just using the "AppleScript" grammar for editing LiveCode scripts that have been saved outside of stacks.

Can not get linter working with Livecode server 8.02

Hi,

I can not get the linter to work with Livecode (.lc file). I have installed the LiveCode server 8.02 on MAC OSX 10.11.6 (15G31).
If I type any errors it always displays no issues in the status bar.

Can anyone confirm which version do work?

Regards

Andy

Add An Extra Structure That We Can Fold

Since we don't have named blocks in LCS, it would be nice to be able to perhaps use comments to mark a block, and then be able to fold that block.

For example, I've taken to marking blocks with a commented hashtag

#<parse the list>
...
#</parse the list>

Ping LC ala sublimeText

Trevor has a clever little hack for Sublime Text that pings LC every time a file in a project is modified. In the Levure framework he then has a listener that handles the ping to unload and reload the .livecodescript file, giving us live editing from the external editor.

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.