go to post Brett Saviano · Jan 24, 2024 @Nicki Vallentgoed You can convert the HttpResponse.Data into a %DynamicObject without using an intermediate stream: Set jsonob = ##class(%DynamicObject).%FromJSON(httprequest.HttpResponse.Data)
go to post Brett Saviano · Jan 23, 2024 @Evgeny Shvarov You can't use macros in a terminal so that's probably the cause.
go to post Brett Saviano · Jan 19, 2024 @Joseph Griffen ZWrite is going to output the internal format of the %Status value, which isn't that easy to parse visually. $SYSTEM.Status.DisplayError() will output the status text to the current device in a more readable format. USER>Write ##class(%Atelier.v1.Utils.General).ValidateDocName("project.prj",.sc) 0 USER>ZWrite sc sc="0 "_$lb($lb(16006,"project.prj",,,,,,,,$lb(,"USER",$lb("e^ValidateDocName+33^%apiSRC^2","e^ValidateDocName+1^%Atelier.v1.Utils.General.1^1","e^^^0"))))/* ERROR #16006: Document 'project.prj' name is invalid [ValidateDocName+33^%apiSRC:USER] */ USER>Do $SYSTEM.Status.DisplayError(sc) ERROR #16006: Document 'project.prj' name is invalid [ValidateDocName+33^%apiSRC:USER] If you need to store the status text in a variable you can use $SYSTEM.Status.GetErrorText().
go to post Brett Saviano · Jan 19, 2024 The list of supported file systems for your version (2023.1) can be found here.
go to post Brett Saviano · Jan 18, 2024 Sorry, I see that now! Have you checked your server connection information and made sure you have the correct host, port username and password?
go to post Brett Saviano · Jan 18, 2024 @Nimisha Joseph If you uninstalled Ensembe, what server are you trying to connect to?
go to post Brett Saviano · Jan 17, 2024 I just created a code-workspace file using your example above and I couldn't reproduce this is it possible that there's a .vscode/settings.json inside the "." folder that contains different objectscript.export settings? If so, those will take precedence. Folder-specific settings take precedence over workspace-specific settings, and workspace-specific take precdence over user-specific.
go to post Brett Saviano · Jan 17, 2024 @Mathew Rimmington Based on your description, I think that your setting for "objectscript.export.folder" should be "appname/src/database" instead of "src/database".
go to post Brett Saviano · Jan 17, 2024 The "Export Project Contents" command that you clicked is for exporting as individual UDL files in your workspace for editing with local source control. To export server documents in a single XML file, you an use the "Export Documents to XML File..." command that's documented here.
go to post Brett Saviano · Jan 17, 2024 @Pietro Di Leo When you say "export a project", what do you mean by that? Do you mean "export the documents in the project to edit them", or "export the contents as a single legacy XML file for deployment/sharing"?
go to post Brett Saviano · Jan 17, 2024 @Mathew Rimmington I think I've made the fix. You can download a version of the Language Server extension with the fix here. To install it, simply drag the .vsix file into the extensions view in VS Code. It will prompt you to reload so the new version of the extension can be activated. Be sure you download the correct version for your platform and please let me know if your issue is resolved. I plan on releasing a new Language Server version very soon and I'd like this fix to be in it!
go to post Brett Saviano · Jan 17, 2024 @Mathew Rimmington Sorry, I misread the prompt in the screenshot. Can you open the settings.json file that contains the server definition that you're having trouble with and send me that? I'd like to confirm that it has "UnknownUser" as the username and not no username. If so, I can modify the Language Server to handle that case better. I know what's happening now. You're creating the server definition with no username, and when the server manager extension tries to use it, it assumes that you wanted to store your credentials securely, so it gives you this prompt. When you leave it blank, it inserts "UnknownUser" with no password as your credentials. The Language Server extension needs to handle that case. I will make the fix.
go to post Brett Saviano · Jan 16, 2024 @Mathew Rimmington The Language Server expects that if you want to use unauthenticated access then you need to provide no username, not "UnknownUser".
go to post Brett Saviano · Jan 11, 2024 @Scott Roth You can redirect output to a file in the mgr directory. Docs are here.
go to post Brett Saviano · Dec 27, 2023 Hi @Pietro Di Leo, my post on features unique to the VS Code WebSocket Terminal is now live and can be viewed here. I think it's a nice addendum to your very informative article!
go to post Brett Saviano · Dec 18, 2023 @Rodrigo Werneck I recommend you use an intermediary stream to avoid <MAXSTRING> errors with large JSON objects: ClassMethod DuplicateDAO(dao As %DynamicAbstractObject) As %DynamicAbstractObject { Set strm = ##class(%Stream.TmpCharacter).%New() Do dao.%ToJSON(strm) Return ##class(%DynamicAbstractObject).%FromJSON(strm) }
go to post Brett Saviano · Dec 15, 2023 @Stephane Devin Here's a pretty-printed version of the attributes list for JavaScript: Attribute 0: ErrorAttribute 1: White SpaceAttribute 2: _TabAttribute 3: LabelAttribute 4: DelimiterAttribute 5: StringAttribute 6: CommentAttribute 7: Decimal integerAttribute 8: Hexadecimal integerAttribute 9: Floating point numberAttribute 10: Regexp delimiterAttribute 11: Regexp bodyAttribute 12: Regexp escape sequenceAttribute 13: Regexp flagsAttribute 14: IdentifierAttribute 15: OperatorAttribute 16: Definition keywordAttribute 17: Statement keywordAttribute 18: Literal keywordAttribute 19: Expression keywordAttribute 20: Future keywordAttribute 21: CSP extensionAttribute 22: JSON property name
go to post Brett Saviano · Dec 14, 2023 @Stephane Devin You can use %SyntaxColor to parse JavaScript. Here's a very simple example that reads in a JS file, parses it, and returns a JSON representation of the semantic tokens: ClassMethod JSTokens() As %Boolean { #; Reading from a file, writing to a temporary stream Set syn = ##class(%SyntaxColor).%New(), in = ##class(%Stream.FileCharacter).%New(), out = ##class(%Stream.TmpCharacter).%New() #; Need the "K" flag to get JSON output Do in.LinkToFile("/Users/bsaviano/Desktop/test.js"), syn.Color(in,out,"JS","K") #; Get a %DynamicArray from the stream Set tokens = ##class(%DynamicArray).%FromJSON(out) #; Process JSON ... #; JSON is of the format: #; { #; // The position of the token within the line #; p: number; #; // The length of the token #; c: number; #; // Language number, see %SyntaxColor::Languages() #; l: number; #; // Attribute number, see %SyntaxColor::Attributes() #; s: number; #; }[][] #; Where there is one array per line of the source document } I suggest you study the class reference for %Library.SyntaxColor since it's not that easy to use.
go to post Brett Saviano · Nov 16, 2023 Great post @Pietro Di Leo! For those interested in the features unique to the WebSocket Terminal, I will publish an article on this topic soon. Stay tuned!
go to post Brett Saviano · Nov 2, 2023 @Nicki Vallentgoed There isn't a way to check if a file is out of date without saving it. I think the best change you could make to your workflow would be using a private server instead of a shared server. Since you're working with local files, you shouldn't care about the server version since it's not the source of truth. If you used your own private development server you could turn off the version checking logic and let your source control system handle differences.