дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-08 19:02:17 +02:00
feat(editor): colour global variables (the semantic global modifier) (#1393)
lua-language-server marks globals with the `global` token modifier, but the editor dropped it, so a global variable looked like a local unless rainbow highlighting was on. The modifier now sets `cm-sem-global`, drawn in a new Language Defaults › Identifiers › Global variable colour (`--syn-global`): library globals keep the predefined colour and calls the function-call colour. Imported IntelliJ themes and .icls schemes take it from DEFAULT_GLOBAL_VARIABLE. Built-in schemes default it to the local variable colour (IntelliJ's fallback for the key), so they look as before until a scheme sets it. Fixes #1370
Цей коміт міститься в:
1 джерело
8d784ac164
коміт
d5c4066748
8 files changed
+33
No files matched your search
@@ -113,6 +113,7 @@ export const ATTRIBUTES: readonly AttributeDef[] = [
|
||||
syn("keyword", "Keyword", [LD], "keyword"),
|
||||
syn("identifier", "Identifiers › Local variable", [LD], "variable"),
|
||||
syn("parameter", "Identifiers › Parameter", [LD], "param"),
|
||||
syn("globalVariable", "Identifiers › Global variable", [LD], "global"),
|
||||
syn("constant", "Identifiers › Constant", [LD], "constant"),
|
||||
syn("field", "Identifiers › Instance field", [LD], "property"),
|
||||
{ id: "staticSymbol", name: "Identifiers › Static symbol", path: [LD], token: "static", italicOnly: true },
|
||||
|
||||
@@ -41,6 +41,17 @@ describe(".icls schemes", () => {
|
||||
expect(customs).toEqual(before);
|
||||
});
|
||||
|
||||
it("imports the global variable colour", () => {
|
||||
const xml =
|
||||
'<scheme name="G" parent_scheme="Darcula"><attributes><option name="DEFAULT_GLOBAL_VARIABLE"><value>' +
|
||||
'<option name="FOREGROUND" value="9876aa"/><option name="FONT_TYPE" value="2"/></value></option></attributes></scheme>';
|
||||
expect(parseIcls(xml).scheme.attributes.globalVariable).toEqual({
|
||||
foreground: "#9876aa",
|
||||
bold: false,
|
||||
italic: true,
|
||||
});
|
||||
});
|
||||
|
||||
it.each([
|
||||
["Darcula", "ffffff", "dark"],
|
||||
["Default", "000000", "light"],
|
||||
|
||||
@@ -11,6 +11,7 @@ const ATTRIBUTE_NAMES: Record<string, string> = {
|
||||
DEFAULT_IDENTIFIER: "identifier",
|
||||
DEFAULT_LOCAL_VARIABLE: "identifier",
|
||||
DEFAULT_PARAMETER: "parameter",
|
||||
DEFAULT_GLOBAL_VARIABLE: "globalVariable",
|
||||
DEFAULT_CONSTANT: "constant",
|
||||
DEFAULT_INSTANCE_FIELD: "field",
|
||||
DEFAULT_STATIC_FIELD: "constant",
|
||||
|
||||
Reference in new issue
Заблокувати користувача