From 7d314b5e0be3593cbb1e1e184199221a51d408b3 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Fri, 1 Mar 2024 12:25:42 -0800 Subject: [PATCH 1/3] test --- packages/compiler/src/server/type-details.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/compiler/src/server/type-details.ts b/packages/compiler/src/server/type-details.ts index 0d9c43fdde..67876a374e 100644 --- a/packages/compiler/src/server/type-details.ts +++ b/packages/compiler/src/server/type-details.ts @@ -64,8 +64,8 @@ function getSymbolDocumentation(program: Program, symbol: Sym) { // Add @doc(...) API docs const type = symbol.type ?? program.checker.getTypeForNode(symbol.declarations[0]); const apiDocs = getDocData(program, type); - // The doc comment is already included above we don't want to duplicate - if (apiDocs && apiDocs.source === "comment") { + // The doc comment is already included above we don't want to duplicate. Only include if it was specificed via `@doc` + if (apiDocs && apiDocs.source === "decorator") { docs.push(apiDocs.value); } From f1216a364fae87ca871103da18eaf64b94a85fa9 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Fri, 1 Mar 2024 12:28:56 -0800 Subject: [PATCH 2/3] Create fix-dup-doc-2024-2-1-20-28-15.md --- .chronus/changes/fix-dup-doc-2024-2-1-20-28-15.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .chronus/changes/fix-dup-doc-2024-2-1-20-28-15.md diff --git a/.chronus/changes/fix-dup-doc-2024-2-1-20-28-15.md b/.chronus/changes/fix-dup-doc-2024-2-1-20-28-15.md new file mode 100644 index 0000000000..1c45bcfe4c --- /dev/null +++ b/.chronus/changes/fix-dup-doc-2024-2-1-20-28-15.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: fix +packages: + - "@typespec/compiler" +--- + +[IDE] Fix type documentation shown twice when hovering symbols or in completion details. From 609d642fa5aecc4c01a1191076a0d010a9684812 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Fri, 1 Mar 2024 12:32:24 -0800 Subject: [PATCH 3/3] . --- packages/compiler/src/lib/decorators.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler/src/lib/decorators.ts b/packages/compiler/src/lib/decorators.ts index 29866cd033..eba631960a 100644 --- a/packages/compiler/src/lib/decorators.ts +++ b/packages/compiler/src/lib/decorators.ts @@ -91,7 +91,7 @@ export interface DocData { /** * How was the doc set. - * - `@doc` means the `@doc` decorator was used + * - `decorator` means the `@doc` decorator was used * - `comment` means it was set from a `/** comment * /` */ source: "decorator" | "comment";