What types can there be for "UDLText"s other than comments? - intersystems-cache

I am now using the Caché DB jar to query for class definitions (thanks #daimor; it was an eye opener) and in order to write the source files I need to also account for "UDL texts".
Now, all I have been able to understand of them so far is that they are comments found in the source you actually write in Studio. But then UDLTextDefinition defines .getCategory(); the only value I have seen this method return so far is "comment".
Is there any other possible value?

If you open source code for that class (%Dictionary.UDLTextDefinition), you will find CategoryIsValid method, and will see, that only two values are correct now, and it is comment and error. I'm sure you understand category comment. So, error used when developer managed to save source code with syntax errors in class definition, and that text will be in UDLText and with category error.

Related

Documentation of OCaml code in Eclipse

I'm using Eclipse with the OcaIDE-Plugin to write my ocaml-project.
I have written several ocaml-functions that I want to document (comment, return values and params).
I've created my documentation in the .ml-files like described in this link: http://caml.inria.fr/pub/docs/manual-ocaml/ocamldoc.html
Here is an example of one function:
(** sorting tuples where first element is key *)
let my_comp x y = (*Some code*)
Unfortunately, my comments don't show up, when I press F2 at one of the functions, it only shows the name and the file it is contained.
When writing comments in an mli-file, it works as expected, but i also want to document "private" functions that are not accessible from the outside. Can I define functions in the mli, that are NOT accessible from the outside, just for the documentation?
How can I make Eclipse to show my documention?
Well, as you said, you would like to show the documentation but not export the function out of the module. That, sadly, won't work.
I guess OcaIDE can be considered as incomplete but it doesn't look like it's something people care about (I don't know a single person working on OcaIDE). If you like having autocompletion etc, maybe try to program with emacs and install merlin (look, I found the perfect post for you : here)
As for the suggestion of defining a function in the mli not accessible from the outside, it's completely opposed to why mli files are created, so don't expect that to be possible. ;-)
I hoped I've been able to help you.

Lazarus: How do I find detailed docs (class info) of objects?

Is there a way to find complete class info of an object in Lazarus. F1 doesn't work.
For example, I want to know the methods, events and properties of TSQLQuery. More specifically, I'm trying to find what constants I can use with the state property.
The docs I've found so far aren't really much help in this context.
I've also tried the menu that says 'object browser' but it simply points to the properites window.
TSQLQuery and its unit sqldb is not documented.
The state property however is from the base tdataset ancestor of sqlquery, and that IS documented.
Try typing TDatasetstate or tdataset and press F1
The best documentation is the source code. After you dropped a TSQLQuery on the form CTRL-click on the identifier "TSQLQuery" in the source editor. Lazarus will open the corresponding source file at the position where TSQLQuery is declared. Scroll down to the public methods or published properties to see everything you need. Identifiers usually are self-explanatory - the chm file often does not contain more info. And the source is always up-to-date.
You can do the same with any identifier. Depending on the Lazarus version you may land in the implementation part of the unit. In this case, just press SHIFT-CTRL Up/Down to go to the interface.

Name and location of snippet for Menu with param in LiftWeb?

Sorry if this sounds stupid but I'm really new to LiftWeb and just struggling with the basic stuff:)
So I have a parametrized site map entry in Lift's bootstrap. This should be for the view page of an object of type MyItem. The URL would be like: "/myitems/UUID".
Menu.param [UUID]("MyItemView", "MyItemView", p=>Full(UUID.fromString(p)), p=>p.toString) / "myitems"
This adds the sitemap entry correctly. If I go to "/myitems/NOT_AN_UUID", it will throw the "Invalid UUID" exception as expected. But if I go to "/myitems/UUID" I get 404.
I know that I need a view and a snippet class that takes UUID as parameter in order for this to work but I have no idea how to name these and where to place them.
Btw, how would one new to Lift learn something like this? From the hundreds of articles and samples out there I found many to mention more complex stuff but haven't seen any to mention a basic thing like this. Do you know any secret start-up documentation for human beings?
Update: To summarize in case all you see above is jibber-jabber :) HOW DOES LIFT LOCATE TEMPLATES/VIEWS/SNIPPETS FOR PARAMETRIZED MENU ENTRIES?
It was actually the obvious answer. The template name is obtained from the path and the snippet can be whatever you want as long as you call it from the template xml.
I need to get used to all this convention over configuration :) However it would be nice for someone to tell you what is the convention.

WCF Data Service with EF fails to expose imported functions

(I am also using .NET 4.0 and VS 2010.)
I created a function import returning a complex type, as explained at http://msdn.microsoft.com/en-us/library/bb896231.aspx. The function import and new complex type appear in my .edmx file and in the Designer.cs file. However, the function does not appear when I view the service in the browser, and when I add or update a service reference in the client project, the function does not appear there either - as is to be expected, given the first result.
Creating an imported function and using it seems conceptually very simple and straightforward, and one would think it would just work, as Microsoft's step-by-step instructions appear to suggest: http://msdn.microsoft.com/en-us/library/cc716672.aspx#Y798 (which article shows the SP returning entity types - I tried this also, and it doesn't work for me either).
This blog post shows the addition of a method to the DataService class, which Microsoft's instructions omit: http://www.codegain.com/articles/wcf/miscellaneous/how-to-use-stored-procedure-in-wcf-data-service.aspx I tried adding one method returning a list of entity types and another returning a list of complex types, and still had no success. I still could not access the functions, either directly via the browser or from the client application via a service reference.
Thanks in advance for any help with this.
config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
MS would do well to add a note to the walkthroughs stating that the above bit of code must be there. (It may be better to enable each operation explicitly than to use "*".)
http://www.codegain.com/articles/wcf/miscellaneous/how-to-use-stored-procedure-in-wcf-data-service.aspx shows that line of code. Also, something it is there in the code, commented out, when one creates the WCF Data Service. Some of us like to delete commented-out code that we aren't using and that seems irrelevant - perhaps doing so a bit prematurely, sometimes.

CA: Suppress results from generated code not working in VS2010 beta 2

I'm trying to run codeanalysis on an assembly that contains an entity model (edmx file). In project properties I have checked the "Suppress results from generated code" option, but I am still getting a lot of CA errors pertaining to the auto-generated EF code.
Has anyone experienced this? And is there a work-around?
Just put the attribute on your class definition.
But how to do it, since your file can get overridden any time. Use a separate file, since all generated classes are partial classes. Open a separate file, and write something like:
[GeneratedCode("EntityModelCodeGenerator", "4.0.0.0")]
public partial class YourEntitiesContextName : ObjectContext
{
}
This will skip code analysis on your particular generated class. StyleCop for instance is more smart and doesn't touch files that have .designer/.generated part in their name or regions that have generated word in their name.
Well, "Suppress results from generated code" really means "Don't look at types with GeneratedCodeAttribute". EF's code generator hasn't added this, historically (though I've suggested it to the team). But you can add it if you use custom T4.