Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

5 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi all, I've started messing around with the "new" LSP that comes with RAD Studio Community while trying to write an extension for it. I'm using this repo for communicating with the language server but it seems like the only supported request types, according to the IsRequestSupported method, are: DidOpenTextDocument DidChangeTextDocument WillSaveTextDocument WillSaveWaitUntilTextDocument DidSaveTextDocument DidCloseTextDocument PublishDiagnostics Completion CompletionItemResolve Hover SignatureHelp GotoDeclaration GotoDefinition GotoTypeDefinition GotoImplementation What is weird is that, when using the IsRequestSupported method, "Initialize" and "Initialized" seem not to be supported. But their respective Handlers are called when sending the request, as far as I can see the method simply doesn't check those request types since the server needs to support them to do anything at all. Either way the request type I'm interested in (DocumentSymbol) appears not to be supported. According to picture below (source) find references and symbol search are not supported but have a checkmark anyway. Not sure if the checkmark is a mistake or if there is something I don't understand I would like to know if the listed request types are really all the Delphi language server supports and/or if there is a way the get, in my case symbol information, from the server despite not supporting it directly.
  2. I do know about CnPack and I've used it before but I don't think it supports the kind of highlighting based on symbol types that tree-sitter generates. As an aside I would like to make my highlighting work alongside extensions like CnPack but right now the drawing performance goes out the window if I have CnPack running as well. If someone can point me to an example where this has been done I would very much appreciate it.
  3. Hi all, I've always missed a modern implementation of a syntax highlighting in RAD Studio. So when I saw a github repo containing pascal grammar for Tree-sitter, I started working on an IDE extension that makes use of it. Since there are no Delphi bindings for Tree-sitter I wrote a simple TCP Server in Rust, which receives the currently opened source code, parses it and generates the highlight information. After this information is sent back to the IDE I use it to draw more informative highlighting. Simple example below. I'm not sure about the performance, since it sends the code, parses and sends back the entire ToolsApi.pas file with 83k lines in 421 milliseconds. But it doesn't need to reparse the entire file on changes so it should be able to provide real-time highlighting, although I haven't implemented that yet. Now the grammar isn't finished and I haven't really looked into how to write grammar files, plus I really don't know enough about the Pascal and Delphi language to undertake something like that. The Point of this post is to gauge if there is even any interest for an extension like this.