Do I have to manually parse the document to show SignatureHelp? - visual-studio-code

I'm creating an extension to add support for a custom language on VS Code and I'm struggling on providing Signature Help because I can't seem to find a way to tell what signature I should show the user unless I manually parse the entire document to find out what is expected.
My question is, does VS Code API provides some way for me to tell the function/etc where the user is when the provider is invoked or do I have to parse the document manually so I can find it by myself?
I'm using the "direct implementation" way (without language servers), if that matters.
I hope my question is clear, thanks in advance.

Related

How to get highlighted text from active terminal in VSCode Extension API

I am trying to build an extension using the VSCode API in which I need to get user's selected text wherever it is either in the activeTextEditor or activeTerminal. I see the way of getting the text from the selection for activeTextEditor. However, I am not able to find a way to get the highlighted text from activeTerminal. Appreciate any help on this.
vscode.window.activeTerminal
It seems there is no API available for that. You have the activeTerminal, but not the content the user selected.
The closer API request I found what this one (https://github.com/microsoft/vscode/issues/47615), which was in fact connected with the activeTerminal API.
So, if you really need this feature, you should open a feature request in VS Code repo (https://github.com/microsoft/vscode/issues/new/choose) asking for this new API.
Hope this helps

How to make vs code extension take in user path input and how to create coding templates

for my internship I am making an VS code extension. I have never developed anything like this before so any help or documentation links or tips are welcome.
what I am doing is as follows: develop an extension that is capable of taking in user input. the input will be a path to an .isf/.hdf file. this could be thru the simplest of text box buttons initially, as functionality before polish is what im focusing on right now.
It also needs to be able to provide templates with preconstructed code. such as, a option on the file menu where it might say "new template.py file". And when this option is choosen, a .py file with a lot of "boiler-plate" or preconstructed code is created for them.
im also using CanvasJS to show some graphical data. I would need a way for the graph to appear in a tab/window of the VS Code rather than the browser of the user.
Thank you in advance! Please let me know how to edit/add to this question, I know its extremely vague. Still a novice but excited to get this extension developed!
P.S.
im not expecting anyone to DO this for me, just to point me in the general direction so I can sink my teeth into useful documentation, examples, and/or tutorials. Thanks again :)

How can I add these code completion features my VSCode extension?

I'm in the process of creating a VSCode extension to do code completion for an existing Lua API.
I'm having a bit of trouble achieving the following (examples are JavaScript):
I've been looking for examples and tutorials but haven't come up with much. I assume I may need to do a fair amount of string processing, around the current cursor position, to get enough data to lookup the appropriate documentation (which I stored in an array of json objects). But presently I don't know how to get the meta-data dialog to show when entering parameters.
P.S. I have reviewed the official extension samples.
Your screenshots show two VS Code features:
The first screenshot shows a hover / quick info. It is used to display information about the current word the user is hovering over. To add a hover, your extension should implement and register a HoverProvider
The second screenshot shows parameter hints / signature help. It displays information to the user as they complete a function call. To add signature help, your extension should implement and register a SignatureHelpProvider
In both cases, how you implement the functionality is entirely up to your extension. Most language extensions maintain a structural representation of the file (such as an AST) and use this to provide hover and signature help info.
You can also either implement your extension as a direct VS Code extension or using the language server protocol (which works across editors). See VS Code's Language Extensions Overview for more information about developing a language extension and why you may want to consider the Language Server Protocol

using "add fetch request" in Xcodes UI

It seems that there is a convenient way to use fetch controllers using the UI of xcdatamodel. I tried to use it but could not figure out how you actually implement the fetch once I have created it. anyone have some experience with this? A link? And most of all, is it possible to comfortably add this to a fetchResultsController?
Thanks!
EDIT: the answer here core data simple fetch request template in swift helped me use the tool but I feel like it is not a full answer. (Thank you shallowThought)

Search a string/text from a PDF file and list all the matched string in iPhone/iPad application

I have implemented an iPad application which is actually read the PDF file(using quartz). Now I want to implement the Search Feature and for this I have checked some tutorial some where mentioned using quartz and some where mentioned FastPdfKit. But I don't know which one will be better. I have seen the quartz ( https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf_scan/dq_pdf_scan.html ).
I have some doubt in this.
the "Callbacks for Operators" what and why we use this?
"Operators Table" what is the purpose of this? and
Where we will put the search text.
Please suggest me in this regards or provide any other open source which I can use.
Thanks in advance.
CGPDFScanner is a fairly low-level API which allows you to selectively scan for various PDF operators and invoke callbacks on each operator. It does require you to have some knowledge of PDF structure, but it will do the job. A PDF operator is a command in a PDF file which does some operation (usually manipulating the drawing state, e.g. writing text, drawing lines, changing graphics state, etc.).
Essentially, you tell the scanner what PDF operators you are interested in, and tell it what callback you want to invoke. In your case, you are interested in the text operators TJ, Tj; see this page for a working text search example using this API, and this question for some other answers on text search.
You may get your answer at FastPdfKit. Please let me know if you still more information. I think this will solve your purpose.
#Subodh S: At the momment, PDFKitten does not support multi-words query. Therefore, your keyword is not searched and highlighted. You must handle yourself in source code and even change some points in PDFKitten.