Skip to content

Commit b857080

Browse files
macMikeymacMikey
authored andcommitted
Merge remote-tracking branch 'peter-b/master'
2 parents 3b67f26 + 5812cf4 commit b857080

File tree

7 files changed

+30983
-30583
lines changed

7 files changed

+30983
-30583
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 0.6.1 - Improvements to documentation and LiveCode Script support
2+
3+
* Revised, expanded and generally improved documentation (issue #19)
4+
* Improved LiveCode Script support
5+
* Support for `if...then...else...` syntax
6+
* Better indentation in `switch` blocks
7+
* Restore completion of symbols from the current file (issue #18)
8+
* Don't clobber autocomplete settings (issue #16)
9+
* Improved variable & constant capturing
10+
* Restored support for linting revIgniter files
11+
112
## 0.6.0 - Linting and script-only stacks
213
* LiveCode Script grammar and snippets generated from documentation
314
* Support for script-only stacks (`.livecodescript`)

README.md

Lines changed: 84 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,111 @@
1-
# LiveCode Language package for Atom
1+
# LiveCode language package for Atom
22

33
![LiveCode Community Logo](http://livecode.com/wp-content/uploads/2015/02/livecode-logo.png)
44

5-
This is a language package for Atom that provides support for editing
6-
[LiveCode](http://livecode.com/) source code.
5+
This is a language package that lets you edit [LiveCode](http://livecode.com/)
6+
source code in the Atom editor. It adds support for:
77

8-
LiveCode is an open source platform provides a way to build applications for
9-
mobile, desktop and server platforms. The visual workflow allows the user to
10-
develop apps "live", using a powerful and uniquely-accessible language syntax.
8+
* LiveCode Builder source code (`.lcb`)
9+
* LiveCode server source code (`.lc` and `.irev`)
10+
* LiveCode script-only stacks (`.livecodescript`)
1111

12-
The LiveCode server syntax and revIgniter snippets were converted from the
13-
TextMate bundles available from the [revIgniter](http://revigniter.com/)
14-
website.
12+
## Installing
13+
14+
Using the Atom package manager:
15+
16+
* Visit Atom's "Settings" view, and go to the "Install" tab
17+
* Use the search field to search for the **language-livecode** package
18+
* Click "Install"
19+
20+
Using the command line: `apm install language-livecode`
1521

16-
## Supported languages
22+
See also the [Atom Packages](https://atom.io/docs/v1.0.19/using-atom-atom-packages)
23+
section in the Atom Flight Manual.
1724

18-
Currently, this package supports editing:
25+
## Configuration
1926

20-
* LiveCode Builder source code in `.lcb` files
21-
* LiveCode server source code in `.lc` and `.irev` files
22-
* LiveCode Script source code in `.livecodescript` files, where the shebang line
23-
contains `livecode` or the first line contains an Emacs mode comment
24-
`# -*- mode:livecodescript -*-`
27+
The settings for LiveCode integration can also be modified using Atom's
28+
"Settings" view. Go to the "Packages" tab, find the **language-livecode**
29+
package, and click its "Settings" button.
2530

26-
The package provides syntax highlighting, highlighting and indentation support
27-
for all the supported languages.
31+
See also the
32+
[Package Settings](https://atom.io/docs/v1.0.19/using-atom-atom-packages#package-settings)
33+
section in the Atom Flight Manual.
2834

29-
It also provides snippets to enhance LiveCode server script and revIgniter
30-
script development.
35+
## Usage
3136

32-
For LiveCode Script there are quite a number of autocomplete snippets generated
33-
from the LiveCode documentation.
37+
**language-livecode** integrates LiveCode editing into the Atom editor. Note
38+
that it doesn't make Atom behave like the LiveCode IDE, and it doesn't
39+
integrate with or replace the LiveCode IDE's script editor.
3440

35-
## Installation
41+
### Syntax highlighting and indentation
3642

37-
Install the `language-livecode` package from the "Install Packages and Themes"
38-
view in Atom's "Settings" window.
43+
The package adds automatic syntax highlighting and indentation for all of the
44+
supported LiveCode language types.
3945

40-
You may also wish to install the [revIgniter theme](https://atom.io/themes/revigniter-syntax)
41-
for Atom.
46+
The optional [revigniter-syntax](https://atom.io/themes/revigniter-syntax)
47+
can be installed to provide a colour theme that's tailored for LiveCode source
48+
code.
4249

43-
## Script Error Checking
50+
### Autocompletion
4451

45-
This package provides a linter for LiveCode Script, LiveCode Server and LiveCode
46-
Builder to highlight and describe script compilation errors on the fly.
52+
The package also includes autocompletion support for symbols in the current
53+
file, along with snippets for many common LiveCode Builder and LiveCode Script
54+
syntax elements.
4755

48-
![Linter In Action](http://ecove.on-rev.com/linter.gif)
56+
### Script error checking ("linting")
4957

50-
Dependencies:
58+
If you have the [linter](https://atom.io/packages/linter) package installed,
59+
you can enable script error checking support. This highlights and describes
60+
script compilation errors as you work.
5161

52-
* The [linter package](https://atom.io/packages/linter) needs to be installed
53-
* LiveCode 7.1+ Server engine for the platform it is being run on must be
54-
accessible
62+
![Linter in action](http://ecove.on-rev.com/linter.gif)
5563

56-
The default setting assumes you have installed the LiveCode Server engine somewhere
57-
on the current `$PATH` with the name `livecode-server`. However, you can enter any
58-
path or name you choose via the package settings.
64+
#### LiveCode Script linting
5965

60-
For LiveCode Server the linter will only check for errors within the scope of
61-
the file being edited. If for example a variable re-declarition error is caused
62-
by the inclusion of another file that error won't be detected.
66+
You will need to
67+
[download LiveCode server](https://downloads.livecode.com/livecode) and install
68+
(by unzipping it somewhere appropriate). LiveCode Server 7.1.0 or later is
69+
required.
6370

64-
The linter supports an optional explicit variables mode which can be turned on
65-
via the package settings.
71+
Next, go to the package settings and put the full path to the LiveCode server
72+
program that you just extracted (e.g. `/path/to/livecode-community-server`)
73+
into the "LiveCode Server Engine Path" setting.
6674

67-
### LiveCode Builder Linting
75+
It's often useful to enable the "Explicit Variables" setting to get an error
76+
when you use a variable name that you haven't declared with `local` or
77+
`global`.
6878

69-
Linting of LiveCode Builder files should be considered experimental. This is
70-
particularly the case for projects that have complex interdependencies between
71-
files.
79+
**Note:** When checking LiveCode Server source files, the linter will only
80+
check for errors in the file currently being edited. If, for example, the file
81+
you're editing includes another file and that inclusion causes a variable
82+
re-declaration error, the linter will not detect it.
7283

73-
In order to lint LiveCode Builder files ensure the following:
84+
#### LiveCode Builder linting
7485

75-
* lc-compile can be found at the location specified in settings
76-
* You have appropriately set the module paths to a directory with the standard
77-
`*.lci` files provided by LiveCode. You may add further paths delimited by `;`
86+
**Warning:** Linting for LiveCode Builder source code is **experimental**.
7887

79-
The default settings assume you have a clone of the LiveCode repo in
80-
your home directory named livecode and you have built a debug build.
88+
You need LiveCode 8 installed to use LiveCode Builder linting. The LiveCode
89+
IDE's installation location contains the LiveCode Builder compiler, called
90+
**lc-compile**. In the package settings, set the "Compiler Path for LiveCode
91+
Builder" to the full path to the compiler (e.g. `/path/to/lc-compile`).
8192

82-
In the process of linting the LiveCode Builder file a `*.lci` file is created in
83-
a directory named `.lci` next to the file being edited. In the case of files
84-
that have dependencies you may receive a dependency error if you edit a
85-
file with the dependency before those it depends on because it won't be able to
86-
fine the appropriate `*.lci` file in the `.lci` directory.
93+
The LiveCode Builder compiler also needs to know where to find the `.lci`
94+
interface files which provide the built-in modules' interface information.
95+
These are usually located in a `modules` directory near the **lc-compile**
96+
program in the LiveCode IDE's installation location. You should put this
97+
path in the "Module Paths For LiveCode Builder" setting.
98+
99+
If you are working on a complex project and you need **lc-compile** to look for
100+
`.lci` files in multiple places, you can put multiple paths in the "Module
101+
Paths for LiveCode Builder" setting, separated by `;` characters.
102+
103+
**Notes:** The linting step will automatically create a `.lci` working
104+
directory in the directory where the LCB file is located. The linter puts the
105+
interface files for the files that are being linted in that directory. You may
106+
get dependency errors if you edit an LCB module which has dependencies before
107+
editing the module that it depends on, because the `.lci` working directory
108+
will have missing interface files.
87109

88110
## Authors
89111

@@ -92,6 +114,10 @@ fine the appropriate `*.lci` file in the `.lci` directory.
92114
* Monte Goulding
93115
* Adam Robertson
94116

117+
The LiveCode server syntax and revIgniter snippets were converted from the
118+
TextMate bundles available from the [revIgniter](http://revigniter.com/)
119+
website.
120+
95121
## Reporting bugs and contributing
96122

97123
Please report any problems to the [GitHub issues tracker]( https://github.com/peter-b/atom-language-livecode/issues).

grammars/livecodescript.cson

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ repository:
1919
match: "(?i)\\b(SIX|TEN|FORMFEED|NINE|ZERO|NONE|SPACE|FOUR|FALSE|COLON|CRLF|PI|COMMA|ENDOFFILE|EOF|EIGHT|FIVE|QUOTE|EMPTY|ONE|TRUE|((?<=\\w\\s)RETURN)|CR|LINEFEED|RIGHT|BACKSLASH|NULL|SEVEN|TAB|THREE|TWO)\\b"
2020
name: "constant.language.livecodescript"
2121
}
22+
{
23+
match: "\\bk[A-Z]{1}.*?\\b"
24+
name: "constant.language.livecodescript"
25+
}
2226
]
2327
language:
2428
patterns: [
@@ -55,7 +59,7 @@ repository:
5559
'name': 'comment.line.livecodescript'
5660
}
5761
{
58-
match: "\\b(after|byte(s)*|codepoint(s)*|codeunit(s)*|english|segment(s)*|sentence(s)*|paragraph|the|trueWord(s)*|until|word(s)*|http|forever|descending|using|line|real8|with|seventh|for|stdout|finally|element|word|fourth|before|black|ninth|sixth|characters|chars|stderr|uInt(1|1s|2|2s)|stdin|string|lines|relative|rel|any|fifth|items|from|middle|mid|at|else|of|catch|then|third|it|file|milli(seconds|second|secs|sec)|int(1|1s|4|4s|ernet|2|2s)|normal|text|item|last|long|detailed|effective|uInt4|uInt4s|se(conds|cond|cs|c)|repeat|end\\s+repeat|URL|in|end\\s+try|into|switch|end\\s+switch|to|words|https|token|binfile|each|tenth|as|ticks|tick|system|real4|by|dateItems|without|cha(r|racter)|ascending|eighth|whole|dateTime|numeric|short|first|ftp|integer|abbreviated|abb(r|rev)|private|case|while|if|end\\s+if)\\b"
62+
match: "\\b(after|byte(s)*|codepoint(s)*|codeunit(s)*|english|segment(s)*|sentence(s)*|paragraph|the|trueWord(s)*|until|word(s)*|http|forever|descending|using|line|real8|with|seventh|for|stdout|finally|element|word|fourth|before|black|ninth|sixth|characters|chars|stderr|uInt(1|1s|2|2s)|stdin|string|lines|relative|rel|any|fifth|items|from|middle|mid|at|else|of|catch|then|third|it|file|milli(seconds|second|secs|sec)|int(1|1s|4|4s|ernet|2|2s)|normal|text|item|last|long|detailed|effective|uInt4|uInt4s|se(conds|cond|cs|c)|repeat|end\\s+repeat|URL|in|end\\s+try|into|switch|end\\s+switch|to|words|https|token|binfile|each|tenth|as|ticks|tick|system|real4|by|dateItems|without|cha(r|racter)|ascending|eighth|whole|dateTime|numeric|short|first|ftp|integer|abbreviated|abb(r|rev)|private|case|default|while|if|end\\s+if)\\b"
5963
name: "keyword.control.livecodescript"
6064
}
6165
{
@@ -165,29 +169,17 @@ repository:
165169
}
166170
]
167171
var_global:
168-
captures:
169-
"1":
170-
name: "punctuation.definition.variable.livecodescript"
171-
match: "\\b(g)[A-Z]{1}.*?\\b"
172+
match: "\\bg[A-Z]{1}.*?\\b"
172173
name: "variable.other.global.livecodescript"
173174
var_local:
174-
captures:
175-
"1":
176-
name: "punctuation.definition.variable.livecodescript"
177-
match: "\\b(t|the)[A-Z]{1}.*?\\b"
178-
name: "variable.other.global.livecodescript"
175+
match: "\\bt[he]*[A-Z]{1}.*?\\b"
176+
name: "variable.other.local.livecodescript"
179177
var_parameter:
180-
captures:
181-
"1":
182-
name: "punctuation.definition.variable.livecodescript"
183-
match: "\\b(p)[A-Z]{1}.*?\\b"
184-
name: "variable.parameter.livecodescript"
178+
match: "\\bp[A-Z]{1}.*?\\b"
179+
name: "variable.other.param.livecodescript"
185180
var_scriptLocal:
186-
captures:
187-
"1":
188-
name: "punctuation.definition.variable.livecodescript"
189-
match: "\\b(s)[A-Z]{1}.*?\\b"
190-
name: "variable.other.global.livecodescript"
181+
match: "\\bs[A-Z]{1}.*?\\b"
182+
name: "variable.other.scriptlocal.livecodescript"
191183
var_server:
192184
match: "\\$_[A-Z]+"
193185
name: "variable.other.server.livecodescript"

lib/main.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports =
6262

6363
provideLinter: ->
6464
provider =
65-
grammarScopes: ['source.livecodescript', 'source.lcb']
65+
grammarScopes: ['source.livecodescript', 'source.iRev', 'source.lcb']
6666
scope: 'file'
6767
lintOnFly: true
6868
lint: (textEditor) =>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "language-livecode",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"description": "Support for editing LiveCode source code",
55
"repository": "https://github.com/peter-b/atom-language-livecode",
66
"license": "GPLv3",

0 commit comments

Comments
 (0)