Skip to content

Commit 0bfd4ea

Browse files
Globals highlight and auto-complete fixes, empty AC variants fix
1 parent cdfdccf commit 0bfd4ea

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"printableName": "Cache Web Terminal",
66
"description": "Web-based terminal emulator for Caché administering.",
77
"author": "ZitRo",
8-
"version": "4.2.12",
8+
"version": "4.2.13",
99
"gaID": "UA-83005064-2",
1010
"releaseNumber": 26,
1111
"scripts": {

src/client/js/autocomplete/types.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ export default {
6363
server.send("LocalAutocomplete", null, (d) => {
6464
if (!d)
6565
return;
66-
cb(Object.keys(d).filter(s => s.indexOf(v) === 0).map(s => s.substr(v.length)));
66+
cb(Object.keys(d).filter(s => s.indexOf(v) === 0 && s.length !== v.length)
67+
.map(s => s.substr(v.length)));
6768
});
6869
},
6970
"favorites": (collector, cb) => {
7071
let v = collectOfType(collector, "favorites");
71-
cb(Object.keys(favorites.list()).filter(s => s.indexOf(v) === 0)
72+
cb(Object.keys(favorites.list()).filter(s => s.indexOf(v) === 0 && s.length !== v.length)
7273
.map(s => s.substr(v.length)));
7374
},
7475
"member": (collector, cb) => {

src/client/js/parser/grammar.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ rule("CWTSpecial").split(
209209
id({ value: "sql", class: "special" }),
210210
id({ value: "trace", class: "special" }).whitespace().split(
211211
id({ value: "stop", class: "global" }),
212-
tryCall("global"),
212+
char({ value: "^", class: "global", type: "global" }).call("globalBody"),
213213
split(
214214
char({ type: "filename", class: "string" }),
215215
id({ type: "filename", class: "string" })
@@ -277,11 +277,11 @@ rule("cosCommand").split(
277277
{ CI, value: "merge", class: "keyword" },
278278
{ CI, value: "m", class: "keyword" }
279279
]).call("postCondition").whitespace().split(
280-
tryCall("variable"),
281-
call("global")
280+
char({ value: "^", class: "global", type: "global" }).call("globalBody"),
281+
call("variable")
282282
).optWhitespace().char("=").optWhitespace().split(
283-
tryCall("variable"),
284-
call("global")
283+
char({ value: "^", class: "global", type: "global" }).call("globalBody"),
284+
call("variable")
285285
).exit(),
286286
id([
287287
{ CI, value: "open", class: "keyword" },
@@ -572,6 +572,7 @@ rule("expression").split(
572572
).exit().end();
573573

574574
rule("variable").split(
575+
char({ value: "^", class: "global", type: "global" }).call("globalBody"),
575576
split(
576577
char("@"),
577578
any()
@@ -585,14 +586,12 @@ rule("variable").split(
585586
).branch().split(
586587
char({ value: ".", type: "*" }).call("member").merge(),
587588
any()
588-
),
589-
call("global")
589+
)
590590
).exit().end();
591591

592-
rule("global").char({ value: "^", class: "global", type: "global" }).branch()
593-
.id({ class: "global", type: "global" }).split(
594-
char({ value: ".", class: "global", type: "global" }).merge(),
595-
any()
592+
rule("globalBody").branch().id({ class: "global", type: "global" }).split(
593+
char({ value: ".", class: "global", type: "global" }).merge(),
594+
any()
596595
).split(
597596
char("(").call("argumentList").char(")"),
598597
any()

0 commit comments

Comments
 (0)