You can use VS Code workspaces with the Palantir extension for Visual Studio Code to import resources, preview functions, manage branches, commit and publish changes, upgrade your repository, and use local development tools without leaving the editor.
Before you use Foundry resources in a function, import them into your repository:
To get the latest available resource types, make sure your repository is up to date via repository upgrades. Learn more about importing Ontology types.
Select the Palantir icon in the Activity Bar to open the Palantir panel - this panel provides branch, preview, commit, publishing, and repository management actions.
Use the Branch section to create or switch branches before you begin editing:
Global branch support depends on the functions language and repository configuration. Learn more about branching in VS Code, branch options in Code Repositories, and developing and publishing functions on a global branch.
If you are developing on a global branch, the preview runs against the branch currently selected in the Palantir panel. Learn more about testing functions in live preview.
When your preview and tests succeed:
Tagging publishes all functions in the repository, not only the function you most recently edited.
Learn more about publishing functions and function versioning.
Select Upgrade in the Changes section to start a repository upgrade. Review the generated changes, run your tests and function previews again, and then commit the upgrade. Learn more about automatic and manual repository upgrades.
The following sections describe optional VS Code features and shortcuts that can speed up functions development.
Open the integrated terminal and change to the functions-typescript directory, which contains the functions project's package.json file. TypeScript v1 and TypeScript v2 functions repositories use the same path:
Copied!1 2cd functions-typescript npm test
Run npm run to list the scripts available in the current project. For more information about the included test framework, review unit testing functions.
Open Settings, search for format on save, and enable Editor: Format On Save. Press Cmd+S (macOS) or Ctrl+S (Windows/Linux) to save the current file and run the configured formatter. You can also run Format Document from the Command Palette.
Learn more about formatting in VS Code ↗.
Palantir MCP is integrated into VS Code workspaces by default and provides context tools for TypeScript function repositories, so the Continue extension can reference your functions code, imported Ontology resources, and Foundry context.
Learn more about AI development tools in VS Code workspaces and Palantir MCP.
VS Code includes shortcuts that can reduce context switching:
| Action | macOS | Windows/Linux |
|---|---|---|
| Open the Command Palette | Cmd+Shift+P | Ctrl+Shift+P |
| Quickly open a file | Cmd+P | Ctrl+P |
| Search across the repository | Cmd+Shift+F | Ctrl+Shift+F |
| Go to a symbol in the current file | Cmd+Shift+O | Ctrl+Shift+O |
| Go to a symbol's definition | F12 | F12 |
| Find references to a symbol | Shift+F12 | Shift+F12 |
| Rename a symbol and update its references | F2 | F2 |
| Show available quick fixes | Cmd+. | Ctrl+. |
In Quick Open, add a colon and a line number after a file name, such as myFunction.ts:42, to jump directly to that line. You can also hold Option (macOS) or Alt (Windows/Linux) while selecting locations to add multiple cursors and edit repeated code at the same time. Review the default VS Code keyboard shortcuts ↗ for the complete list.