дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 17:21:13 +02:00
feat(cpp): grey out inactive preprocessor code, show macro expansions, create library projects (#7539)
Three C / C++ gaps. Code left out by an #if / #ifdef branch is greyed out from clangd's inactive-code semantic tokens in C, C++ and Objective-C(++). View > Show Macro Expansion shows what the macro at the caret expands to, from clangd's hover. New Project > C/C++ has a project type: Executable, or a static or shared Library with a public include/ folder.
The template engine dropped only a bare LF after a block tag, so on Windows, where Git checks the generators out with CRLF, every {{#if}} line left a blank line in the generated files. It now drops a CRLF too.
Co-authored-by: yohannlog <[email protected]>
Цей коміт міститься в:
1 джерело
d2699c430e
коміт
aa003541a3
18 files changed
+318
-25
No files matched your search
@@ -405,6 +405,46 @@ fn balanced(text: &str) -> bool {
|
||||
stack.is_empty()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cpp_projects_are_executables_or_libraries() {
|
||||
let read = |dir: &Path, file: &str| std::fs::read_to_string(dir.join(file)).unwrap().replace("\r\n", "\n");
|
||||
|
||||
let (_tmp, dir) = create_template("cpp", "My Lib", &[("lang", "cpp"), ("kind", "executable")]);
|
||||
assert_eq!(tree(&dir), [".gitignore", "CMakeLists.txt", "src/main.cpp"]);
|
||||
let cmake = read(&dir, "CMakeLists.txt");
|
||||
assert!(cmake.contains("project(my_lib LANGUAGES CXX)\n\nset(CMAKE_CXX_STANDARD 20)\n"), "{cmake}");
|
||||
assert!(cmake.contains("set(CMAKE_CXX_STANDARD_REQUIRED ON)\nset(CMAKE_EXPORT_COMPILE_COMMANDS ON)\n"), "{cmake}");
|
||||
assert!(cmake.ends_with("\nadd_executable(my_lib src/main.cpp)\n"), "{cmake}");
|
||||
|
||||
let (_tmp, dir) = create_template("cpp", "My Lib", &[("lang", "cpp"), ("kind", "library"), ("libtype", "static")]);
|
||||
assert_eq!(tree(&dir), [".gitignore", "CMakeLists.txt", "include/my_lib.h", "src/my_lib.cpp"]);
|
||||
let cmake = read(&dir, "CMakeLists.txt");
|
||||
assert!(
|
||||
cmake.ends_with(
|
||||
"\nadd_library(my_lib STATIC src/my_lib.cpp)\ntarget_include_directories(my_lib PUBLIC include)\n"
|
||||
),
|
||||
"{cmake}"
|
||||
);
|
||||
assert!(!cmake.contains("WINDOWS_EXPORT_ALL_SYMBOLS"), "{cmake}");
|
||||
assert!(read(&dir, "include/my_lib.h").contains("namespace my_lib {\n\nvoid hello();"));
|
||||
assert!(read(&dir, "src/my_lib.cpp").starts_with("#include \"my_lib.h\"\n"));
|
||||
|
||||
let (_tmp, dir) = create_template("cpp", "My Lib", &[("lang", "c"), ("kind", "library"), ("libtype", "shared")]);
|
||||
assert_eq!(tree(&dir), [".gitignore", "CMakeLists.txt", "include/my_lib.h", "src/my_lib.c"]);
|
||||
let cmake = read(&dir, "CMakeLists.txt");
|
||||
assert!(cmake.contains("project(my_lib LANGUAGES C)\n\nset(CMAKE_C_STANDARD 17)\n"), "{cmake}");
|
||||
assert!(!cmake.contains("CXX"), "{cmake}");
|
||||
assert!(
|
||||
cmake.contains("set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)\n\nadd_library(my_lib SHARED src/my_lib.c)\n"),
|
||||
"{cmake}"
|
||||
);
|
||||
assert_eq!(read(&dir, "include/my_lib.h"), "#pragma once\n\nvoid my_lib_hello(void);\n");
|
||||
|
||||
let (_tmp, dir) = create_template("cpp", "My Lib", &[("lang", "c"), ("kind", "executable")]);
|
||||
assert_eq!(tree(&dir), [".gitignore", "CMakeLists.txt", "src/main.c"]);
|
||||
assert!(read(&dir, "CMakeLists.txt").ends_with("\nadd_executable(my_lib src/main.c)\n"));
|
||||
}
|
||||
|
||||
fn apple_project(generator: &str, platform: &str, testing: &str) -> (tempfile::TempDir, PathBuf) {
|
||||
create_template(generator, "My App", &[("platform", platform), ("testing", testing), ("org", "com.acme")])
|
||||
}
|
||||
|
||||
@@ -37,8 +37,9 @@ fn render_into(template: &str, values: &Values, out: &mut String) {
|
||||
out.push_str(rest);
|
||||
}
|
||||
|
||||
/// A template checked out with CRLF line endings (Git on Windows) ends a tag's line with `\r\n`.
|
||||
fn skip_newline(s: &str) -> &str {
|
||||
s.strip_prefix('\n').unwrap_or(s)
|
||||
s.strip_prefix("\r\n").or_else(|| s.strip_prefix('\n')).unwrap_or(s)
|
||||
}
|
||||
|
||||
/// The body of an `{{#if}}` block starting at `s`, and the text after its `{{/if}}`.
|
||||
@@ -227,6 +228,9 @@ mod tests {
|
||||
let v = values(&[("platform", "ios"), ("testing", "xctest")]);
|
||||
assert_eq!(render(t, &v), "x\nT\nI\ny\n");
|
||||
assert_eq!(render("{{#if platform=ios}}{{platform}}", &v), "ios");
|
||||
// The same with CRLF line endings.
|
||||
let crlf = t.replace('\n', "\r\n");
|
||||
assert_eq!(render(&crlf, &v), "x\r\nT\r\nI\r\ny\r\n");
|
||||
assert_eq!(references("{{#if testing!=none}}{{name}}{{/if}}"), ["testing", "name"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,9 @@ smoke! {
|
||||
go: "go", [], ["go", "build", "./..."];
|
||||
rust: "rust", [], ["cargo", "build", "-q"];
|
||||
cpp: "cpp", [], ["cmake", "-S", ".", "-B", "build"];
|
||||
cpp_c: "cpp", [("lang", "c")], ["cmake", "-S", ".", "-B", "build"];
|
||||
cpp_static_library: "cpp", [("kind", "library")], ["cmake", "-S", ".", "-B", "build"];
|
||||
cpp_c_shared_library: "cpp", [("lang", "c"), ("kind", "library"), ("libtype", "shared")], ["cmake", "-S", ".", "-B", "build"];
|
||||
zig: "zig", [], ["zig", "build"];
|
||||
dotnet: "dotnet", [], ["dotnet", "build"];
|
||||
php: "php", [], ["php", "public/index.php"];
|
||||
|
||||
@@ -54,8 +54,14 @@ Live templates for C and C++ include `main`, `fori`, `iter` (range-based `for`),
|
||||
|
||||
The `clangd` that ships with Xcode and the Command Line Tools does not run clang-tidy. When a project has a `.clang-tidy` file and the IDE is using Apple's clangd, it shows a warning with an **Install** button that installs the LLVM build instead.
|
||||
|
||||
### Preprocessor
|
||||
|
||||
Code that an `#if`, `#ifdef` or `#else` branch leaves out for the current compile flags is greyed out, as clangd reports it. **View › Show Macro Expansion** (in Find Action) shows what the macro at the caret expands to, from clangd's hover; **Expand macro** under `⌥↵` / `Alt+Enter` replaces the macro with its expansion in the code.
|
||||
|
||||
## Setup
|
||||
|
||||
**File › New › Project › C/C++** creates a CMake project in C or C++: an **Executable** (`src/main.cpp` or `src/main.c`) or a **Library**, static or shared (`include/<name>.h` and `src/<name>.cpp` or `.c`, the `include` folder public to the targets that link it). A shared library exports all its symbols on Windows too (`CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS`).
|
||||
|
||||
When clangd is missing, opening a C or C++ file shows a "clangd is not installed" notification with **Install**. You can also install it from **Settings › Languages & Frameworks › Language Servers**.
|
||||
|
||||
| Tool | How it is installed | Notes |
|
||||
|
||||
@@ -54,8 +54,14 @@ C/C++ 的实时模板包括 `main`、`fori`、`iter`(基于范围的 `for`)
|
||||
|
||||
Xcode 和 Command Line Tools 自带的 `clangd` 不运行 clang-tidy。如果项目里有 `.clang-tidy`,而 IDE 正在使用 Apple 的 clangd,会弹出提示并提供 **安装** 按钮,改装 LLVM 版本的 clangd。
|
||||
|
||||
### 预处理器
|
||||
|
||||
在当前编译参数下被 `#if`、`#ifdef` 或 `#else` 分支排除的代码会按 clangd 的报告显示为灰色。**视图 › 显示宏展开**(可在“查找操作”中运行)根据 clangd 的悬停信息显示光标处宏的展开结果;`⌥↵` / `Alt+Enter` 中的 **Expand macro** 则在代码中把宏替换为展开结果。
|
||||
|
||||
## 环境配置
|
||||
|
||||
**文件 › 新建 › 项目 › C/C++** 创建 C 或 C++ 的 CMake 项目:**可执行文件**(`src/main.cpp` 或 `src/main.c`)或 **库**,静态或共享(`include/<名称>.h` 和 `src/<名称>.cpp` 或 `.c`,`include` 目录对链接它的目标公开)。共享库在 Windows 上也导出全部符号(`CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS`)。
|
||||
|
||||
缺少 clangd 时,打开 C/C++ 文件会弹出“clangd 未安装”的通知,点 **安装** 即可。也可以在 **设置 › 语言和框架 › 语言服务器** 中安装。
|
||||
|
||||
| 工具 | 安装方式 | 说明 |
|
||||
|
||||
+91
-19
@@ -2,7 +2,7 @@ id = "cpp"
|
||||
name = "C/C++"
|
||||
group = "C/C++"
|
||||
icon = "project-cpp"
|
||||
description = "A CMake executable in C or C++."
|
||||
description = "A CMake executable or library in C or C++."
|
||||
|
||||
[[fields]]
|
||||
id = "lang"
|
||||
@@ -12,6 +12,22 @@ segmented = true
|
||||
options = [{ value = "cpp", label = "C++" }, { value = "c", label = "C" }]
|
||||
default = "cpp"
|
||||
|
||||
[[fields]]
|
||||
id = "kind"
|
||||
label = "Project type:"
|
||||
type = "choice"
|
||||
segmented = true
|
||||
options = [{ value = "executable", label = "Executable" }, { value = "library", label = "Library" }]
|
||||
default = "executable"
|
||||
|
||||
[[fields]]
|
||||
id = "libtype"
|
||||
label = "Library type:"
|
||||
type = "choice"
|
||||
options = [{ value = "static", label = "Static" }, { value = "shared", label = "Shared" }]
|
||||
default = "static"
|
||||
visible = { kind = "library" }
|
||||
|
||||
[[fields]]
|
||||
id = "cxx"
|
||||
label = "C++ standard:"
|
||||
@@ -30,21 +46,39 @@ visible = { lang = "c" }
|
||||
|
||||
[[files]]
|
||||
path = "CMakeLists.txt"
|
||||
when = { lang = "cpp" }
|
||||
content = '''
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
{{#if lang=cpp}}
|
||||
project({{name|snake}} LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD {{cxx}})
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
{{/if}}
|
||||
{{#if lang=c}}
|
||||
project({{name|snake}} LANGUAGES C)
|
||||
|
||||
set(CMAKE_C_STANDARD {{cstd}})
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
{{/if}}
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
add_executable({{name|snake}} src/main.cpp)
|
||||
{{#if kind=executable}}
|
||||
add_executable({{name|snake}} src/main.{{#if lang=cpp}}cpp{{/if}}{{#if lang=c}}c{{/if}})
|
||||
{{/if}}
|
||||
{{#if kind=library}}
|
||||
{{#if libtype=shared}}
|
||||
# MSVC exports nothing from a DLL by default: export every symbol, as on other platforms.
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
{{/if}}
|
||||
add_library({{name|snake}} {{#if libtype=static}}STATIC{{/if}}{{#if libtype=shared}}SHARED{{/if}} src/{{name|snake}}.{{#if lang=cpp}}cpp{{/if}}{{#if lang=c}}c{{/if}})
|
||||
target_include_directories({{name|snake}} PUBLIC include)
|
||||
{{/if}}
|
||||
'''
|
||||
|
||||
[[files]]
|
||||
path = "src/main.cpp"
|
||||
when = { lang = "cpp" }
|
||||
when = { lang = "cpp", kind = "executable" }
|
||||
content = '''
|
||||
#include <iostream>
|
||||
|
||||
@@ -54,23 +88,9 @@ int main() {
|
||||
}
|
||||
'''
|
||||
|
||||
[[files]]
|
||||
path = "CMakeLists.txt"
|
||||
when = { lang = "c" }
|
||||
content = '''
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project({{name|snake}} LANGUAGES C)
|
||||
|
||||
set(CMAKE_C_STANDARD {{cstd}})
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
add_executable({{name|snake}} src/main.c)
|
||||
'''
|
||||
|
||||
[[files]]
|
||||
path = "src/main.c"
|
||||
when = { lang = "c" }
|
||||
when = { lang = "c", kind = "executable" }
|
||||
content = '''
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -80,6 +100,58 @@ int main(void) {
|
||||
}
|
||||
'''
|
||||
|
||||
[[files]]
|
||||
path = "include/{{name|snake}}.h"
|
||||
when = { lang = "cpp", kind = "library" }
|
||||
content = '''
|
||||
#pragma once
|
||||
|
||||
namespace {{name|snake}} {
|
||||
|
||||
void hello();
|
||||
|
||||
} // namespace {{name|snake}}
|
||||
'''
|
||||
|
||||
[[files]]
|
||||
path = "src/{{name|snake}}.cpp"
|
||||
when = { lang = "cpp", kind = "library" }
|
||||
content = '''
|
||||
#include "{{name|snake}}.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace {{name|snake}} {
|
||||
|
||||
void hello() {
|
||||
std::cout << "Hello, World!" << std::endl;
|
||||
}
|
||||
|
||||
} // namespace {{name|snake}}
|
||||
'''
|
||||
|
||||
[[files]]
|
||||
path = "include/{{name|snake}}.h"
|
||||
when = { lang = "c", kind = "library" }
|
||||
content = '''
|
||||
#pragma once
|
||||
|
||||
void {{name|snake}}_hello(void);
|
||||
'''
|
||||
|
||||
[[files]]
|
||||
path = "src/{{name|snake}}.c"
|
||||
when = { lang = "c", kind = "library" }
|
||||
content = '''
|
||||
#include "{{name|snake}}.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void {{name|snake}}_hello(void) {
|
||||
printf("Hello, World!\n");
|
||||
}
|
||||
'''
|
||||
|
||||
[[files]]
|
||||
path = ".gitignore"
|
||||
content = '''
|
||||
|
||||
@@ -23,6 +23,7 @@ import { SMART_TYPE_LANGUAGES } from "./smartCompletion";
|
||||
import { triggerSignatureHelp } from "./signature";
|
||||
import { quickDefinition, quickDocumentation } from "./hover";
|
||||
import { expressionTypeInfo } from "./typeInfo";
|
||||
import { showMacroExpansion } from "./macroExpansion";
|
||||
import { gotoHighlightedUsage, gotoTargets, highlightUsages } from "./navigation";
|
||||
import { gotoDiagnostic, showErrorDescription } from "./diagnostics";
|
||||
import { applyKindSilently, applyQuickFix, runKindAction, showIntentions } from "./intentions";
|
||||
@@ -583,6 +584,9 @@ export function registerLspActions(): () => void {
|
||||
editorAction("code.expressionTypeInfo", "Expression Type Info", "View", expressionTypeInfo, {
|
||||
keywords: ["type of expression", "show type"],
|
||||
}),
|
||||
editorAction("code.showMacroExpansion", "Show Macro Expansion", "View", showMacroExpansion, {
|
||||
keywords: ["macro", "preprocessor", "#define", "expand"],
|
||||
}),
|
||||
{
|
||||
id: "editor.showHint",
|
||||
title: "Show Editor Hint",
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { macroExpansion } from "./macroExpansion";
|
||||
|
||||
const md = (value: string) => ({ kind: "markdown" as const, value });
|
||||
|
||||
describe("Show Macro Expansion", () => {
|
||||
it("takes the expansion clangd's hover shows after the definition", () => {
|
||||
const hover = md(
|
||||
[
|
||||
"### macro `SQUARE`",
|
||||
"",
|
||||
"---",
|
||||
"```cpp",
|
||||
"#define SQUARE(x) ((x) * (x))",
|
||||
"",
|
||||
"// Expands to",
|
||||
"((2) * (2))",
|
||||
"```",
|
||||
].join("\n"),
|
||||
);
|
||||
expect(macroExpansion(hover)).toBe("((2) * (2))");
|
||||
});
|
||||
|
||||
it("keeps a multi-line expansion", () => {
|
||||
const hover = md(
|
||||
'```cpp\n#define LOG(m) do { f(m); } while (0)\n\n// Expands to\ndo {\n f("x");\n} while (0)\n```',
|
||||
);
|
||||
expect(macroExpansion(hover)).toBe('do {\n f("x");\n} while (0)');
|
||||
});
|
||||
|
||||
it("finds nothing for other symbols or a definition clangd did not expand", () => {
|
||||
expect(macroExpansion(md("### function `main`\n\n---\n```cpp\nint main()\n```"))).toBeNull();
|
||||
expect(macroExpansion(md("### macro `X`\n\n---\n```cpp\n#define X\n```"))).toBeNull();
|
||||
expect(macroExpansion(md("```cpp\n#define X\n\n// Expands to\n\n```"))).toBeNull();
|
||||
expect(macroExpansion(null)).toBeNull();
|
||||
});
|
||||
|
||||
it("reads plain-text hovers too", () => {
|
||||
expect(macroExpansion({ kind: "plaintext", value: "#define ONE 1\n\n// Expands to\n1" })).toBe("1");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* View › Show Macro Expansion (C, C++, Objective-C): what the macro at the caret expands to, as
|
||||
* CLion shows it. clangd puts the expansion in its hover, after a `// Expands to` line of the
|
||||
* macro's code block; it is shown in a popup of its own.
|
||||
*/
|
||||
import type { EditorView } from "@codemirror/view";
|
||||
import type { Markup } from "@/bindings";
|
||||
import { docOf, reportLspError } from "./lsp";
|
||||
import { requestHover } from "./hover";
|
||||
import { rangeToOffsets } from "./positions";
|
||||
import { showHint } from "./hint";
|
||||
import { caretAnchor, openPopup } from "./popupStore";
|
||||
|
||||
const C_FAMILY = new Set(["c", "cpp", "objective-c", "objective-cpp"]);
|
||||
const FENCE = /```[\w+#-]*[^\n]*\n([\s\S]*?)```/g;
|
||||
const EXPANDS_TO = /^\s*\/\/ Expands to\s*$/m;
|
||||
|
||||
/** The expansion in clangd's hover markup, or null when it shows none (not a macro, or not expanded). */
|
||||
export function macroExpansion(m: Markup | null | undefined): string | null {
|
||||
if (!m) return null;
|
||||
const blocks = m.kind === "markdown" ? [...m.value.matchAll(FENCE)].map((b) => b[1]!) : [m.value];
|
||||
for (const block of blocks) {
|
||||
const at = EXPANDS_TO.exec(block);
|
||||
if (!at) continue;
|
||||
const expansion = block.slice(at.index + at[0].length).trim();
|
||||
if (expansion) return expansion;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export async function showMacroExpansion(view: EditorView) {
|
||||
const doc = docOf(view);
|
||||
if (!doc || !C_FAMILY.has(doc.language ?? "")) {
|
||||
showHint(view, "Macro expansion is shown in C, C++ and Objective-C files");
|
||||
return;
|
||||
}
|
||||
const pos = view.state.selection.main.head;
|
||||
try {
|
||||
const hover = await requestHover(view, pos);
|
||||
const expansion = macroExpansion(hover?.contents);
|
||||
if (!expansion) {
|
||||
showHint(view, "No macro to expand at the caret");
|
||||
return;
|
||||
}
|
||||
openPopup({
|
||||
kind: "doc",
|
||||
anchor: caretAnchor(view, hover?.range ? rangeToOffsets(view.state.doc, hover.range).from : pos),
|
||||
entries: [
|
||||
{
|
||||
markup: { kind: "markdown", value: `\`\`\`${doc.uiMode ?? "cpp"}\n${expansion}\n\`\`\`` },
|
||||
language: doc.uiMode ?? null,
|
||||
},
|
||||
],
|
||||
index: 0,
|
||||
themeClasses: view.themeClasses,
|
||||
});
|
||||
} catch (e) {
|
||||
reportLspError(view, e, true);
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,14 @@ describe("C++ namespace semantic tokens", () => {
|
||||
expect(token(type, ["defaultLibrary"])).toContain("cm-sem-builtin");
|
||||
});
|
||||
|
||||
it.each(["cpp", "c", "objective-c", "objective-cpp"])("greys out clangd's inactive code (%s)", (language) => {
|
||||
expect(token("comment", [], language)).toEqual(["cm-sem-inactive"]);
|
||||
});
|
||||
|
||||
it("leaves comment tokens of other languages alone", () => {
|
||||
expect(token("comment", [], "rust")).toBeUndefined();
|
||||
});
|
||||
|
||||
it("leaves other languages' namespace colouring unchanged", () => {
|
||||
expect(token("namespace", ["defaultLibrary"], "rust")).toEqual(["cm-sem-namespace", "cm-sem-builtin"]);
|
||||
});
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
import { registerLanguageSemantics } from "../languages";
|
||||
import { cppGenerateEntries } from "./generate";
|
||||
|
||||
/**
|
||||
* clangd sends the code an `#if` / `#ifdef` leaves out as `comment` tokens (its inactive regions,
|
||||
* for clients without the `textDocument/inactiveRegions` extension): it is greyed out.
|
||||
*/
|
||||
function inactiveCode({ type, classes }: { type: string; classes: string[] }) {
|
||||
if (type === "comment") classes.push("cm-sem-inactive");
|
||||
}
|
||||
|
||||
for (const language of ["c", "objective-c", "objective-cpp"])
|
||||
registerLanguageSemantics(language, { tokenClasses: inactiveCode });
|
||||
|
||||
registerLanguageSemantics("cpp", {
|
||||
tokenClasses({ type, classes }) {
|
||||
inactiveCode({ type, classes });
|
||||
// clangd marks std and other library namespaces as defaultLibrary; keep their namespace colour.
|
||||
if (type !== "namespace") return;
|
||||
const builtin = classes.indexOf("cm-sem-builtin");
|
||||
|
||||
@@ -696,6 +696,12 @@ export const lspTheme = EditorView.theme({
|
||||
".cm-sem-python-type-parameter": semanticStyle("python-type-parameter", "type"),
|
||||
// Deprecation wins over role effects, including static fields.
|
||||
".cm-content .cm-sem-deprecated, .cm-content .cm-sem-deprecated *": { textDecoration: "line-through" },
|
||||
// CLion's inactive preprocessor branches (clangd): the unused-code grey, over the syntax colours inside.
|
||||
".cm-content .cm-sem-inactive, .cm-content .cm-sem-inactive *": {
|
||||
color: "var(--syn-inactive-code, var(--fg-unused, var(--fg-faint)))",
|
||||
fontWeight: "normal",
|
||||
fontStyle: "normal",
|
||||
},
|
||||
// Semantic highlighting: after the base classes so a parameter's colour gives way, and over the
|
||||
// syntax highlighter's span inside.
|
||||
...Object.fromEntries(
|
||||
|
||||
@@ -2301,7 +2301,6 @@
|
||||
"Basics": "Basics",
|
||||
"Blog": "Blog",
|
||||
"Running create-astro": "Running create-astro",
|
||||
"A CMake executable in C or C++.": "A CMake executable in C or C++.",
|
||||
"Language:": "Language:",
|
||||
"C++ standard:": "C++ standard:",
|
||||
"C standard:": "C standard:",
|
||||
@@ -3364,6 +3363,9 @@
|
||||
"The parallel chain ran sequentially so it could be traced": "The parallel chain ran sequentially so it could be traced",
|
||||
"{count} breakpoint was off while the chain ran": "{count} breakpoint was off while the chain ran",
|
||||
"{count} breakpoints were off while the chain ran": "{count} breakpoints were off while the chain ran",
|
||||
"Show Macro Expansion": "Show Macro Expansion",
|
||||
"Macro expansion is shown in C, C++ and Objective-C files": "Macro expansion is shown in C, C++ and Objective-C files",
|
||||
"No macro to expand at the caret": "No macro to expand at the caret",
|
||||
"{count} breakpoint hit while the chain ran was resumed": "{count} breakpoint hit while the chain ran was resumed",
|
||||
"{count} breakpoint hits while the chain ran were resumed": "{count} breakpoint hits while the chain ran were resumed",
|
||||
"The chain threw {exception}": "The chain threw {exception}",
|
||||
@@ -3623,6 +3625,11 @@
|
||||
"Preview layout": "Preview layout",
|
||||
"Side by side": "Side by side",
|
||||
"Stacked": "Stacked",
|
||||
"A CMake executable or library in C or C++.": "A CMake executable or library in C or C++.",
|
||||
"Project type:": "Project type:",
|
||||
"Library type:": "Library type:",
|
||||
"Static": "Static",
|
||||
"Shared": "Shared",
|
||||
"Resize plugin panes": "Resize plugin panes",
|
||||
"Run a Python script or module": "Run a Python script or module",
|
||||
"create": "create",
|
||||
|
||||
@@ -3872,6 +3872,9 @@
|
||||
"Choose Super Class or Interface ({count} found)": "Choisir la classe parente ou l'interface ({count} trouvées)",
|
||||
"Choose Super Method of {name} ({count} found)": "Choisir la méthode parente de {name} ({count} trouvées)",
|
||||
"Choose Implementation of {name} ({count} found)": "Choisir l'implémentation de {name} ({count} trouvées)",
|
||||
"Show Macro Expansion": "Afficher l’expansion de la macro",
|
||||
"Macro expansion is shown in C, C++ and Objective-C files": "L’expansion de macro est disponible dans les fichiers C, C++ et Objective-C",
|
||||
"No macro to expand at the caret": "Aucune macro à développer au curseur",
|
||||
"Choose Subclass of {name} ({count} found)": "Choisir la sous-classe de {name} ({count} trouvées)",
|
||||
"Choose Overriding Method of {name} ({count} found)": "Choisir la méthode redéfinissant {name} ({count} trouvées)",
|
||||
"Is implemented by {names}": "Implémenté par {names}",
|
||||
@@ -4167,6 +4170,15 @@
|
||||
"Authentication type": "Type d'authentification",
|
||||
"Key pair (OpenSSH or PuTTY)": "Paire de clés (OpenSSH ou PuTTY)",
|
||||
"Private key file": "Fichier de clé privée",
|
||||
"A CMake executable or library in C or C++.": "Un exécutable ou une bibliothèque CMake en C ou C++.",
|
||||
"Language:": "Langage :",
|
||||
"C++ standard:": "Norme C++ :",
|
||||
"C standard:": "Norme C :",
|
||||
"Project type:": "Type de projet :",
|
||||
"Library type:": "Type de bibliothèque :",
|
||||
"Library": "Bibliothèque",
|
||||
"Static": "Statique",
|
||||
"Shared": "Partagée",
|
||||
"Save passphrase": "Enregistrer la phrase secrète",
|
||||
"SSH Password": "Mot de passe SSH",
|
||||
"Yes": "Oui",
|
||||
|
||||
@@ -8549,7 +8549,6 @@
|
||||
"Basics": "Базовый",
|
||||
"Blog": "Блог",
|
||||
"Running create-astro": "Выполнение create-astro",
|
||||
"A CMake executable in C or C++.": "Исполняемый проект CMake на C или C++.",
|
||||
"Language:": "Язык:",
|
||||
"C++ standard:": "Стандарт C++:",
|
||||
"C standard:": "Стандарт C:",
|
||||
|
||||
@@ -1488,7 +1488,6 @@
|
||||
"Basics": "Temel",
|
||||
"Blog": "Blog",
|
||||
"Running create-astro": "create-astro çalıştırılıyor",
|
||||
"A CMake executable in C or C++.": "C veya C++ ile yazılmış CMake yürütülebilir dosyası.",
|
||||
"Language:": "Dil:",
|
||||
"C++ standard:": "C++ standardı:",
|
||||
"C standard:": "C standardı:",
|
||||
|
||||
@@ -6318,6 +6318,9 @@
|
||||
"View pull request timeline": "檢視 Pull Request 時間線",
|
||||
"Refresh Pull Request": "重新整理 Pull Request",
|
||||
"Refresh Timeline": "重新整理時間線",
|
||||
"Show Macro Expansion": "顯示巨集展開",
|
||||
"Macro expansion is shown in C, C++ and Objective-C files": "巨集展開僅適用於 C、C++ 和 Objective-C 檔案",
|
||||
"No macro to expand at the caret": "游標處沒有可展開的巨集",
|
||||
"Check for new timeline events": "檢查新的時間線事件",
|
||||
"View Pull Request in Browser": "在瀏覽器中檢視 Pull Request",
|
||||
"Copy Pull Request URL": "複製 Pull Request URL",
|
||||
@@ -6799,6 +6802,11 @@
|
||||
"Passed as --filter: a test name or a regular expression": "作為 --filter 傳入:測試名稱或正規表示式",
|
||||
"PHPUnit options": "PHPUnit 選項",
|
||||
"e.g. --stop-on-failure --testsuite unit": "例如 --stop-on-failure --testsuite unit",
|
||||
"A CMake executable or library in C or C++.": "使用 C 或 C++ 的 CMake 可執行檔或函式庫。",
|
||||
"Project type:": "專案類型:",
|
||||
"Library type:": "函式庫類型:",
|
||||
"Static": "靜態",
|
||||
"Shared": "共用",
|
||||
"CLI Interpreter": "CLI 直譯器",
|
||||
"PHP interpreter": "PHP 直譯器",
|
||||
"Runs PHP scripts, PHPUnit, Composer and artisan, and the PHP-based language servers (phpactor). Its folder is put first on PATH, so vendor/bin/phpunit and other #!/usr/bin/env php scripts use it too.": "執行 PHP 指令碼、PHPUnit、Composer 和 artisan,以及基於 PHP 的語言伺服器(phpactor)。其所在資料夾會被置於 PATH 最前,因此 vendor/bin/phpunit 等 #!/usr/bin/env php 指令碼也會使用它。",
|
||||
@@ -8137,7 +8145,6 @@
|
||||
"Basics": "基礎",
|
||||
"Blog": "部落格",
|
||||
"Running create-astro": "正在執行 create-astro",
|
||||
"A CMake executable in C or C++.": "用 CMake 建置的 C 或 C++ 可執行程式。",
|
||||
"Language:": "語言:",
|
||||
"C++ standard:": "C++ 標準:",
|
||||
"C standard:": "C 標準:",
|
||||
|
||||
@@ -7834,6 +7834,9 @@
|
||||
"Local name": "本地名称",
|
||||
"Remote name": "远程名称",
|
||||
"Space changes the selected operation. Enter synchronizes the selected file. Synchronize All applies all chosen operations.": "空格键切换所选操作,Enter 键同步所选文件。“同步全部”执行所有已选择的操作。",
|
||||
"Show Macro Expansion": "显示宏展开",
|
||||
"Macro expansion is shown in C, C++ and Objective-C files": "宏展开仅适用于 C、C++ 和 Objective-C 文件",
|
||||
"No macro to expand at the caret": "光标处没有可展开的宏",
|
||||
"Resize file list and diff preview": "调整文件列表和差异预览的大小",
|
||||
"The deployment server or project is no longer available": "部署服务器或项目已不可用",
|
||||
"Select a file to compare its contents": "选择文件以比较其内容",
|
||||
@@ -8432,6 +8435,11 @@
|
||||
"Custom context.xml descriptor; leave empty to use the application's META-INF/context.xml": "自定义 context.xml 描述符;留空则使用应用的 META-INF/context.xml",
|
||||
"Deploy applications configured in Tomcat instance": "部署在 Tomcat 实例中配置的应用程序",
|
||||
"HTTPS port": "HTTPS 端口",
|
||||
"A CMake executable or library in C or C++.": "使用 C 或 C++ 的 CMake 可执行文件或库。",
|
||||
"Project type:": "项目类型:",
|
||||
"Library type:": "库类型:",
|
||||
"Static": "静态",
|
||||
"Shared": "共享",
|
||||
"JMX port": "JMX 端口",
|
||||
"JMX remote port; leave empty to allocate a free port automatically": "JMX 远程端口;留空则自动分配空闲端口",
|
||||
"AJP port": "AJP 端口",
|
||||
@@ -9114,7 +9122,6 @@
|
||||
"Basics": "基础",
|
||||
"Blog": "博客",
|
||||
"Running create-astro": "正在运行 create-astro",
|
||||
"A CMake executable in C or C++.": "用 CMake 构建的 C 或 C++ 可执行程序。",
|
||||
"Language:": "语言:",
|
||||
"C++ standard:": "C++ 标准:",
|
||||
"C standard:": "C 标准:",
|
||||
|
||||
Reference in new issue
Заблокувати користувача