Last active
June 14, 2025 08:14
-
-
Save nberlette/3affe0e211a6cf5e5c1c8ca9909e9524 to your computer and use it in GitHub Desktop.
Nick's Copilot Instructions and Settings for VSCode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"files.watcherExclude": { | |
"**/.coverage/**": true, | |
"**/docs/**": true, | |
"**/target/**": true | |
}, | |
"deno.enable": true, | |
"deno.lint": true, | |
"deno.codeLens.test": true, | |
"deno.cacheOnSave": true, | |
"editor.tabSize": 2, | |
"editor.stickyTabStops": true, | |
"editor.linkedEditing": true, | |
"editor.minimap.enabled": false, | |
"editor.defaultFormatter": "denoland.vscode-deno", | |
"editor.formatOnSave": true, | |
"lldb.executable": "/usr/bin/lldb", | |
"github.copilot.enable": { | |
"dotenv": false, | |
"properties": false | |
}, | |
"github.copilot.chat.followUps": "always", | |
"github.copilot.chat.scopeSelection": true, | |
"github.copilot.chat.terminalChatLocation": "terminal", | |
"github.copilot.nextEditSuggestions.fixes": true, | |
"github.copilot.nextEditSuggestions.enabled": true, | |
"github.copilot.chat.codesearch.enabled": true, | |
"github.copilot.chat.agent.thinkingTool": true, | |
"github.copilot.chat.completionContext.typescript.mode": "on", | |
"github.copilot.chat.editor.temporalContext.enabled": true, | |
"github.copilot.chat.generateTests.codeLens": true, | |
"github.copilot.chat.languageContext.fix.typescript.enabled": true, | |
"github.copilot.chat.languageContext.inline.typescript.enabled": true, | |
"github.copilot.chat.languageContext.typescript.enabled": true, | |
"github.copilot.chat.testGeneration.instructions": [ | |
{ | |
"text": "This project uses Deno for development, including all testing, benchmarking, and linting, but targets multiple runtimes: Deno, Node, Bun (which all support Node APIs), as well as Cloudflare Workers and browsers (where applicable)." | |
}, | |
{ | |
"text": "Unit tests should use the BDD framework available from \"jsr:@std/testing@1/bdd\", which has `describe`, `it`, `beforeEach`, and `afterEach` features. The `expect` API is available via \"jsr:@std/expect@1\". Assertions are available via \"jsr:@std/assert@1\", or via \"node:assert\" (which is built-in to Deno). TypeScript is used for all code. Relative imports should include the .ts file extension. Use `deno fmt` to format code, `deno lint [--fix]` to lint it, and `deno test` to run tests. Benchmarks can be defined using `Deno.bench` and run with `deno bench`. Use `deno task` to run tasks defined in the `deno.json` or `package.json` file." | |
}, | |
{ | |
"text": "For Rust crates in the codebase, tests should be defined inline in the source module, unless there are many tests or I specifically request otherwise, in which case they should be placed in a `tests` directory at the root of the crate. For code thats being compiled to WebAssembly, use the appropriate wasm-bindgen testing tools and conventions." | |
}, | |
{ | |
"text": "For all tests we generate, regardless of language, be sure you cover as many edge cases as possible, and ensure that the tests are comprehensive and robust. Use real-world test fixtures, and avoid using unrealistic mocks or stubs unless they truly represent the behavior of the code in production. The goal is to ensure that the tests are as close to real-world usage as possible, so that they can catch any potential issues before they reach production. If you are unsure about how to write a test for a specific piece of code, please ask for clarification or guidance." | |
} | |
], | |
"github.copilot.chat.codeGeneration.instructions": [ | |
{ | |
"text": "This dev container includes the GitHub CLI (`gh`), which is pre-installed and available on the `PATH`. IMPORTANT: `gh api -f` does not support object values, use multiple `-f` flags with hierarchical keys and string values instead. When using GitHub actions `actions/upload-artifact` or `actions/download-artifact` use v4 or later." | |
}, | |
{ | |
"text": "This project uses Deno for development, including all testing, benchmarking, and linting, but its packages target multiple runtimes: Deno, Node, Bun (which all support Node APIs), as well (where applicable) as Cloudflare Workers/Deno Deploy/browsers. TypeScript is used for all code." | |
}, | |
{ | |
"text": "Relative imports should include the .ts file extension. Do not import files from the `deno.land/x` registry, as it is deprecated. Instead, you can use `jsr:` specifiers to import from the JSR registry, which is the new standard for Deno modules. For example, use `jsr:@std/fmt@1/colors` instead of `https://deno.land/[email protected]/fmt/colors.ts`." | |
}, | |
{ | |
"text": "The JSR registry is available at https://jsr.io, and you can find the latest versions of the standard library packages at https://jsr.io/@std. I (Nicholas Berlette, @nberlette) publish packages to JSR under several scopes: @nick contains personal/general purpose packages, like @nick/is (type guards), @nick/lz4, @nick/brotli, @nick/utf8, @nick/atob, @nick/url, @nick/braces, @nick/math, etc. The @iter namespace is where I publish iteration-related tools, like @iter/weak-map and @iter/weak-set. The @decorators namespace is self-explanatory; its for stage 3 decorators. You can use any of my packages as dependencies, but keep other external dependencies to a minimum." | |
}, | |
{ | |
"text": "If you need to use a package from npm, use the `npm:` specifier, like `npm:lodash`. For Rust code that's being compiled to WebAssembly, we use the wasm-bindgen toolchain pinned to version 0.2.100, js-sys/web-sys (if needed) at version 0.3.77, and serde-wasm-bindgen at 0.6.5. We use jsr:@deno/[email protected] to compile the Rust to WASM." | |
}, | |
{ | |
"text": "Do not use `private` or `public` modifiers in classes, as they provide no benefit whatsoever. For truly private members, use the `#` syntax, like `#privateMethod = () => { ... }` (note the use of a field instead of a method, to ensure its `this` context is permanently bound to the instance/class). For public members, omit the modifier. For protected members, `protected` can be used, but conservatively. For internal members we will need to use outside the class, either use symbols for keys, or create an internals object defined outside the class, but initialized within a static block (the only way to access #private members from outside the class). The latter is preferred for APIs that we REALLY dont want users to access, ever. Example: `const internal = {} as { set_cache: (cls: Foo, cache: Map<string, any>) => void; get_cache: (cls: Foo) => Map<string, any> }; class Foo { static { internal.set_cache = (cls, cache) => { cls.#cache = cache; }; internal.get_cache = (cls) => cls.#cache; } #cache = new Map<string, any>(); /* ... rest of class ... */ }`." | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment