diff --git a/CHANGELOG.md b/CHANGELOG.md index e425e7d..e378774 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Fix issue [#321](https://github.com/intersystems/language-server/issues/321): Show detailed descriptions for syntax errors - Fix issue [#322](https://github.com/intersystems/language-server/issues/322): Add setting to disable undefined variable warning diagnostics - Fix issue [#323](https://github.com/intersystems/language-server/issues/323): Go to definition on `##super()` will open the superclass's implementation +- Fix issue [#324](https://github.com/intersystems/language-server/issues/324): Add intellisense for variables set to JSON literal constructors - Parser changes: - DP-430347: Track variables in routine procedure blocks - DP-430473: Fix variable tracking with embedded SQL in routine procedure blocks diff --git a/server/src/utils/functions.ts b/server/src/utils/functions.ts index 0325f71..e3b1615 100644 --- a/server/src/utils/functions.ts +++ b/server/src/utils/functions.ts @@ -1798,6 +1798,17 @@ function parseSetCommand(doc: TextDocument, parsed: compressedline[], line: numb } } } + else if (parsed[ln][tkn].l == ld.cos_langindex && parsed[ln][tkn].s == ld.cos_jsonb_attrindex) { + // This is a %DynamicObject or %DynamicArray + result.foundset = true; + switch (doc.getText(Range.create(ln,parsed[ln][tkn].p,ln,parsed[ln][tkn].p+parsed[ln][tkn].c))) { + case "{": + result.class = "%Library.DynamicObject"; + break; + default: + result.class = "%Library.DynamicArray"; + } + } // Exit the loop because we've already found our variable brk = true;