This is one of the most powerful yet simple features within cursor.
We can use official documentation from popular libraries to ensure that our LLM is using the latest methods.
In this video, I'm going to show you two ways of how I use documentation inside of my cursor project.
Each way has its own pros and cons, so you can adapt this setup for whatever you prefer.
The first way is to use the @docs feature. To start using it, just type the @ symbol inside of a chat and click on docs. When you're there, you'll see some of the other documentation that I've already added, as well as some official libraries that I didn't add myself.
Back in Google Chrome, I already have the super-based edge functions documentation open. And this is because I know that we're going to be using ed functions in this project.
So we'll grab the link and put it back into cursor. But the caveat here is that we should only use specific documentation for what we want. Otherwise, we could get a bunch of other unnecessary files that'll just clutter our code base and project documentation.
If you go to your settings and scroll to the docs section, you'll see all the docs that you've added, So you can edit the link or delete them here.
One caveat is that this is not project specific. So when you upload documentation, it'll be live in all of your cursor projects.
These libraries can be really big, so it can be a little bit difficult to see what's included in them.
So that's why I also recommend that you use smaller documents so that you always know what's inside of them.
An alternative to the docs feature from cursor is to upload documents into your source control.
Here in my codebase, I have this local docs folder, which you can include in your getignore file, or include it if you want your teammates to also have access to the exact same documentation.
I like this because it solves two of the limitations that I mentioned in the @docs feature.
Since it's committed to your source control, you'll be able to see changes in the documentation if methods change from a certain library. Your teammates as well as you will be able to see the changes to this file over time.
However, you don't have to commit this to your source control and you can add the docs folder path to your gitignore file.