How to implement java intellisense for monaco editor - abstract-syntax-tree

We are doing online code editor using monaco editor.
One of the requirement is to provide intellisense, or code auto-complete for java/python language. I searched so many resources, and can not find any useful resource on introduction how to make auto-complete working. some said using language server, but it is really difficult to make it work.
May I ask what is the best way to make auto-complete working for java language? Are there any good material that I can refer? Or can we just use some json files to make auto-complete work as well?
I read LSP4J protocol and I understand the philosophy and solution for language server, but now, my question is how to get data file. In another word, how to create CompleteItem objects and return?
Some resource said we need to build java language AST or Source processor(string processor)? Are there any java library I can use directly?
I don't want to use eclipse here, we need to provide our own service.
Thanks

You can use the Language Server Protocol, as described here for python:
https://stackoverflow.com/a/71349842/10985072
For Java, you can use georgewfraser's java-language-server for example.

Related

Getting started Alfresco development

I want to develop Document Manager application based on Alfresco. I am going to change there many things: user interface, language, may be some functions... But I don't know how to start, where I can get Alfresco source code, how can I rewrite codes with netBeans and how can I test my changes. This is my first serious project so I need any help. Where I can get Started ?!
A very popular way to get started is to work through my tutorials.
You don't need the source code, although it is available and helpful when you are troubleshooting or learning how something works. Instead of forking Alfresco you will write extensions that customize the platform. If you find yourself needing to compile Alfresco's source code, most likely you are doing something wrong.

How to display a query results from Open CMIS, Alfresco?

Newcomer to Alfresco and Web Development here, so bear with me. I've so far installed Alfresco and was able to use the Maven AMP archetype to create my own custom content model for the data I need to store in it. Now I need to access this data from an external site by querying the Alfresco repository.
I've followed what I can find on CMIS and was able to execute a query using curl and get the results I expect in a large XML stream. My colleague was having an uphill battle trying to interpret these results using Coldfusion. Now I searched around, and understand that to interpret these results and make the process a bit easier, it is better to use some kind of client like Open CMIS (or Chemistry, I'm still a bit confused on the terminology here).
We've so far tried the the PHP client, but received some errors from the xmlLoad function not reading 'nbsp' characters. PHP seemed like the easiest version to implement, though we're considering moving to Java if that works better. However, we've seen very scarce documentation on either end. Are there some better examples that we may have missed or maybe some other way to do this? Seems like this should be simple to implement, yet it's given us quite the stall due to the brick wall that Alfresco and CMIS seem to be.
If you don't want to use a library, the CMIS Browser Binding might work better for you. It returns JSON instead of XML.
Try:
http://<host>/alfresco/api/-default-/public/cmis/versions/1.1/browser?cmisselector=query&succinct=true&q=SELECT * FROM cmis:document
Shouldn't be a brick wall at all. Here are some resources:
The custom content types tutorial has a section on CMIS,
including CMIS queries which may be helpful to you even if you do not need custom types
The CMIS & Apache Chemistry book from
Manning is a good resource (disclosure: Florian and I co-authored it
along with another colleague, Jay Brown)
There are some Java examples on Google Code
There are additional resources and helpful links on the Alfresco CMIS page

How to use sqlite with Borland C++ Builder

I have sqlite3.dll but I'm assuming it's far more complex than simply including that file in a project and then using its functions. Even if it was I have literally no experience using pre-built DLLs with C++ Builder applications.
So my question is, How would I go about using sqlite in a Borland c++ builder application? As simple an explanation or step-by-step guide as possible is preferable as my ability to do anything beyond creating apps with C++ Builder is severely limited.
Failing that, is anyone aware of a web article that answers the same question? I'm aware that sqlite3 has its own documentation section but I found it hard to follow and some vital links are broken.
Failing that... Is there a better way to create small-scale easy to write for a beginner apps that make use of a sql database?
Just to be clear - I don't want to make use of a sql server. I want to write something that at its minimum is an executable file, a database file, and a library file in the same directory. In other words something I can distribute easily.
edit: I'm using Borland C++ builder 2009.
Did you try sqlite amalgamation? Basically it's just one source file to include in your project. If you compile through, you can use it.
See http://www.sqlite.org/download.html.

What language can be used to automate web test?

I'm working on a Web Service which is associated with a form that requires inputs from user. The problem is the fields are quite large, approximately 200 fields need to be filled in. I would like to ask what language would serve best in this case, in term of automating inputs.
I tried Ruby with Watir, but it doesn't work as expected when dealing with iframe. So I'm looking for an alternative solution. Any feedback or suggestion would be greatly appreciated. My WS is developed using ASP.NET and Java Script.
Thanks,
Chan
Selenium may provide the functionality you're looking for. It is a testing framework that supports recording tests, so writing scripts is optional. It does however provide scripting functionality in a variety of languages, including Java, C#, Ruby, Python and more.
Have you tried WatiN? It is an open source automated test framework for Web application. And it support C# and other managed languages.

Add ons in a compiled language

We are developing a CMS in ASP.NET. We love the idea of add-ons (like in Wordpress, where any developer can add a menu button or a widget) and would like to enable developers to do the same with our system.
However I think that the fact that C# is a compiled language is an obstacle in the way of add-ons.
Am I right? Or is there a way to create add-ons for a ASP.NET application?
The fact that C# is a compiled language isn't a problem at all. In fact the .NET framework should make it relatively easy to load other code (just as Java does, for the same reason). Look into the Managed Extensibility Framework, which is all about loading Add-Ons in managed code.
It's not an obstacle at all. MEF has already been mentioned, you could also use:
System.Addin
Mono.Addins
I'm not sure for ASP.NET specifically, but in the only compiled programming language I know (Objective-C/Cocoa), there's the concept of Bundles that can be loaded dynamically. I'm not sure how that works on the backend, but I'd guess that there is some similar system for C#/ASP.NET.
I don't know how it's done in Wordpress, but there should be many ways. You can allow developers to upload their assemblies with compiled code or you can allow them to upload code in C# or IronPython or anything that supported and compile it dynamically. Maybe you can use WebParts for your task.
Microsoft has created the Managed Extensibility Framework (MEF), specifically for this problem: providing .NET plugins for .NET applications. It is the framework that (future versions of) Visual Studio use for writing managed plugins.
However, please consider using a dynamic scripting language for this! Problems like this are exactly what they are specifically designed for. If you host the Dynamic Language Runtime in your application, it not only means that your users can extend the application in a scripting language, but even in any dynamic language (scripting or otherwise) for which a DLR implementation exists: Ruby, Python, Smalltalk, Scheme, JavaScript, PHP, you name it. Biggest disadvantage: the DLR hasn't been released yet.
In C#, you can create any assemblies, link them as DLL files and then do whatever you want.
The usual case would be to define some kind of Plugin Interface which must be implemented by all the plugins.
Then you can load all plugins from the filesystem (by iterating over the plugin DLLs), find the class inside which implements the interface, instantiate it and work with it.
If you want to provide plugins with unloadability and security, you could create an application domain and load the plugins to that, increasing complexity, but also increasing stability (a bad plugin won't crash your app).
Please ask more specifically if you want a specific answer :-)
It's not too difficult to put hooks in place. You have to define in advance where the add-on features will appear. For example: when drawing a menu you can use reflection to search other dlls (with specific names and locations) for a "BuildMenu" function. You'll be defining the API for this function signature. It may have to return a list of items to be added to the base menu items collection.

Resources