# @cspell/dict-cpp 中文文档

规范地址：https://npmcn.com/package/%40cspell/dict-cpp/

版本：7\.2\.0
npm 元数据更新时间：2026-10-21T19:19:09.264Z
中文译文更新时间：2026-11-11T03:11:11.913Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40cspell/dict-cpp
原文对照：https://npmcn.com/package/%40cspell/dict-cpp/?lang=original
项目主页：https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/cpp#readme
源码仓库：https://github.com/streetsidesoftware/cspell-dicts

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：345 kB，9 个文件
- TypeScript 类型：未声明
- 运行依赖：0 个
- 首次发布：2020-11-28T01:07:14.558Z
- 最新版本发布：2026-10-21T19:19:08.765Z
- 近 30 天下载量：8194393（2026-10-11 至 2026-11-09，npm 官方下载统计）
- 已发布版本数：75（近 12 个月 9 个）

## 中文简介

页:1 cspell 词典.

## 安装

```sh
npm install @cspell/dict-cpp
```

也可以使用：`pnpm add @cspell/dict-cpp`、`yarn add @cspell/dict-cpp`、`bun add @cspell/dict-cpp`

## README

# CSpell C/C++ 软件 词典

页:1 cspell 词典.

这是一个预建的词典,用于Cspell.

## 所需资源

| 工具 | 版本 |
| --- | --- |
| [点球](https://github.com/streetsidesoftware/cspell) | `>=8` |
| [代码拼写检查器 - 视觉工作室代码](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) | `>=4` |

## 本地安装

**这个包裹被CSpell捆绑.**

## 配置

VSCode 设置

在您的 VSCode 设置中添加以下内容:

**`.vscode/settings.json`**

```jsonc
{
  "cSpell.dictionaries": ["cpp-legacy", "cpp", "cpp-compound-words", "cpp-refined", "cuda"],
}
```
CSpell 设置 `cspell.json`

**`cspell.json`**

```jsonc
{
  "dictionaries": ["cpp-legacy", "cpp", "cpp-compound-words", "cpp-refined", "cuda"],
}
```
CSpell 设置 `cspell.config.yaml`

**`cspell.config.yaml`**

```yaml
dictionaries:
  - cpp-legacy
  - cpp
  - cpp-compound-words
  - cpp-refined
  - cuda
```

## 使用 CDN 本地安装

> **注:** 这个包裹被CSpell捆绑.

## 词典信息

| 名称 | 已启用 | 说明 |
| --- | --- | --- |
| `cpp-legacy` |  | 遗产 C/C++ 关键词和常用库功能. |
| `cpp` |  | 页:1 关键词和常用库功能. |
| `cpp-compound-words` |  | 页:1 常用词复合. |
| `cpp-refined` |  | C/C++改进后的清单 关键词和常用库功能. |
| `cuda` |  | CUDA关键词,内置,运行时间和库功能. |

## 语言设置

| 名称 | 语言 | 文件类型 |
| --- | --- | --- |
| `cpp-legacy` | `*` | `c`, (中文(简体) ), `cpp`, (中文(简体) ), `cuda-cpp` |
| `cpp` | `*` | `c`, (中文(简体) ), `cpp`, (中文(简体) ), `cuda-cpp` |
| `cpp-compound-words` | `*` | `c`, (中文(简体) ), `cpp`, (中文(简体) ), `cuda-cpp` |
| `cpp-refined` | `*` | `c`, (中文(简体) ), `cpp`, (中文(简体) ), `cuda-cpp` |
| `cuda` | `*` | `c`, (中文(简体) ), `cpp`, (中文(简体) ), `cuda-cpp`, (中文(简体) ), `python`, (中文(简体) ), `julia`, (中文(简体) ), `fortran`, (中文(简体) ), `FortranFreeForm`, (中文(简体) ), `FortranFixedForm` |

## 页:1 复合词

C/C++代码中包含单词复合词很常见,比如: `errorcode` 财务报告和审定财务报表 `hashcode`。 。 。 . 这个 `cpp-compound-words` 词典旨在帮助避免虚假的阳性. 但是,这可以 指由于化合物的结合方式,有效错误被隐藏.

下列配置可用于禁用复合词典:

```yaml
languageSettings:
  languageId: 'c,cpp,cuda-cpp' # '*' can be used to disable it for all file types.
  dictionaries:
    - '!cpp-compound-words'
```

## 捐款

请帮助纠正字典中的错误 .

见: [捐款](https://github.com/streetsidesoftware/cspell-dicts#contributing)

特别感谢我们所有出色的贡献者!

### 词典发展

见: [如何创建新词典](https://github.com/streetsidesoftware/cspell-dicts#how-to-create-a-new-dictionary)

## 许可证

麻省理工学院

> 有些包裹可能还有其他许可证.

  

* * *

带给你的 [![Street Side Software Logo](https://i.imgur.com/CyduuVY.png) 街边软件](https://streetsidesoftware.com/ "Street Side Software")

## 常见问题

### @cspell/dict-cpp 是什么？

页:1 cspell 词典\.

### 如何安装 @cspell/dict-cpp？

在项目目录运行 npm install @cspell/dict-cpp，或使用 pnpm add / yarn add / bun add。

### @cspell/dict-cpp 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/cspell\_\_dict-cpp 是否存在。

### @cspell/dict-cpp 可以商用吗？

@cspell/dict-cpp 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @cspell/dict-cpp 的下载量有多少？

根据 npm 官方下载统计，@cspell/dict-cpp 在 2026/10/11 – 2026/11/09 这 30 天内被下载 8,194,393 次，日均约 273,146 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @cspell/dict-cpp 还在维护吗？

最新版本 7\.2\.0 发布于 2026/10/22（20 天前）；至今共发布 75 个版本，其中过去 12 个月发布了 9 个；首次发布于 2020/11/28。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

