{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs-vs-code.sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"VS Code extension","type":"markdown"},"seo":{"title":"Type hints vs Cursor context","description":"OpenAPI-generated documentation tool with 24k+ stars on Github - make APIs your company's superpower.","siteUrl":"https://redocly.com","image":"/assets/redocly-card.f670aae34a39545a5ea633a540cb3a4a333a1f23bb2ed3c4a1b17a5fbcf0ac85.db81178d.png","lang":"en-US"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"type-hints-vs-cursor-context","__idx":0},"children":["Type hints vs Cursor context"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Redocly OpenAPI VS Code extension now includes ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/vscode/type-hints"},"children":["Type hints"]},", a lightweight alternative to ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/vscode/cursor-context"},"children":["Cursor context"]}," for identifying node types."," ","With type hints you can find the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subject"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["property"]}," values you need for ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/cli/rules/configurable-rules#configurable-rules"},"children":["configurable rules"]}," by hovering over any node in your API description (OpenAPI, AsyncAPI, Arazzo, and others)."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example-enforcing-snake_case-operation-ids","__idx":1},"children":["Example: enforcing snake_case operation IDs"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Suppose you need to change all operation IDs to use snake_case instead of camelCase."," ","To avoid missing any operation, let's create a configurable linting rule that checks every operation ID in the OpenAPI document."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When writing your rule, you need to target a specific ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/learn/openapi/openapi-visual-reference/openapi-node-types"},"children":["node"]}," with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subject"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["property"]}," to which the rule applies."," ","To find these values, you can either use Cursor context or Type hints."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"use-type-hints","__idx":2},"children":["Use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/vscode/type-hints"},"children":["Type hints"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/vscode/type-hints"},"children":["Type hints"]}," to find the values of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subject"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["property"]},":"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Hover over ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["operationId"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Read ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subject"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["property"]}," directly from the tooltip."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/openapi-vscode-type-hints.948db67592b731992eb448ddf8c514b460abafaf9a1b24d7faa2e7330b8ee11e.289fb047.png","alt":"type-hints-tooltip"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This approach requires fewer steps and keeps you inside the immediate context of your work, without affecting your focus."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"use-cursor-context","__idx":3},"children":["Use Cursor context"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/vscode/cursor-context"},"children":["Cursor context"]}," to find the values of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subject"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["property"]},":"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Place your cursor on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["operationId"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the Cursor context panel."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Find ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subject"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["property"]}," in the panel."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/openapi-vscode-cursor-context-migration.d1c4d06aa746a94c3f376729ded1883104b1907402b434c93deca01cb32a67a4.289fb047.png","alt":"cursor-context-panel"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"rule-configuration","__idx":4},"children":["Rule configuration"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"extends:\n  - recommended\nrules:\n  struct: error\n  rule/id-casing:\n    subject:\n      type: Operation\n      property: operationId\n    assertions:\n      casing: snake_case\n","lang":"yaml"},"children":[]}]},"headings":[{"value":"Type hints vs Cursor context","id":"type-hints-vs-cursor-context","depth":1},{"value":"Example: enforcing snake_case operation IDs","id":"example-enforcing-snake_case-operation-ids","depth":2},{"value":"Use Type hints","id":"use-type-hints","depth":3},{"value":"Use Cursor context","id":"use-cursor-context","depth":3},{"value":"Rule configuration","id":"rule-configuration","depth":3}],"frontmatter":{"seo":{"title":"Type hints vs Cursor context"}},"lastModified":"2026-04-08T18:31:47.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/vscode/type-hints-vs-cursor-context","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}