дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-25 19:04:37 +02:00
Порівняти коміти
5
Коміти
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
ff3d6213a4 | ||
|
|
4002eaa8e9 | ||
|
|
98268106b8 | ||
|
|
2e9a637158 | ||
|
|
f50a8a301c |
No files matched your search
@@ -252,6 +252,8 @@ pub struct SmartKeysSettings {
|
||||
/// Reformat on paste: `none` | `indentBlock` | `indentEachLine`.
|
||||
pub reformat_on_paste: String,
|
||||
pub smart_indent: bool,
|
||||
/// Enter › Insert documentation comment stub: Enter after `/**` closes the comment.
|
||||
pub insert_doc_stub: bool,
|
||||
/// Backspace › Unindent: `autoindent` (proper indent position) | `nearest` indent position | `none`.
|
||||
pub backspace_unindent: String,
|
||||
}
|
||||
@@ -267,6 +269,7 @@ impl Default for SmartKeysSettings {
|
||||
tab_out_of_pair: true,
|
||||
reformat_on_paste: "indentEachLine".into(),
|
||||
smart_indent: true,
|
||||
insert_doc_stub: true,
|
||||
backspace_unindent: "autoindent".into(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,11 @@ pub trait PluginWorkspace: Send + Sync {
|
||||
fn projects(&self) -> Vec<PathBuf>;
|
||||
/// Unsaved text of the open document at `path`.
|
||||
fn buffer_text(&self, path: &Path) -> Option<String>;
|
||||
/// Up to `limit` files of the project index below `root` whose root-relative path satisfies
|
||||
/// `matches`; `None` when no index covers `root` yet (the caller walks the disk instead).
|
||||
fn indexed_files(&self, _root: &Path, _matches: &dyn Fn(&Path) -> bool, _limit: usize) -> Option<Vec<PathBuf>> {
|
||||
None
|
||||
}
|
||||
/// Version and text of the open document at `path`.
|
||||
fn document(&self, path: &Path) -> Option<(u64, String)>;
|
||||
/// Applies `edits` to the open document at `path` if it is still at
|
||||
@@ -459,6 +464,19 @@ impl HostApi for PluginApi {
|
||||
.build()
|
||||
.map_err(|e| HostError::Invalid(format!("{glob:?}: {e}")))?
|
||||
.compile_matcher();
|
||||
// Hidden files and folders are left out, as in the walk below.
|
||||
let visible = |rel: &Path| !rel.iter().any(|c| c.to_str().is_some_and(|c| c.starts_with('.')));
|
||||
// The project index already lists the files: walking a large tree on every call can take
|
||||
// longer than an editor provider's deadline (the plugin is then stopped as crashed).
|
||||
if let Some(files) = self
|
||||
.shared
|
||||
.workspace()
|
||||
.and_then(|w| w.indexed_files(root, &|rel| visible(rel) && matcher.is_match(rel), limit))
|
||||
{
|
||||
let mut out: Vec<String> = files.iter().map(|p| to_ipc(p)).collect();
|
||||
out.sort();
|
||||
return Ok(out);
|
||||
}
|
||||
let mut out = Vec::new();
|
||||
for (n, entry) in ignore::WalkBuilder::new(root).hidden(true).build().flatten().enumerate() {
|
||||
if n >= MAX_WALK || out.len() >= limit {
|
||||
@@ -738,6 +756,12 @@ impl PluginWorkspace for HostWorkspace {
|
||||
HostWorkspace::projects(self).iter().find_map(|p| p.documents.text_of(path))
|
||||
}
|
||||
|
||||
fn indexed_files(&self, root: &Path, matches: &dyn Fn(&Path) -> bool, limit: usize) -> Option<Vec<PathBuf>> {
|
||||
// The index of the project rooted at `root` (a workspace member's files are in its own).
|
||||
let project = HostWorkspace::projects(self).into_iter().find(|p| p.root == root)?;
|
||||
project.index.files_matching(root, matches, limit)
|
||||
}
|
||||
|
||||
fn document(&self, path: &Path) -> Option<(u64, String)> {
|
||||
let (project, doc) = self.open_document(path)?;
|
||||
let snap = project.documents.snapshot(doc).ok()?;
|
||||
@@ -821,6 +845,60 @@ mod tests {
|
||||
assert_eq!(api.vcs_status(&root).unwrap().unwrap().root, to_ipc(&root));
|
||||
}
|
||||
|
||||
/// A project index that lists `files` (root-relative), whatever is on disk.
|
||||
struct Indexed(PathBuf, Vec<&'static str>);
|
||||
impl PluginWorkspace for Indexed {
|
||||
fn projects(&self) -> Vec<PathBuf> {
|
||||
vec![self.0.clone()]
|
||||
}
|
||||
fn buffer_text(&self, _: &Path) -> Option<String> {
|
||||
None
|
||||
}
|
||||
fn document(&self, _: &Path) -> Option<(u64, String)> {
|
||||
None
|
||||
}
|
||||
fn apply_edits(&self, _: &Path, _: u64, _: &[TextEdit]) -> Result<u64, HostError> {
|
||||
Err(HostError::Stale)
|
||||
}
|
||||
fn trusted(&self, _: &Path) -> bool {
|
||||
true
|
||||
}
|
||||
fn project_of(&self, _: &str) -> Option<PathBuf> {
|
||||
None
|
||||
}
|
||||
fn publish_diagnostics(&self, _: &str, _: &Path, _: Vec<ide_core::Diagnostic>) -> Result<(), HostError> {
|
||||
Ok(())
|
||||
}
|
||||
fn indexed_files(&self, root: &Path, matches: &dyn Fn(&Path) -> bool, limit: usize) -> Option<Vec<PathBuf>> {
|
||||
(root == self.0).then(|| {
|
||||
self.1.iter().map(Path::new).filter(|rel| matches(rel)).take(limit).map(|rel| root.join(rel)).collect()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn find_files_uses_the_project_index_when_there_is_one() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let root = tmp.path().canonicalize().unwrap();
|
||||
let api = api(&root, Arc::default());
|
||||
*api.shared.workspace.write() = Some(Arc::new(Indexed(
|
||||
root.clone(),
|
||||
vec!["src/b/UserMapper.xml", "src/a/OrderMapper.xml", ".idea/workspace.xml", "pom.xml"],
|
||||
)));
|
||||
// Listed by the index, not walked: none of these exist on disk.
|
||||
assert_eq!(
|
||||
api.find_files(&root, "**/*Mapper.xml", 10).unwrap(),
|
||||
[to_ipc(&root.join("src/a/OrderMapper.xml")), to_ipc(&root.join("src/b/UserMapper.xml"))]
|
||||
);
|
||||
assert_eq!(api.find_files(&root, "**/*.xml", 10).unwrap().len(), 3, "hidden folders are left out");
|
||||
assert_eq!(api.find_files(&root, "**/*.xml", 1).unwrap().len(), 1);
|
||||
// Another root: no index covers it, so the disk is walked.
|
||||
let other = root.join("other");
|
||||
std::fs::create_dir_all(&other).unwrap();
|
||||
std::fs::write(other.join("a.xml"), "").unwrap();
|
||||
assert_eq!(api.find_files(&other, "*.xml", 10).unwrap(), [to_ipc(&other.join("a.xml"))]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn programs_run_only_as_approved() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
|
||||
@@ -35,6 +35,8 @@ async fn opens_unity_without_generated_solutions_and_excludes_caches_from_the_in
|
||||
assert!(unity.projects.is_empty() && unity.solutions.is_empty());
|
||||
assert!(project.index.wait_idle(Duration::from_secs(20)));
|
||||
assert_eq!(project.index.find_files("Player.cs", 100).len(), 1);
|
||||
let listed = project.index.files_matching(&project.root, |rel| rel.ends_with("Player.cs"), 10).unwrap();
|
||||
assert_eq!(listed.len(), 1);
|
||||
for name in ["Cached.cs", "Temporary.cs", "Editor.log"] {
|
||||
assert!(project.index.find_files(name, 100).is_empty(), "indexed generated file {name}");
|
||||
}
|
||||
|
||||
@@ -197,6 +197,28 @@ impl ProjectIndex {
|
||||
matching::find_files(&d, &matching::Recents { paths: &recent }, query, limit)
|
||||
}
|
||||
|
||||
/// Up to `limit` indexed files below `dir` (VCS-ignored ones left out) whose path relative to
|
||||
/// `dir` satisfies `matches`: a file list without walking the disk. `None` while nothing is
|
||||
/// indexed yet (first scan without a cache).
|
||||
pub fn files_matching(&self, dir: &Path, matches: impl Fn(&Path) -> bool, limit: usize) -> Option<Vec<PathBuf>> {
|
||||
let d = self.shared.data.read();
|
||||
if d.file_count == 0 {
|
||||
return None;
|
||||
}
|
||||
let mut out = Vec::new();
|
||||
for file in d.files.iter().flatten().filter(|f| !f.ignored) {
|
||||
if out.len() >= limit {
|
||||
break;
|
||||
}
|
||||
if let Ok(rel) = file.path.strip_prefix(dir)
|
||||
&& matches(rel)
|
||||
{
|
||||
out.push(file.path.clone());
|
||||
}
|
||||
}
|
||||
Some(out)
|
||||
}
|
||||
|
||||
/// Fuzzy search for folders that hold indexed files; `rel_path` ends in `/`.
|
||||
pub fn find_dirs(&self, query: &str, limit: usize) -> Vec<FileMatch> {
|
||||
matching::find_dirs(&self.shared.data.read(), query, limit)
|
||||
|
||||
@@ -32,6 +32,7 @@ const BUILD_FILES: &[&str] = &[
|
||||
"Pipfile",
|
||||
"requirements.txt",
|
||||
"package.json",
|
||||
"composer.json",
|
||||
];
|
||||
|
||||
/// Folder names that are (or contain) conventional roots.
|
||||
@@ -214,6 +215,15 @@ fn module_roots(root: &Path, rel: &str, files: &[String], out: &mut Vec<SourceFo
|
||||
}
|
||||
}
|
||||
|
||||
// Before `package.json`: a Laravel app's `tests/` is the PHP test root.
|
||||
if has("composer.json")
|
||||
&& let Ok(text) = std::fs::read_to_string(dir.join("composer.json"))
|
||||
{
|
||||
for (sub, kind) in composer_roots(&text) {
|
||||
add(&sub, kind, "composer.json");
|
||||
}
|
||||
}
|
||||
|
||||
if has("package.json") {
|
||||
// A JVM build's `src` holds source sets, not JavaScript.
|
||||
if !has("pom.xml") && !GRADLE_FILES.iter().any(|f| has(f)) {
|
||||
@@ -230,6 +240,37 @@ fn module_roots(root: &Path, rel: &str, files: &[String], out: &mut Vec<SourceFo
|
||||
}
|
||||
}
|
||||
|
||||
/// `autoload.psr-4` folders as Source roots and `autoload-dev.psr-4` ones as Test roots, relative to
|
||||
/// the `composer.json` folder; paths that leave it or point into `vendor/` are left out.
|
||||
fn composer_roots(text: &str) -> Vec<(String, RootKind)> {
|
||||
let Ok(json) = serde_json::from_str::<serde_json::Value>(text) else { return Vec::new() };
|
||||
let mut out = Vec::new();
|
||||
for (section, kind) in [("autoload", RootKind::Source), ("autoload-dev", RootKind::Test)] {
|
||||
let Some(map) = json.get(section).and_then(|a| a.get("psr-4")).and_then(|m| m.as_object()) else { continue };
|
||||
for value in map.values() {
|
||||
let paths: Vec<&str> = match value {
|
||||
serde_json::Value::String(p) => vec![p.as_str()],
|
||||
serde_json::Value::Array(a) => a.iter().filter_map(|p| p.as_str()).collect(),
|
||||
_ => Vec::new(),
|
||||
};
|
||||
for path in paths {
|
||||
let parts: Vec<&str> = path.split(['/', '\\']).filter(|c| !c.is_empty() && *c != ".").collect();
|
||||
if path.starts_with(['/', '\\'])
|
||||
|| parts.iter().any(|c| *c == ".." || c.contains(':'))
|
||||
|| parts.first() == Some(&"vendor")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
let sub = parts.join("/");
|
||||
if !out.iter().any(|(p, _)| *p == sub) {
|
||||
out.push((sub, kind));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// Gradle's conventional `src/<set>/<lang>` folders that exist: `(set, lang)`.
|
||||
fn source_sets(dir: &Path) -> Vec<(String, String)> {
|
||||
let mut out = Vec::new();
|
||||
@@ -307,6 +348,47 @@ mod tests {
|
||||
assert!(roots.roots.iter().any(|r| r.path == "server/src" && r.kind == RootKind::Source));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn composer_psr4_folders_are_source_and_test_roots() {
|
||||
let dir = tree(&[
|
||||
"app/",
|
||||
"database/factories/",
|
||||
"database/seeders/",
|
||||
"lib/",
|
||||
"tests/",
|
||||
"vendor/acme/src/",
|
||||
"package.json",
|
||||
]);
|
||||
fs::write(
|
||||
dir.path().join("composer.json"),
|
||||
r#"{
|
||||
"autoload": { "psr-4": {
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": ["database/seeders/", "lib", "missing/"],
|
||||
"Vendored\\": "vendor/acme/src/",
|
||||
"Outside\\": "../elsewhere/"
|
||||
} },
|
||||
"autoload-dev": { "psr-4": { "Tests\\": "tests/" } }
|
||||
}"#,
|
||||
)
|
||||
.unwrap();
|
||||
let mut roots = summary(&detect(dir.path()));
|
||||
roots.sort();
|
||||
assert_eq!(
|
||||
roots,
|
||||
[
|
||||
"[email protected]",
|
||||
"database/[email protected]",
|
||||
"database/[email protected]",
|
||||
"[email protected]",
|
||||
"[email protected]",
|
||||
]
|
||||
);
|
||||
assert!(affects_roots(Path::new("composer.json")));
|
||||
assert!(composer_roots("not json").is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn maven_conventional_roots_and_target() {
|
||||
let dir = tree(&[
|
||||
|
||||
@@ -6870,6 +6870,8 @@ export type SmartKeysSettings = {
|
||||
/** Reformat on paste: `none` | `indentBlock` | `indentEachLine`. */
|
||||
reformatOnPaste?: string,
|
||||
smartIndent?: boolean,
|
||||
/** Enter › Insert documentation comment stub: Enter after `/**` closes the comment. */
|
||||
insertDocStub?: boolean,
|
||||
/** Backspace › Unindent: `autoindent` (proper indent position) | `nearest` indent position | `none`. */
|
||||
backspaceUnindent?: string,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { EditorSelection, EditorState } from "@codemirror/state";
|
||||
import { EditorView } from "@codemirror/view";
|
||||
import { undo, history } from "@codemirror/commands";
|
||||
import { enterInDocComment, phpDocTags } from "./docComment";
|
||||
|
||||
const views: EditorView[] = [];
|
||||
afterEach(() => views.splice(0).forEach((v) => v.destroy()));
|
||||
|
||||
const slashStar = EditorState.languageData.of(() => [
|
||||
{ commentTokens: { line: "//", block: { open: "/*", close: "*/" } } },
|
||||
]);
|
||||
const hash = EditorState.languageData.of(() => [{ commentTokens: { line: "#" } }]);
|
||||
|
||||
/** `|` marks the caret. */
|
||||
function enter(text: string, language = "php", tokens = slashStar) {
|
||||
const at = text.indexOf("|");
|
||||
const view = new EditorView({
|
||||
state: EditorState.create({
|
||||
doc: text.replace("|", ""),
|
||||
selection: EditorSelection.cursor(at),
|
||||
extensions: [tokens, history()],
|
||||
}),
|
||||
});
|
||||
views.push(view);
|
||||
const handled = enterInDocComment(language)(view);
|
||||
const s = view.state;
|
||||
const caret = s.selection.main.head;
|
||||
return { handled, view, text: s.doc.sliceString(0, caret) + "|" + s.doc.sliceString(caret) };
|
||||
}
|
||||
|
||||
describe("Enter after /**", () => {
|
||||
it("lists a PHP function's parameters and return type, caret on the summary line", () => {
|
||||
const r = enter("/**|\nfunction f(int $a, $b): string {}\n/**\n * old\n */\nfunction g() {}");
|
||||
expect(r.handled).toBe(true);
|
||||
expect(r.text).toBe(
|
||||
"/**\n * |\n * @param int $a\n * @param $b\n * @return string\n */\nfunction f(int $a, $b): string {}\n/**\n * old\n */\nfunction g() {}",
|
||||
);
|
||||
undo(r.view);
|
||||
expect(r.view.state.doc.toString()).toBe(
|
||||
"/**\nfunction f(int $a, $b): string {}\n/**\n * old\n */\nfunction g() {}",
|
||||
);
|
||||
});
|
||||
|
||||
it("uses the indentation of the /** line inside a class", () => {
|
||||
expect(
|
||||
enter("class A {\n /**|\n public static function make(?array $o = [], string ...$rest): ?static {}\n}")
|
||||
.text,
|
||||
).toBe(
|
||||
"class A {\n /**\n * |\n * @param ?array $o\n * @param string ...$rest\n * @return ?static\n */\n public static function make(?array $o = [], string ...$rest): ?static {}\n}",
|
||||
);
|
||||
});
|
||||
|
||||
it("gives constructors and void methods no @return; promoted parameters keep their type", () => {
|
||||
expect(phpDocTags("public function __construct(private int $a, #[Attr] readonly Foo&Bar $b) {}")).toEqual([
|
||||
"@param int $a",
|
||||
"@param Foo&Bar $b",
|
||||
]);
|
||||
expect(phpDocTags("function run(array &$x = array(1, 2), &$y): void {}")).toEqual(["@param array $x", "@param $y"]);
|
||||
expect(phpDocTags("abstract protected function find(int|string $id): ?Model;")).toEqual([
|
||||
"@param int|string $id",
|
||||
"@return ?Model",
|
||||
]);
|
||||
});
|
||||
|
||||
it("closes the comment with an empty summary above anything else, and in other /* */ languages", () => {
|
||||
expect(enter("/**|\nclass A {}").text).toBe("/**\n * |\n */\nclass A {}");
|
||||
expect(enter(" /**|\n\nconst x = 1;", "javascript").text).toBe(" /**\n * |\n */\n\nconst x = 1;");
|
||||
});
|
||||
|
||||
it("only breaks the line in an existing doc block, after other text, or without /* */ comments", () => {
|
||||
expect(enter("/**|\n * old\n */\nfunction f() {}").handled).toBe(false);
|
||||
expect(enter("$a = 1; /**|").handled).toBe(false);
|
||||
expect(enter("/** x|").handled).toBe(false);
|
||||
expect(enter("/**|", "python", hash).handled).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Smart Keys › Enter › Insert documentation comment stub: Enter right after a `/**` that opens a
|
||||
* new comment closes it, the caret on the summary line. In PHP the stub of a function lists its
|
||||
* parameters (`@param`) and return type (`@return`), as PhpStorm does.
|
||||
*/
|
||||
import { EditorSelection } from "@codemirror/state";
|
||||
import type { Command } from "@codemirror/view";
|
||||
|
||||
/** `@param` / `@return` lines for the PHP function declared in `text` (the code below the `/**`). */
|
||||
export function phpDocTags(text: string): string[] {
|
||||
const m =
|
||||
/^\s*(?:#\[[^\]]*\]\s*)*(?:(?:abstract|final|public|protected|private|static)\s+)*function\s+&?\s*(\w+)\s*\(/.exec(
|
||||
text,
|
||||
);
|
||||
if (!m) return [];
|
||||
let depth = 1;
|
||||
let i = m[0].length;
|
||||
for (; i < text.length && depth > 0; i++) {
|
||||
const c = text[i];
|
||||
if (c === "(" || c === "[") depth++;
|
||||
else if (c === ")" || c === "]") depth--;
|
||||
}
|
||||
if (depth > 0) return [];
|
||||
const tags = splitTopLevel(text.slice(m[0].length, i - 1)).flatMap((param) => {
|
||||
const p = /^(?:#\[[^\]]*\]\s*)*(?:(?:public|protected|private|readonly)\s+)*([^$=.]*?)\s*(\.\.\.)?\s*(\$\w+)/.exec(
|
||||
param.trim(),
|
||||
);
|
||||
if (!p) return [];
|
||||
// `&$x` passes by reference: the `&` belongs to no type (`Foo&Bar` is an intersection).
|
||||
const type = p[1]!.replace(/&\s*$/, "").trim().replace(/\s+/g, " ");
|
||||
const name = (p[2] ?? "") + p[3];
|
||||
return [type ? `@param ${type} ${name}` : `@param ${name}`];
|
||||
});
|
||||
const ret = /^\s*:\s*([?\w\\|&() ]+?)\s*(?:\{|;|$)/.exec(text.slice(i));
|
||||
const type = ret?.[1]?.trim();
|
||||
if (type && type !== "void" && m[1] !== "__construct") tags.push(`@return ${type}`);
|
||||
return tags;
|
||||
}
|
||||
|
||||
function splitTopLevel(params: string): string[] {
|
||||
const out: string[] = [];
|
||||
let depth = 0;
|
||||
let start = 0;
|
||||
for (let i = 0; i < params.length; i++) {
|
||||
const c = params[i];
|
||||
if (c === "(" || c === "[") depth++;
|
||||
else if (c === ")" || c === "]") depth--;
|
||||
else if (c === "," && depth === 0) {
|
||||
out.push(params.slice(start, i));
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
out.push(params.slice(start));
|
||||
return out.filter((p) => p.trim());
|
||||
}
|
||||
|
||||
/** The Enter command for documents of `language` (stub tags in PHP). */
|
||||
export function enterInDocComment(language: string | undefined): Command {
|
||||
return (view) => {
|
||||
const { state } = view;
|
||||
if (state.readOnly || state.selection.ranges.length !== 1) return false;
|
||||
const r = state.selection.main;
|
||||
if (!r.empty) return false;
|
||||
const block = state.languageDataAt<{ block?: { open: string; close: string } }>("commentTokens", r.head)[0]?.block;
|
||||
if (block?.open !== "/*" || block.close !== "*/") return false;
|
||||
const line = state.doc.lineAt(r.head);
|
||||
const before = line.text.slice(0, r.head - line.from);
|
||||
if (before.trim() !== "/**" || line.text.slice(r.head - line.from).trim()) return false;
|
||||
// A `/**` that already starts a doc block (the next line continues it) only breaks the line.
|
||||
const next = line.number < state.doc.lines ? state.doc.line(line.number + 1).text.trimStart() : "";
|
||||
if (next.startsWith("*")) return false;
|
||||
const indent = /^[ \t]*/.exec(before)![0];
|
||||
const br = state.lineBreak;
|
||||
const below = line.number < state.doc.lines ? state.sliceDoc(state.doc.line(line.number + 1).from) : "";
|
||||
const tags = language === "php" ? phpDocTags(below.slice(0, 4000)) : [];
|
||||
const summary = `${br}${indent} * `;
|
||||
const insert = summary + tags.map((t) => `${br}${indent} * ${t}`).join("") + `${br}${indent} */`;
|
||||
view.dispatch(
|
||||
state.update({
|
||||
changes: { from: r.head, insert },
|
||||
selection: EditorSelection.cursor(r.head + summary.length),
|
||||
scrollIntoView: true,
|
||||
userEvent: "input",
|
||||
}),
|
||||
);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
@@ -48,6 +48,7 @@ import {
|
||||
selectHumpRight,
|
||||
} from "./editing";
|
||||
import { enterInLineComment, lineCommentStyle, type LineCommentStyle } from "./comments";
|
||||
import { enterInDocComment } from "./docComment";
|
||||
import { skipClosingQuote, smartBackspace, smartBackspaceApplies, tabOut } from "./smartKeys";
|
||||
|
||||
// --- soft wraps ---------------------------------------------------------------
|
||||
@@ -571,6 +572,7 @@ export function prefsExtension(o: PrefsOptions): Extension {
|
||||
{ key: "Home", run: cursorLineStart, shift: selectLineStart, preventDefault: true },
|
||||
{ mac: "Mod-ArrowLeft", run: cursorLineStart, shift: selectLineStart, preventDefault: true },
|
||||
);
|
||||
if (!o.readOnly && k.insertDocStub) keys.push({ key: "Enter", run: enterInDocComment(o.language) });
|
||||
if (!o.readOnly) keys.push({ key: "Enter", run: enterInLineComment });
|
||||
if (!k.smartIndent) keys.push({ key: "Enter", run: insertNewlineKeepIndent });
|
||||
if (k.backspaceUnindent === "none") keys.push({ key: "Backspace", run: deleteCharBackwardStrict });
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Settings › Project Structure (IDEA's module "Sources" tab): the content
|
||||
* root's Sources / Tests / Resources / Test Resources / Excluded folders.
|
||||
* Roots detected from build files (`pom.xml`, `build.gradle`, `Cargo.toml`,
|
||||
* `go.mod`, `pyproject.toml`, `package.json`) apply until the user marks or
|
||||
* `go.mod`, `pyproject.toml`, `package.json`, `composer.json`) apply until the user marks or
|
||||
* unmarks the folder (`projectStructure.*`, project scope). Roots drive the
|
||||
* project tree icons, package inference for new classes, the "Project
|
||||
* Production / Test Files" scopes, and Excluded folders are skipped by the
|
||||
@@ -330,7 +330,7 @@ export function ProjectStructurePage() {
|
||||
<div className={styles.note}>
|
||||
<T>
|
||||
{
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index)."
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index)."
|
||||
}
|
||||
</T>
|
||||
</div>
|
||||
|
||||
@@ -677,7 +677,10 @@ const SMART_KEYS = editorPage({
|
||||
},
|
||||
{
|
||||
title: "Enter",
|
||||
items: [{ t: "check", key: `${P}.smartKeys.smartIndent`, label: "Smart indent" }],
|
||||
items: [
|
||||
{ t: "check", key: `${P}.smartKeys.smartIndent`, label: "Smart indent" },
|
||||
{ t: "check", key: `${P}.smartKeys.insertDocStub`, label: "Insert documentation comment stub" },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Backspace",
|
||||
|
||||
@@ -3,8 +3,10 @@ import {
|
||||
caretAfterReformat,
|
||||
expandIncludes,
|
||||
fragmentResolver,
|
||||
composerPsr4,
|
||||
inferGoPackage,
|
||||
inferJvmPackage,
|
||||
inferPhpNamespace,
|
||||
planFile,
|
||||
reformatsOnCreate,
|
||||
renderFileTemplate,
|
||||
@@ -92,6 +94,58 @@ describe("file naming", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("PHP namespaces", () => {
|
||||
const psr4 = composerPsr4(
|
||||
JSON.stringify({
|
||||
autoload: { "psr-4": { "App\\": "src/", "Legacy\\": ["src/legacy/", "lib"] } },
|
||||
"autoload-dev": { "psr-4": { "App\\Tests\\": "./tests" } },
|
||||
}),
|
||||
);
|
||||
|
||||
it("reads autoload and autoload-dev PSR-4 maps", () => {
|
||||
expect(psr4).toEqual([
|
||||
["App\\", "src"],
|
||||
["Legacy\\", "src/legacy"],
|
||||
["Legacy\\", "lib"],
|
||||
["App\\Tests\\", "tests"],
|
||||
]);
|
||||
expect(composerPsr4("{ not json")).toEqual([]);
|
||||
});
|
||||
|
||||
it("uses the longest mapped folder and adds the folders below it", () => {
|
||||
expect(inferPhpNamespace("/src/Http", psr4)).toBe("App\\Http");
|
||||
expect(inferPhpNamespace("/src", psr4)).toBe("App");
|
||||
expect(inferPhpNamespace("/src/legacy/Billing", psr4)).toBe("Legacy\\Billing");
|
||||
expect(inferPhpNamespace("/tests/Service", psr4)).toBe("App\\Tests\\Service");
|
||||
expect(inferPhpNamespace("/config", psr4)).toBe("");
|
||||
expect(inferPhpNamespace("/src/my-dir", psr4)).toBe("");
|
||||
expect(inferPhpNamespace("/x", [["", ""]])).toBe("x");
|
||||
});
|
||||
|
||||
it("writes the namespace into PHP classes, and leaves it out without one", () => {
|
||||
const kinds = tpl("php-class").kinds;
|
||||
const cls = renderFileTemplate(kinds[0]!.body, {
|
||||
name: "UserController",
|
||||
fileName: "UserController.php",
|
||||
packageName: "App\\Http",
|
||||
});
|
||||
expect(cls.text).toBe("<?php\n\nnamespace App\\Http;\n\nclass UserController\n{\n \n}\n");
|
||||
const bare = renderFileTemplate(kinds[0]!.body, { name: "Foo", fileName: "Foo.php" });
|
||||
expect(bare.text).toBe("<?php\n\nclass Foo\n{\n \n}\n");
|
||||
const test = renderFileTemplate(kinds.find((k) => k.id === "test")!.body, {
|
||||
name: "MailerTest",
|
||||
fileName: "MailerTest.php",
|
||||
packageName: "App\\Tests\\Service",
|
||||
});
|
||||
expect(test.text).toBe(
|
||||
"<?php\n\nnamespace App\\Tests\\Service;\n\nuse PHPUnit\\Framework\\TestCase;\n\nfinal class MailerTest extends TestCase\n{\n public function testSomething(): void\n {\n \n }\n}\n",
|
||||
);
|
||||
expect(renderFileTemplate(tpl("php").kinds[0]!.body, { name: "bootstrap", fileName: "bootstrap.php" }).text).toBe(
|
||||
"<?php\n\n\n",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("rendering", () => {
|
||||
it("substitutes variables and places the caret", () => {
|
||||
const kind = tpl("java").kinds[0]!;
|
||||
|
||||
@@ -233,7 +233,11 @@ function NameStep({
|
||||
{error ?? (
|
||||
<>
|
||||
{where}
|
||||
{template.packageStyle && pkg ? ` · package ${pkg}` : ""}
|
||||
{template.packageStyle && pkg
|
||||
? template.packageStyle === "php"
|
||||
? ` · namespace ${pkg}`
|
||||
: ` · package ${pkg}`
|
||||
: ""}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -31,6 +31,11 @@ export const BUILTIN_CODE_TEMPLATES: readonly TemplateFragment[] = [
|
||||
description: "TypeScript File › Test",
|
||||
body: 'it("works", () => {\n $END$\n});\n',
|
||||
},
|
||||
{
|
||||
name: "PHPUnit Test Method",
|
||||
description: "PHP Class › PHPUnit Test",
|
||||
body: "public function testSomething(): void\n{\n $END$\n}\n",
|
||||
},
|
||||
{
|
||||
name: "pytest Test Function",
|
||||
description: "Python File › Test (pytest)",
|
||||
@@ -149,6 +154,49 @@ export const BUILTIN_FILE_TEMPLATES: readonly FileTemplate[] = [
|
||||
defaultName: "go",
|
||||
kinds: [{ id: "module", label: "Module", body: "module $PROJECT_NAME$\n\ngo 1.20\n" }],
|
||||
},
|
||||
{
|
||||
id: "php",
|
||||
name: "PHP File",
|
||||
icon: "file-php",
|
||||
extension: "php",
|
||||
nameStyle: "asis",
|
||||
kinds: [{ id: "file", label: "File", body: "<?php\n\n$END$\n" }],
|
||||
},
|
||||
{
|
||||
id: "php-class",
|
||||
name: "PHP Class",
|
||||
icon: "class",
|
||||
extension: "php",
|
||||
nameStyle: "pascal",
|
||||
packageStyle: "php",
|
||||
kinds: [
|
||||
{
|
||||
id: "class",
|
||||
label: "Class",
|
||||
body: '<?php\n\nnamespace $PACKAGE$;\n\n#parse("File Header")\nclass $NAME$\n{\n $END$\n}\n',
|
||||
},
|
||||
{
|
||||
id: "interface",
|
||||
label: "Interface",
|
||||
body: '<?php\n\nnamespace $PACKAGE$;\n\n#parse("File Header")\ninterface $NAME$\n{\n $END$\n}\n',
|
||||
},
|
||||
{
|
||||
id: "trait",
|
||||
label: "Trait",
|
||||
body: '<?php\n\nnamespace $PACKAGE$;\n\n#parse("File Header")\ntrait $NAME$\n{\n $END$\n}\n',
|
||||
},
|
||||
{
|
||||
id: "enum",
|
||||
label: "Enum",
|
||||
body: '<?php\n\nnamespace $PACKAGE$;\n\n#parse("File Header")\nenum $NAME$\n{\n $END$\n}\n',
|
||||
},
|
||||
{
|
||||
id: "test",
|
||||
label: "PHPUnit Test",
|
||||
body: '<?php\n\nnamespace $PACKAGE$;\n\nuse PHPUnit\\Framework\\TestCase;\n\n#parse("File Header")\nfinal class $NAME$ extends TestCase\n{\n #parse("PHPUnit Test Method")\n}\n',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "java",
|
||||
name: "Java Class",
|
||||
|
||||
@@ -10,8 +10,10 @@ import { editorService, maybeEditorService, notifications } from "@/workbench/co
|
||||
import {
|
||||
GO_PACKAGE_RE,
|
||||
caretAfterReformat,
|
||||
composerPsr4,
|
||||
inferGoPackage,
|
||||
inferJvmPackage,
|
||||
inferPhpNamespace,
|
||||
planFile,
|
||||
reformatsOnCreate,
|
||||
renderFileTemplate,
|
||||
@@ -46,10 +48,29 @@ function packageRoots(): string[] {
|
||||
.map((r) => r.path);
|
||||
}
|
||||
|
||||
/** The namespace from the nearest composer.json between `directory` and the project root (PSR-4). */
|
||||
async function composerNamespace(directory: string, root: string | null): Promise<string> {
|
||||
if (!isTauri()) return "";
|
||||
let dir = directory.replace(/\/+$/, "");
|
||||
const top = root?.replace(/\/+$/, "") ?? null;
|
||||
for (;;) {
|
||||
let text: string | null = null;
|
||||
try {
|
||||
text = await call(commands.fsReadText(`${dir}/composer.json`));
|
||||
} catch {
|
||||
/* no composer.json here */
|
||||
}
|
||||
if (text !== null) return inferPhpNamespace(directory.slice(dir.length), composerPsr4(text));
|
||||
if (!top || dir === top || !dir.startsWith(`${top}/`)) return "";
|
||||
dir = dirname(dir);
|
||||
}
|
||||
}
|
||||
|
||||
export async function packageFor(t: FileTemplate, directory: string): Promise<string> {
|
||||
const root = useProject.getState().project?.root ?? null;
|
||||
if (t.packageStyle === "jvm") return inferJvmPackage(directory, root, packageRoots());
|
||||
if (t.packageStyle === "go") return inferGoPackage(directory, root, await siblingGoPackage(directory));
|
||||
if (t.packageStyle === "php") return composerNamespace(directory, root);
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface FileTemplate {
|
||||
extension: string;
|
||||
nameStyle: NameStyle;
|
||||
/** Package inference: `jvm` (Java/Kotlin source roots) or `go` (directory). */
|
||||
packageStyle?: "jvm" | "go";
|
||||
packageStyle?: "jvm" | "go" | "php";
|
||||
/** Dotted names (`com.acme.Foo`) create package directories. */
|
||||
dottedPackages?: boolean;
|
||||
kinds: FileTemplateKind[];
|
||||
@@ -223,6 +223,47 @@ export function inferGoPackage(directory: string, projectRoot: string | null, si
|
||||
|
||||
export const GO_PACKAGE_RE = /^\s*package\s+([A-Za-z_]\w*)/m;
|
||||
|
||||
/** `autoload.psr-4` and `autoload-dev.psr-4` of a composer.json: `[namespace prefix, folder]` (folder relative to it). */
|
||||
export function composerPsr4(json: string): Array<[string, string]> {
|
||||
let data: unknown;
|
||||
try {
|
||||
data = JSON.parse(json);
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
const out: Array<[string, string]> = [];
|
||||
for (const section of ["autoload", "autoload-dev"]) {
|
||||
const map = (data as Record<string, { "psr-4"?: Record<string, unknown> } | undefined> | null)?.[section]?.[
|
||||
"psr-4"
|
||||
];
|
||||
if (!map || typeof map !== "object") continue;
|
||||
for (const [prefix, value] of Object.entries(map)) {
|
||||
for (const dir of Array.isArray(value) ? value : [value])
|
||||
if (typeof dir === "string")
|
||||
out.push([prefix, dir.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+$/, "")]);
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP namespace for `directory` (relative to the composer.json folder): the PSR-4 prefix of the
|
||||
* longest mapped folder that contains it, then the folders below it (`App\\` + `src/` → `src/Http`
|
||||
* gives `App\Http`). Outside every mapping: no namespace.
|
||||
*/
|
||||
export function inferPhpNamespace(directory: string, psr4: ReadonlyArray<readonly [string, string]>): string {
|
||||
const rel = directory.split("/").filter(Boolean);
|
||||
let best: { prefix: string; depth: number } | null = null;
|
||||
for (const [prefix, dir] of psr4) {
|
||||
const segs = dir.split("/").filter((s) => s && s !== ".");
|
||||
if (segs.length > rel.length || segs.some((s, i) => s !== rel[i])) continue;
|
||||
if (!best || segs.length > best.depth) best = { prefix, depth: segs.length };
|
||||
}
|
||||
if (!best) return "";
|
||||
const parts = [...best.prefix.split("\\").filter(Boolean), ...rel.slice(best.depth)];
|
||||
return parts.every((p) => /^[A-Za-z_\x80-\uffff][\w\x80-\uffff]*$/.test(p)) ? parts.join("\\") : "";
|
||||
}
|
||||
|
||||
export interface FileTemplateVars {
|
||||
name: string;
|
||||
fileName: string;
|
||||
|
||||
@@ -152,6 +152,7 @@ export const EDITOR_EXTRA_DEFAULTS = {
|
||||
tabOutOfPair: true,
|
||||
reformatOnPaste: "indentEachLine",
|
||||
smartIndent: true,
|
||||
insertDocStub: true,
|
||||
backspaceUnindent: "autoindent",
|
||||
},
|
||||
codeEditing: {
|
||||
|
||||
@@ -3810,7 +3810,7 @@
|
||||
"JDK Location": "Ubicación del JDK",
|
||||
"Downloading JDK": "Descargando JDK",
|
||||
"Use ; to separate name patterns, * for any number of symbols, ? for one.": "Use ; para separar patrones de nombres, * para cualquier cantidad de símbolos, ? para uno.",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "Las carpetas se detectan a partir de archivos de compilación (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json); marcar o desmarcar una carpeta anula la detección. Las carpetas excluidas se omiten en la vista Proyecto, Buscar en archivos y el índice (vuelva a abrir el proyecto para reindexar).",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "Las carpetas se detectan a partir de archivos de compilación (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json); marcar o desmarcar una carpeta anula la detección. Las carpetas excluidas se omiten en la vista Proyecto, Buscar en archivos y el índice (vuelva a abrir el proyecto para reindexar).",
|
||||
"Project virtualenv (auto-detect)": "Virtualenv del proyecto (detección automática)",
|
||||
"<No interpreter>": "<Sin intérprete>",
|
||||
"Package name or requirement, e.g. requests or django==5.1": "Nombre del paquete o requisito, p. ej., requests o django==5.1",
|
||||
|
||||
@@ -3676,7 +3676,7 @@
|
||||
"JDK Location": "Emplacement du JDK",
|
||||
"Downloading JDK": "Téléchargement du JDK",
|
||||
"Use ; to separate name patterns, * for any number of symbols, ? for one.": "Utilisez ; pour séparer les motifs de noms, * pour un nombre quelconque de caractères, ? pour un seul.",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "Les dossiers sont détectés depuis les fichiers de build (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json) ; marquer ou démarquer un dossier remplace la détection. Les dossiers exclus sont ignorés par la vue Projet, Rechercher dans les fichiers et l'index (rouvrez le projet pour réindexer).",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "Les dossiers sont détectés depuis les fichiers de build (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json) ; marquer ou démarquer un dossier remplace la détection. Les dossiers exclus sont ignorés par la vue Projet, Rechercher dans les fichiers et l'index (rouvrez le projet pour réindexer).",
|
||||
"Project virtualenv (auto-detect)": "Virtualenv du projet (détection automatique)",
|
||||
"<No interpreter>": "<Aucun interpréteur>",
|
||||
"Package name or requirement, e.g. requests or django==5.1": "Nom de paquet ou contrainte, p. ex. requests ou django==5.1",
|
||||
|
||||
@@ -3789,7 +3789,7 @@
|
||||
"JDK Location": "JDK 위치",
|
||||
"Downloading JDK": "JDK 다운로드 중",
|
||||
"Use ; to separate name patterns, * for any number of symbols, ? for one.": "이름 패턴은 ;로 구분하고, *는 임의 개수의 문자, ?는 한 문자와 일치합니다.",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "폴더는 빌드 파일(pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json)에서 감지되며, 폴더를 표시하거나 표시 해제하면 감지 결과가 재정의됩니다. 제외된 폴더는 프로젝트 뷰, 파일에서 찾기 및 인덱스에서 건너뜁니다(다시 인덱싱하려면 프로젝트를 다시 여세요).",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "폴더는 빌드 파일(pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json)에서 감지되며, 폴더를 표시하거나 표시 해제하면 감지 결과가 재정의됩니다. 제외된 폴더는 프로젝트 뷰, 파일에서 찾기 및 인덱스에서 건너뜁니다(다시 인덱싱하려면 프로젝트를 다시 여세요).",
|
||||
"Project virtualenv (auto-detect)": "프로젝트 virtualenv(자동 감지)",
|
||||
"<No interpreter>": "<인터프리터 없음>",
|
||||
"Package name or requirement, e.g. requests or django==5.1": "패키지 이름 또는 요구 사항, 예: requests 또는 django==5.1",
|
||||
|
||||
@@ -3779,7 +3779,7 @@
|
||||
"JDK Location": "Lokalizacja JDK",
|
||||
"Downloading JDK": "Pobieranie JDK",
|
||||
"Use ; to separate name patterns, * for any number of symbols, ? for one.": "Użyj ; do rozdzielania wzorców nazw, * dla dowolnej liczby znaków, ? dla jednego znaku.",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "Foldery są wykrywane z plików budowania (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json); ręczne zaznaczenie lub odznaczenie foldera zastępuje automatyczne wykrywanie. Wykluczone foldery są pomijane w widoku Projektu, wyszukiwaniu w plikach oraz przez indeks (otwórz projekt ponownie, aby reindeksować).",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "Foldery są wykrywane z plików budowania (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json); ręczne zaznaczenie lub odznaczenie foldera zastępuje automatyczne wykrywanie. Wykluczone foldery są pomijane w widoku Projektu, wyszukiwaniu w plikach oraz przez indeks (otwórz projekt ponownie, aby reindeksować).",
|
||||
"Project virtualenv (auto-detect)": "Środowisko wirtualne projektu (automatyczne wykrywanie)",
|
||||
"<No interpreter>": "<No interpreter>",
|
||||
"Download JDK…": "Pobierz JDK…",
|
||||
|
||||
@@ -3782,7 +3782,7 @@
|
||||
"JDK Location": "Local do JDK",
|
||||
"Downloading JDK": "Baixando JDK",
|
||||
"Use ; to separate name patterns, * for any number of symbols, ? for one.": "Use ; para separar padrões de nomes, * para qualquer quantidade de caracteres, ? para um.",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "As pastas são detectadas a partir de arquivos de build (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json); marcar ou desmarcar uma pasta substitui a detecção. Pastas excluídas são ignoradas pela visualização do Projeto, Localizar em arquivos e pelo índice (reabra o projeto para reindexar).",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "As pastas são detectadas a partir de arquivos de build (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json); marcar ou desmarcar uma pasta substitui a detecção. Pastas excluídas são ignoradas pela visualização do Projeto, Localizar em arquivos e pelo índice (reabra o projeto para reindexar).",
|
||||
"Project virtualenv (auto-detect)": "Virtualenv do projeto (detecção automática)",
|
||||
"<No interpreter>": "<Nenhum interpretador>",
|
||||
"Package name or requirement, e.g. requests or django==5.1": "Nome do pacote ou requisito, p. ex. requests ou django==5.1",
|
||||
|
||||
@@ -1153,6 +1153,7 @@
|
||||
"Issue navigation links": "问题导航链接",
|
||||
"Italic": "斜体",
|
||||
"JUnit 5 Test": "JUnit 5 测试",
|
||||
"PHPUnit Test": "PHPUnit 测试",
|
||||
"JUnit test": "JUnit 测试",
|
||||
"JVM options": "JVM 选项",
|
||||
"Jump outside closing bracket/quote with Tab": "使用 Tab 跳出右括号/引号",
|
||||
@@ -2175,6 +2176,7 @@
|
||||
"Smart Step Into": "智能步入",
|
||||
"Smart Step Into failed": "智能步入失败",
|
||||
"Smart indent": "智能缩进",
|
||||
"Insert documentation comment stub": "插入文档注释存根",
|
||||
"Soft": "软",
|
||||
"Soft Wraps": "软换行",
|
||||
"Soft-Wrap": "软换行",
|
||||
@@ -3333,6 +3335,7 @@
|
||||
"Rust File › Test module": "Rust 文件 › 测试模块",
|
||||
"TypeScript File › Test": "TypeScript 文件 › 测试",
|
||||
"Python File › Test (pytest)": "Python 文件 › 测试 (pytest)",
|
||||
"PHP Class › PHPUnit Test": "PHP 类 › PHPUnit 测试",
|
||||
"CSS File": "CSS 文件",
|
||||
"SCSS File": "SCSS 文件",
|
||||
"Sass File": "Sass 文件",
|
||||
@@ -3872,7 +3875,7 @@
|
||||
"JDK Location": "JDK 位置",
|
||||
"Downloading JDK": "正在下载 JDK",
|
||||
"Use ; to separate name patterns, * for any number of symbols, ? for one.": "使用 ; 分隔名称模式,* 匹配任意数量的字符,? 匹配单个字符。",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "文件夹根据构建文件(pom.xml、build.gradle、Cargo.toml、go.mod、pyproject.toml、package.json)检测;标记或取消标记文件夹会覆盖检测结果。项目视图、在文件中查找和索引会跳过已排除的文件夹(重新打开项目以重新索引)。",
|
||||
"Folders are detected from build files (pom.xml, build.gradle, Cargo.toml, go.mod, pyproject.toml, package.json, composer.json); marking or unmarking a folder overrides detection. Excluded folders are skipped by the Project view, Find in Files and the index (reopen the project to re-index).": "文件夹根据构建文件(pom.xml、build.gradle、Cargo.toml、go.mod、pyproject.toml、package.json、composer.json)检测;标记或取消标记文件夹会覆盖检测结果。项目视图、在文件中查找和索引会跳过已排除的文件夹(重新打开项目以重新索引)。",
|
||||
"Project virtualenv (auto-detect)": "项目 virtualenv(自动检测)",
|
||||
"<No interpreter>": "<无解释器>",
|
||||
"Package name or requirement, e.g. requests or django==5.1": "软件包名称或需求,例如 requests 或 django==5.1",
|
||||
|
||||
Reference in new issue
Заблокувати користувача